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)"
|
rm -rf "$(LINUXSTANDALONE_DEST)"
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
cp -R standalone/linux/skel "$(LINUXSTANDALONE_DEST)"
|
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"
|
install -d "$(LINUXSTANDALONE_DEST)/bin"
|
||||||
cp dist/build/git-annex/git-annex "$(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.
|
support that; avoid crashing on such invalid encoding.
|
||||||
* runshell: Avoid failing when $HOME/.ssh does not exist and cannot be
|
* runshell: Avoid failing when $HOME/.ssh does not exist and cannot be
|
||||||
created.
|
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
|
-- 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)
|
ifeq ($(STANDALONE_BUILD),1)
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
make linuxstandalone
|
make linuxstandalone GIT_ANNEX_PACKAGE_INSTALL=1
|
||||||
|
|
||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
: # nothing to do, we just need to copy the beast, as instructed in debian/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
|
trap cleanuptbase EXIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install shim that's used to run git-annex-shell from ssh authorized_keys.
|
# Set this variable when using this script inside a package of git-annex,
|
||||||
# The assistant also does this when run, but the user may not be using the
|
# which arranges for git-annex, git-annex-shell, and git to all be in the
|
||||||
# assistant.
|
# standard PATH.
|
||||||
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
|
GIT_ANNEX_PACKAGE_INSTALL=
|
||||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
if [ -z "$GIT_ANNEX_PACKAGE_INSTALL" ]; then
|
||||||
if [ -e "$HOME/.ssh" ]; 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
|
||||||
echo "#!/bin/sh"
|
# be using the assistant.
|
||||||
echo "set -e"
|
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
|
||||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||||
echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
if [ -e "$HOME/.ssh" ]; then
|
||||||
echo "else"
|
(
|
||||||
echo "exec '$base/runshell' git-annex-shell -c \"\$@\""
|
echo "#!/bin/sh"
|
||||||
echo "fi"
|
echo "set -e"
|
||||||
) > "$HOME/.ssh/git-annex-shell"
|
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
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
|
||||||
fi
|
|
||||||
|
|
||||||
# And this shim is used by the webapp when adding a remote ssh server.
|
# And this shim is used by the webapp when adding a remote ssh server.
|
||||||
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
|
if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then
|
||||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||||
if [ -e "$HOME/.ssh" ]; then
|
if [ -e "$HOME/.ssh" ]; then
|
||||||
(
|
(
|
||||||
echo "#!/bin/sh"
|
echo "#!/bin/sh"
|
||||||
echo "set -e"
|
echo "set -e"
|
||||||
echo "exec '$base/runshell' \"\$@\""
|
echo "exec '$base/runshell' \"\$@\""
|
||||||
) > "$HOME/.ssh/git-annex-wrapper"
|
) > "$HOME/.ssh/git-annex-wrapper"
|
||||||
chmod +x "$HOME/.ssh/git-annex-wrapper"
|
chmod +x "$HOME/.ssh/git-annex-wrapper"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue