From acfaa421d1a50e43ef8fb3001a095041eaae955d Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Mon, 15 Nov 2010 05:04:20 +0530 Subject: [PATCH] BSD compat changes - openssh 5.6 doesn't like "ssh user@host" with no command following it, because they changed the rules for pty allocation failure. I'm calling this a BSD compat change because BSD hit it first, but really, the "ssh -T" will eventually be needed by Linuxes also, as they start upgrading to openssh 5.6 - FreeBSD (and I presume the other BSDs also) *require* a "-t" argument to mktemp (thanks to matias for finding this). Note that on FreeBSD, -t is a prefix (the X's are taken literally, and the real random stuff gets appended to the prefix), while on Linux, it is a template (the X's are converted to random characters). Thus, on BSD you will get names like /tmp/tmp.XXXXXXXXXX.1BAEGkHm, whereas on Linux you'll get /tmp/tmp.Aq7vbdNpGp or something. --- src/gl-dont-panic | 2 +- src/gl-easy-install | 2 +- src/gl-setup | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gl-dont-panic b/src/gl-dont-panic index 7bd4ea9..4c7439d 100755 --- a/src/gl-dont-panic +++ b/src/gl-dont-panic @@ -70,7 +70,7 @@ export REPO_BASE export GL_BINDIR export GL_ADMINDIR -TEMPDIR=$(mktemp -d) +TEMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) export TEMPDIR trap "/bin/rm -rf $TEMPDIR" 0 diff --git a/src/gl-easy-install b/src/gl-easy-install index 18cbe1e..a2f8598 100755 --- a/src/gl-easy-install +++ b/src/gl-easy-install @@ -437,7 +437,7 @@ setup_pta() { PATH=\$PATH:$GIT_PATH GIT_WORK_TREE=$GL_ADMINDIR git add conf/gitolite.conf keydir GIT_WORK_TREE=$GL_ADMINDIR git diff --cached --quiet 2>/dev/null || GIT_WORK_TREE=$GL_ADMINDIR git commit -am start -" | ssh $p_port $user@$host +" | ssh -T $p_port $user@$host # MANUAL: now that the admin repo is created, you have to set the hooks # properly. The install program does this. So cd back to the diff --git a/src/gl-setup b/src/gl-setup index c58edc9..a8797fe 100755 --- a/src/gl-setup +++ b/src/gl-setup @@ -20,7 +20,7 @@ GL_PACKAGE_CONF=/tmp/share/gitolite/conf die() { echo "$@"; exit 1; } -TEMPDIR=$(mktemp -d) +TEMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX) export TEMPDIR trap "/bin/rm -rf $TEMPDIR" 0