Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • X xauth
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • app
  • xauth
  • Issues
  • #2
Closed
Open
Issue created May 21, 2019 by martin wheatley@martin.wheatley.ukaea.uk

xauth has window when there is no usable XAUTHORITY file or can abort destroying the XAUTHORITY file

The following command sequence (on Solaris) demonstrates the issue; but the equivalent sequence on Linux also shows the problem.

XAUTHORITY=/tmp/junk
export XAUTHORITY

touch $XAUTHORITY

truss xauth add ALL:34 MIT-MAGIC-COOKIE-1 a1a64cb8296b0988852ebbb6bc18be08 2>&1 | grep junk

the output from the truss | grep is...

stat("/tmp/junk-c", 0xFFBFEB70) Err#2 ENOENT
open("/tmp/junk-c", O_WRONLY|O_CREAT|O_EXCL, 0600) = 3
link("/tmp/junk-c", "/tmp/junk-l") = 0
access("/tmp/junk", F_OK) = 0
access("/tmp/junk", W_OK) = 0
open("/tmp/junk", O_RDONLY) = 3
unlink("/tmp/junk-n") Err#2 ENOENT
open("/tmp/junk-n", O_WRONLY|O_CREAT|O_EXCL, 0600) = 4
unlink("/tmp/junk") = 0
##############################################################
link("/tmp/junk-n", "/tmp/junk") = 0
unlink("/tmp/junk-n") = 0
unlink("/tmp/junk-c") = 0
unlink("/tmp/junk-l") = 0

where the line of ####s is is a window during which the XAUTHORITY file does not exist so X applications that attempt to start in this window fail because that cannot determine a valid X authority. Also, if the xauth is terminated (EG SIGKILL) at this point no usable XAUTHORITY file remains

Perhaps the link() that follows the #####s should be a rename() to ensure that the XAUTHORITY file is never not present

Edited Jun 17, 2019 by Peter Hutterer
Assignee
Assign to
Time tracking