Make the git-annex-standalone.deb prevent runshell from installing wrappers into $HOME/.ssh
This commit is contained in:
parent
3e49f9fcab
commit
d9d87fdbc9
4 changed files with 37 additions and 28 deletions
1
Makefile
1
Makefile
|
@ -118,6 +118,7 @@ linuxstandalone-nobuild: Build/Standalone Build/LinuxMkLibs
|
|||
rm -rf "$(LINUXSTANDALONE_DEST)"
|
||||
mkdir -p tmp
|
||||
cp -R standalone/linux/skel "$(LINUXSTANDALONE_DEST)"
|
||||
sed -i -e 's/^GIT_ANNEX_PACKAGE_INSTALL=/GIT_ANNEX_PACKAGE_INSTALL=$(GIT_ANNEX_PACKAGE_INSTALL)/' "$(LINUXSTANDALONE_DEST)/runshell"
|
||||
|
||||
install -d "$(LINUXSTANDALONE_DEST)/bin"
|
||||
cp dist/build/git-annex/git-annex "$(LINUXSTANDALONE_DEST)/bin/"
|
||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -18,6 +18,8 @@ git-annex (5.20151102.2) UNRELEASED; urgency=medium
|
|||
support that; avoid crashing on such invalid encoding.
|
||||
* runshell: Avoid failing when $HOME/.ssh does not exist and cannot be
|
||||
created.
|
||||
* Make the git-annex-standalone.deb prevent runshell from installing
|
||||
wrappers into $HOME/.ssh
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Wed, 04 Nov 2015 12:50:20 -0400
|
||||
|
||||
|
|
2
debian/rules
vendored
2
debian/rules
vendored
|
@ -16,7 +16,7 @@ export RELEASE_BUILD=1
|
|||
ifeq ($(STANDALONE_BUILD),1)
|
||||
|
||||
override_dh_auto_build:
|
||||
make linuxstandalone
|
||||
make linuxstandalone GIT_ANNEX_PACKAGE_INSTALL=1
|
||||
|
||||
override_dh_auto_install:
|
||||
: # nothing to do, we just need to copy the beast, as instructed in debian/install
|
||||
|
|
|
@ -42,35 +42,41 @@ if echo "$base" | grep -q '[:;]'; then
|
|||
trap cleanuptbase EXIT
|
||||
fi
|
||||
|
||||
# Install shim that's used to run git-annex-shell from ssh authorized_keys.
|
||||
# The assistant also does this when run, but the user may not be using the
|
||||
# assistant.
|
||||
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
|
||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||
if [ -e "$HOME/.ssh" ]; then
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||
echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
||||
echo "else"
|
||||
echo "exec '$base/runshell' git-annex-shell -c \"\$@\""
|
||||
echo "fi"
|
||||
) > "$HOME/.ssh/git-annex-shell"
|
||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
||||
# Set this variable when using this script inside a package of git-annex,
|
||||
# which arranges for git-annex, git-annex-shell, and git to all be in the
|
||||
# standard PATH.
|
||||
GIT_ANNEX_PACKAGE_INSTALL=
|
||||
if [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
|
||||
# Install shim that's used to run git-annex-shell from ssh authorized
|
||||
# keys. The assistant also does this when run, but the user may not
|
||||
# be using the assistant.
|
||||
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
|
||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||
if [ -e "$HOME/.ssh" ]; then
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||
echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
||||
echo "else"
|
||||
echo "exec '$base/runshell' git-annex-shell -c \"\$@\""
|
||||
echo "fi"
|
||||
) > "$HOME/.ssh/git-annex-shell"
|
||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# And this shim is used by the webapp when adding a remote ssh server.
|
||||
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
|
||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||
if [ -e "$HOME/.ssh" ]; then
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "exec '$base/runshell' \"\$@\""
|
||||
) > "$HOME/.ssh/git-annex-wrapper"
|
||||
chmod +x "$HOME/.ssh/git-annex-wrapper"
|
||||
# And this shim is used by the webapp when adding a remote ssh server.
|
||||
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
|
||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||
if [ -e "$HOME/.ssh" ]; then
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "exec '$base/runshell' \"\$@\""
|
||||
) > "$HOME/.ssh/git-annex-wrapper"
|
||||
chmod +x "$HOME/.ssh/git-annex-wrapper"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue