!113 [sync] PR-111: Don't report a usage error for "sudo -V"
From: @openeuler-sync-bot Reviewed-by: @HuaxinLuGitee Signed-off-by: @HuaxinLuGitee
This commit is contained in:
commit
bda97a71fc
38
backport-don-t-report-a-usage-error-for-sudo-V.patch
Normal file
38
backport-don-t-report-a-usage-error-for-sudo-V.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From b9a0c72fd1ffa668b2e725f01fce66e3a2c82b05 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
|
||||||
|
Date: Tue, 30 Mar 2021 15:17:31 -0600
|
||||||
|
Subject: [PATCH] Don't report a usage error for "sudo -V". GitHub issue #95
|
||||||
|
|
||||||
|
---
|
||||||
|
src/parse_args.c | 8 +++++---
|
||||||
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/parse_args.c b/src/parse_args.c
|
||||||
|
index eeca9af7a..50933816d 100644
|
||||||
|
--- a/src/parse_args.c
|
||||||
|
+++ b/src/parse_args.c
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: ISC
|
||||||
|
*
|
||||||
|
- * Copyright (c) 1993-1996, 1998-2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
|
+ * Copyright (c) 1993-1996, 1998-2021 Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@@ -511,8 +511,10 @@ parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
|
||||||
|
valid_flags = VALIDATE_VALID_FLAGS;
|
||||||
|
break;
|
||||||
|
case 'V':
|
||||||
|
- if (mode && mode != MODE_VERSION)
|
||||||
|
- usage_excl();
|
||||||
|
+ if (mode && mode != MODE_VERSION) {
|
||||||
|
+ if (strcmp(progname, "sudoedit") != 0)
|
||||||
|
+ usage_excl();
|
||||||
|
+ }
|
||||||
|
mode = MODE_VERSION;
|
||||||
|
valid_flags = 0;
|
||||||
|
break;
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: sudo
|
Name: sudo
|
||||||
Version: 1.9.2
|
Version: 1.9.2
|
||||||
Release: 13
|
Release: 14
|
||||||
Summary: Allows restricted root access for specified users
|
Summary: Allows restricted root access for specified users
|
||||||
License: ISC
|
License: ISC
|
||||||
URL: http://www.courtesan.com/sudo/
|
URL: http://www.courtesan.com/sudo/
|
||||||
@ -36,6 +36,7 @@ Patch22: backport-sudo_passwd_cleanup-Set-auth-data-to-NULL-after-free.patch
|
|||||||
Patch23: backport-CVE-2023-22809.patch
|
Patch23: backport-CVE-2023-22809.patch
|
||||||
Patch24: backport-CVE-2023-28486_CVE-2023-28487.patch
|
Patch24: backport-CVE-2023-28486_CVE-2023-28487.patch
|
||||||
Patch25: Fix-compilation-error-on-sw64-arch.patch
|
Patch25: Fix-compilation-error-on-sw64-arch.patch
|
||||||
|
Patch26: backport-don-t-report-a-usage-error-for-sudo-V.patch
|
||||||
|
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
Requires: pam
|
Requires: pam
|
||||||
@ -176,6 +177,9 @@ install -p -c -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/sudo-i
|
|||||||
%exclude %{_pkgdocdir}/ChangeLog
|
%exclude %{_pkgdocdir}/ChangeLog
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 27 2023 zhangruifang <zhangruifang1@h-partners.com> - 1.9.2-14
|
||||||
|
- Don't report a usage error for "sudo -V".
|
||||||
|
|
||||||
* Wed Apr 12 2023 wangyu <wangyu283@huawei.com> - 1.9.2-13
|
* Wed Apr 12 2023 wangyu <wangyu283@huawei.com> - 1.9.2-13
|
||||||
- Fix compilation error on sw64 arch.
|
- Fix compilation error on sw64 arch.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user