Bug 801

Summary: The askpass option don't work anymore
Product: Sudo Reporter: Dieter9 <drvr741>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.21   
Hardware: PC   
OS: Linux   

Description Dieter9 2017-09-06 10:14:17 MDT
After the last sudo update from 1.8.20.p2 to 1.8.21.p1 on arch-linux, there is a bug in sudo.
When using the askpass option the command is not executed anymore.

example with akspass:
$ sudo -A touch /sudo-test
$ ls -l /sudo-test
ls: Zugriff auf '/sudo-test' nicht möglich: Datei oder Verzeichnis nicht gefunden (file not found)

But logfile shows:
sudo[1057]:     user : TTY=pts/0 ; PWD=/home/user/Programme ; USER=root ; COMMAND=/usr/bin/touch /sudo-test

sudo has not execute the touch command!

My askpass-program for this example was:
#!/bin/bash
echo 'password'


Same example without askpass:
$sudo touch /sudo-test
[sudo] Passwort für user: 
$ ls -l /sudo-test
-rw-r--r-- 1 root root 0  6. Sep 17:50 /sudo-test

Logfile shows:
sudo[1081]:     user : TTY=pts/0 ; PWD=/home/user/Programme ; USER=root ; COMMAND=/usr/bin/touch /sudo-test

This time the command was executed!


After downgrade to 1.8.20.p2 the example works even with askpass.
Comment 1 Todd C. Miller 2017-09-06 15:03:27 MDT
Sorry but I'm unable to reproduce this.  I installed Arch in a VM and see the following behavior:

[millert@arch ~]$ sudo -V
Sudo version 1.8.21p1
Sudoers policy plugin version 1.8.21p1
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.21p1
[millert@arch ~]$ cat /tmp/askpass
#!/bin/sh
echo 'password'
exit 0
[millert@arch ~]$ SUDO_ASKPASS=/tmp/askpass sudo -A id

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts

This gives me the expected log entry:

sudo[892]:  millert : 3 incorrect password attempts ; TTY=pts/0 ; PWD=/home/millert ; USER=root ; COMMAND=/usr/bin/id
Comment 2 Todd C. Miller 2017-09-06 15:34:36 MDT
I'm now able to reproduce the problem.
Comment 3 Todd C. Miller 2017-09-06 16:14:36 MDT
This is fixed by https://www.sudo.ws/repos/sudo/rev/57f636b6489f
Comment 4 Dieter9 2017-09-07 02:14:14 MDT
I can confirm, that your patch fix the problem.
Thank you for your very quick response. :)
Comment 5 Todd C. Miller 2017-09-07 05:49:49 MDT
Sudo 1.8.21p2 is out now which includes the fix.