]> git.madduck.net Git - etc/ssh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

sshrc needs to handle xauth
authormartin f. krafft <madduck@madduck.net>
Fri, 15 May 2020 11:42:23 +0000 (23:42 +1200)
committermartin f. krafft <madduck@madduck.net>
Fri, 15 May 2020 11:42:23 +0000 (23:42 +1200)
.ssh/rc

diff --git a/.ssh/rc b/.ssh/rc
index a70d65c47575dfa9abc19011f6d20bfbead68212..a755dca679f8401ea4ce11583bc418d1825485ab 100644 (file)
--- a/.ssh/rc
+++ b/.ssh/rc
@@ -3,3 +3,14 @@ PERSISTENT_AUTH_SOCK=$VARDIR/ssh/persistent-ssh-auth.sock
 if [ ! -S "$PERSISTENT_AUTH_SOCK" ] && [ -S "$SSH_AUTH_SOCK" ]; then
   ln -sf "$SSH_AUTH_SOCK" "$PERSISTENT_AUTH_SOCK"
 fi
 if [ ! -S "$PERSISTENT_AUTH_SOCK" ] && [ -S "$SSH_AUTH_SOCK" ]; then
   ln -sf "$SSH_AUTH_SOCK" "$PERSISTENT_AUTH_SOCK"
 fi
+
+if [ -n "${DISPLAY:-}" ]; then
+  read proto cookie
+  if [ "${DISPLAY%%:*}" = localhost ]; then
+    # X11UseLocalhost=yes
+    echo add unix:$(echo $DISPLAY | cut -c11-) $proto $cookie
+  else
+    # X11UseLocalhost=no
+    echo add $DISPLAY $proto $cookie
+  fi | xauth -q -
+fi