Bug 639

Summary: "sudo -l" asks for wrong password when using targetpw, rootpw or runaspw
Product: Sudo Reporter: Evangelos Foutras <evangelos>
Component: SudoersAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.10   
Hardware: PC   
OS: Linux   
Attachments: Fix %p expansion for sudo -l with targetpw etc

Description Evangelos Foutras 2014-03-19 15:37:17 MDT
Starting with sudo 1.8.10, the "sudo -l" command is supposed to ask for the user password even when targetpw, rootpw or runaspw is specified in /etc/sudoers.

The password prompt, however, incorrectly asks for the root password when it really wants (and only accepts) the user password.

For example, with rootpw set:

Expected prompt:

$ sudo -l
[sudo] password for myuser:

Actual prompt:

$ sudo -l
[sudo] password for root:

I'm building sudo with: --with-passprompt="[sudo] password for %p: "
Comment 1 Todd C. Miller 2014-03-19 16:53:14 MDT
Created attachment 400 [details]
Fix %p expansion for sudo -l with targetpw etc

The attached patch fixes it for me.
Comment 2 Evangelos Foutras 2014-03-19 17:24:35 MDT
(In reply to Todd C Miller from comment #1)
> Created attachment 400 [details]
> Fix %p expansion for sudo -l with targetpw etc
> 
> The attached patch fixes it for me.

Works for me as well. Thanks!
Comment 3 Todd C. Miller 2014-05-07 13:19:22 MDT
Fixed in sudo 1.8.10p3