XauLockAuth() imposing huge delay (ignores EACCES errors)
Submitted by Radosław Zieliński
Assigned to Jeremy Huddleston Sequoia
Description
"su - something" calls pam_xauth.so (if enabled), which calls xauth, which calls the XauLockAuth() from libXau.
It contains the following snippet:
while (retries > 0) {
if (creat_fd == -1) {
creat_fd = open (creat_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (creat_fd == -1) {
if (errno != EACCES)
return LOCK_ERROR;
...which makes it ignore the "access denied" error and retry / wait again. The effect: "su - other_user" from an X session is slow (20 seconds delay).
Obviously, the other_user is not supposed to be able to create my ~/.Xauthority-c.