Bug 798 - sudo not writing .Xauthority
sudo not writing .Xauthority
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.15
IBM AIX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-30 07:20 MDT by Henrik Morsing
Modified: 2017-08-30 09:27 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.