From: Peter Palfrader Date: Sat, 17 May 2008 09:40:33 +0000 (+0200) Subject: Fuzz with the shell in ud-replicate's sshkeys part X-Git-Tag: userdir-ldap-0.3.24~4 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=fbc20c5c8e1bd1088fdb3fb5cd2cb074f4807346;hp=432f864af2347050e3dce2ff7002f04176468206;p=mirror%2Fuserdir-ldap.git Fuzz with the shell in ud-replicate's sshkeys part --- diff --git a/ud-replicate b/ud-replicate index f148bf6..56dbbd2 100755 --- a/ud-replicate +++ b/ud-replicate @@ -78,12 +78,10 @@ ln -sf `pwd -P`/ssh-rsa-shadow /etc/ssh ln -sf `pwd -P`/ssh_known_hosts /etc/ssh if [ -e ${HOST}/ssh-keys.tar.gz ]; then - export TMPDIR='/tmp/' + export TMPDIR='/tmp/' tempdir=$(mktemp -d) - old=$(pwd -P) - cd $tempdir && tar -xf ${old}/${HOST}/ssh-keys.tar.gz - cd $old - mkdir userkeys 2> /dev/null || true + (cd $tempdir && tar -xf ${old}/${HOST}/ssh-keys.tar.gz) + ! [ -d userkeys ] || mkdir userkeys chmod 755 $tempdir rsync -a --delete-after $tempdir/ userkeys/ fi