Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
upgpkg: sudo 1.9.8-2: fix custom password prompt (FS#72146)
Browse files Browse the repository at this point in the history
git-svn-id: file:///srv/repos/svn-packages/svn@424077 eb2447ed-0c53-47e4-bac8-5bc4a241df78
  • Loading branch information
foutrelis authored and svntogit committed Sep 16, 2021
1 parent 7dccd36 commit fb4cc13
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
6 changes: 5 additions & 1 deletion trunk/PKGBUILD
Expand Up @@ -4,7 +4,7 @@

pkgname=sudo
_sudover=1.9.8
pkgrel=1
pkgrel=2
pkgver=${_sudover/p/.p}
pkgdesc="Give certain users the ability to run some commands as root"
arch=('x86_64')
Expand All @@ -18,16 +18,20 @@ backup=('etc/pam.d/sudo'
'etc/sudoers')
install=$pkgname.install
source=(https://www.sudo.ws/sudo/dist/$pkgname-$_sudover.tar.gz{,.sig}
append_defaults-boolean-flags.patch
sudo_logsrvd.service
sudo.pam)
sha256sums=('f1735de999804ea1af068fba6a82cb6674ea64c789813b29266fd3b16cb294e6'
'SKIP'
'36648e052a834275636bef75a00197e43cd1baaa07006cd3b426e99cc109b4b9'
'8b91733b73171827c360a3e01f4692772b78e62ceca0cf0fd4b770aba35081a1'
'd1738818070684a5d2c9b26224906aad69a4fea77aabd960fc2675aee2df1fa2')
validpgpkeys=('59D1E9CCBA2B376704FDD35BA9F4C021CEA470FB')

prepare() {
cd "$srcdir/$pkgname-$_sudover"
# https://bugs.archlinux.org/task/72146
patch -Np1 -i ../append_defaults-boolean-flags.patch
}

build() {
Expand Down
48 changes: 48 additions & 0 deletions trunk/append_defaults-boolean-flags.patch
@@ -0,0 +1,48 @@
From d7cdf1e47c596c3fa6cffedd4904c67919389668 Mon Sep 17 00:00:00 2001
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
Date: Tue, 14 Sep 2021 08:02:37 -0600
Subject: [PATCH] append_defaults() should not be passed a value for boolean
flags. The operation should simply be set to true/false. Also treat a NULL
file as coming from the front-end. Bug #993.

---
plugins/sudoers/defaults.c | 3 +++
plugins/sudoers/policy.c | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugins/sudoers/defaults.c b/plugins/sudoers/defaults.c
index 5739b40e2..95e6fbd30 100644
--- a/plugins/sudoers/defaults.c
+++ b/plugins/sudoers/defaults.c
@@ -206,6 +206,9 @@ parse_default_entry(struct sudo_defs_types *def, const char *val, int op,
int rc;
debug_decl(parse_default_entry, SUDOERS_DEBUG_DEFAULTS);

+ if (file == NULL)
+ file = "front-end";
+
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: %s:%d:%d: %s=%s op=%d",
__func__, file, line, column, def->name, val ? val : "", op);

diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c
index eb1ce43b7..c8c20735d 100644
--- a/plugins/sudoers/policy.c
+++ b/plugins/sudoers/policy.c
@@ -224,7 +224,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults)
if (MATCHES(*cur, "prompt=")) {
/* Allow epmpty prompt. */
user_prompt = *cur + sizeof("prompt=") - 1;
- if (!append_default("passprompt_override", "true", true, NULL, defaults))
+ if (!append_default("passprompt_override", NULL, true, NULL, defaults))
goto oom;
continue;
}
@@ -285,7 +285,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults)
if (MATCHES(*cur, "login_class=")) {
CHECK(*cur, "login_class=");
login_class = *cur + sizeof("login_class=") - 1;
- if (!append_default("use_loginclass", "true", true, NULL, defaults))
+ if (!append_default("use_loginclass", NULL, true, NULL, defaults))
goto oom;
continue;
}

1 comment on commit fb4cc13

@tachtler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
with Version 1.9.8-1

klaus@archlinux ~]$ sudo -p "Sir, Enter Your password: " pacman -Syu
sudo: (null): option "passprompt_override" does not take a value
sudo: error initializing audit plugin sudoers_audit

with Version 1.9.8-2

[klaus@archlinux sudo]$ sudo -p "Sir, Enter Your password: " pacman -Syu
Sir, Enter Your password: 
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
warning: sudo: local (1.9.8-2) is newer than core (1.9.8-1)
 there is nothing to do

Thank you!
Klaus.

Please sign in to comment.