diff --git a/sudo-1.9.9-honor-T_opt.patch b/sudo-1.9.9-honor-T_opt.patch new file mode 100644 index 0000000..cb51a76 --- /dev/null +++ b/sudo-1.9.9-honor-T_opt.patch @@ -0,0 +1,22 @@ +From 1f3815c4fb3f282250ff30626979d224e30b4b05 Mon Sep 17 00:00:00 2001 +From: Jaroslav Jindrak +Date: Wed, 9 Feb 2022 17:37:26 +0100 +Subject: [PATCH] Do not unset user timeout when no default timeout is set. + +--- + plugins/sudoers/policy.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c +index 26c4be3fe..0482b58dd 100644 +--- a/plugins/sudoers/policy.c ++++ b/plugins/sudoers/policy.c +@@ -865,7 +865,7 @@ sudoers_policy_store_result(bool accepted, char *argv[], char *envp[], + + if (def_command_timeout > 0 || user_timeout > 0) { + int timeout = user_timeout; +- if (timeout == 0 || def_command_timeout < timeout) ++ if (timeout == 0 || (def_command_timeout > 0 && def_command_timeout < timeout)) + timeout = def_command_timeout; + if (asprintf(&command_info[info_len++], "timeout=%u", timeout) == -1) + goto oom; diff --git a/sudo.changes b/sudo.changes index 3e90821..687dda8 100644 --- a/sudo.changes +++ b/sudo.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Mar 3 12:00:46 UTC 2022 - Jason Sikes + +- Add sudo-1.9.9-honor-T_opt.patch + * the -T option of sudo does nothing even when + 'Defaults user_command_timeouts' is present in the configuration. + * [bsc#1193446] + * Credit to Jaroslav Jindrak + ------------------------------------------------------------------- Wed Feb 16 04:34:33 UTC 2022 - Simon Lees diff --git a/sudo.spec b/sudo.spec index a6eaac5..594e559 100644 --- a/sudo.spec +++ b/sudo.spec @@ -39,6 +39,7 @@ Source7: README_313276.test # PATCH-OPENSUSE: the "SUSE" branding of the default sudo config Patch0: sudo-sudoers.patch Patch1: feature-upstream-restrict-sudo-U-other-l.patch +Patch2: sudo-1.9.9-honor-T_opt.patch BuildRequires: audit-devel BuildRequires: cyrus-sasl-devel BuildRequires: groff