1 # Merge xauth cookies into home stash.
2 if [ -n "$XAUTHORITY" ]; then
3 if [ -r "$XAUTHORITY" ]; then
4 # If we are root the old file may have been chowned.
5 [ -n "$SUDO_UID" -a -O "$XAUTHORITY" ] && chown "$SUDO_UID" "$XAUTHORITY"
6 [ -n "$SUDO_GID" -a -G "$XAUTHORITY" ] && chgrp "$SUDO_GID" "$XAUTHORITY"
9 exec 3<&0 < "$XAUTHORITY"
11 xauth merge - 2>/dev/null
14 # We can't read the file so just unset.