Bug 228

Summary: HOME not set if NOPASSWD tag used
Product: Sudo Reporter: Henning Moll <newsScott>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: low    
Version: 1.6.8   
Hardware: Other   
OS: Linux   

Description Henning Moll 2006-11-16 18:40:04 MST
System: a fresh ubuntu dapper install. The sudoers file looks like this:

---sudoers---
Defaults        !lecture,tty_tickets,!fqdn
root    ALL=(ALL) ALL
%admin  ALL=(ALL) ALL
---sudoers---

All following commands are executed by a user who is member of group 'admin'.
The output of command
sudo bash -c env | grep HOME
is
HOME=/home/<calling_user>

Now, if i append '%admin ALL=(ALL) NOPASSWD: /bin/bash' to the sudoers file and run the above command again no password is required, but the output is empty.
Why is there this different behaviour? This has bad impact for X applications: Only if $HOME is set, the <calling_user's> .Xauthority file is found and access to the XServer is granted. Without HOME being set (just by using NOPASSWD), access is denied.
Comment 1 Henning Moll 2007-11-15 10:44:37 MST
same applies to

sudo bash -c env | grep XAUTHORITY
Comment 2 Todd C. Miller 2008-11-07 09:42:19 MST
Unable to reproduce with sudo 1.6.9p17