Bug 798

Summary: sudo not writing .Xauthority
Product: Sudo Reporter: Henrik Morsing <henrik>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: low    
Version: 1.8.15   
Hardware: IBM   
OS: AIX   

Description Henrik Morsing 2017-08-30 07:20:29 MDT
sudo running xauth list doesn't write .Xauthority even though it claims to do so:

--> sudo -u metron xauth list
1356-364 xauth:  creating new authority file /home/metron/.Xauthority
--> ls -l /home/metron/.Xauthority
ls: 0653-341 The file /home/metron/.Xauthority does not exist.

Writing ordinary file works:

--> sudo -u metron touch /home/metron/file
--> ls -l /home/metron/file
-rw-r-----    1 metron   adm               0 30 Aug 14:19 /home/metron/file
-->
Comment 1 Todd C. Miller 2017-08-30 09:27:48 MDT
This is not a sudo bug.  Newer versions of xauth report an error when running "xauth list" if the .Xauthority file doesn't exist but the AIX version does not seem to.

If you run "xauth list" on AIX without sudo you'll see the same behavior.  For example on AIX 7.1 I see:

-bash-4.3$ xauth list
1356-364 xauth:  creating new authority file /usr/users/luser/.Xauthority
-bash-4.3$ ls -l /usr/users/luser/.Xauthority
ls: 0653-341 The file /usr/users/luser/.Xauthority does not exist.

Basically, the AIX xauth will always report "creating new authority file" when the .Xauthority file is missing, even if it has not created it.