diff options
-rwxr-xr-x | debian/agent-launch | 5 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/openssh-client.postinst | 1 | ||||
-rw-r--r-- | debian/openssh-server.postinst | 5 | ||||
-rwxr-xr-x | debian/openssh-server.ssh.init | 4 | ||||
-rw-r--r-- | debian/openssh-server.ssh.runscript/finish | 10 |
6 files changed, 20 insertions, 11 deletions
diff --git a/debian/agent-launch b/debian/agent-launch index f3cbfaef8..3b2abdbf7 100755 --- a/debian/agent-launch +++ b/debian/agent-launch | |||
@@ -3,6 +3,7 @@ | |||
3 | set -e | 3 | set -e |
4 | 4 | ||
5 | if [ ! -d "$XDG_RUNTIME_DIR" ]; then | 5 | if [ ! -d "$XDG_RUNTIME_DIR" ]; then |
6 | # shellcheck disable=SC2016 | ||
6 | echo 'This needs $XDG_RUNTIME_DIR to be set' >&2 | 7 | echo 'This needs $XDG_RUNTIME_DIR to be set' >&2 |
7 | exit 1 | 8 | exit 1 |
8 | fi | 9 | fi |
@@ -10,8 +11,8 @@ fi | |||
10 | if [ "$1" = start ]; then | 11 | if [ "$1" = start ]; then |
11 | if [ -z "$SSH_AUTH_SOCK" ] && grep -s -q '^use-ssh-agent$' /etc/X11/Xsession.options; then | 12 | if [ -z "$SSH_AUTH_SOCK" ] && grep -s -q '^use-ssh-agent$' /etc/X11/Xsession.options; then |
12 | S="$XDG_RUNTIME_DIR/openssh_agent" | 13 | S="$XDG_RUNTIME_DIR/openssh_agent" |
13 | dbus-update-activation-environment --verbose --systemd SSH_AUTH_SOCK=$S SSH_AGENT_LAUNCHER=openssh | 14 | dbus-update-activation-environment --verbose --systemd SSH_AUTH_SOCK="$S" SSH_AGENT_LAUNCHER=openssh |
14 | exec ssh-agent -D -a $S | 15 | exec ssh-agent -D -a "$S" |
15 | fi | 16 | fi |
16 | elif [ "$1" = stop ]; then | 17 | elif [ "$1" = stop ]; then |
17 | if [ "$SSH_AGENT_LAUNCHER" = openssh ]; then | 18 | if [ "$SSH_AGENT_LAUNCHER" = openssh ]; then |
diff --git a/debian/changelog b/debian/changelog index e9ee5d1eb..69cbf0b4e 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -1,3 +1,9 @@ | |||
1 | openssh (1:8.2p1-5) UNRELEASED; urgency=medium | ||
2 | |||
3 | * Fix or suppress various shellcheck errors under debian/. | ||
4 | |||
5 | -- Colin Watson <cjwatson@debian.org> Sat, 23 May 2020 12:46:19 +0100 | ||
6 | |||
1 | openssh (1:8.2p1-4) unstable; urgency=medium | 7 | openssh (1:8.2p1-4) unstable; urgency=medium |
2 | 8 | ||
3 | * Add /etc/ssh/ssh_config.d/ to openssh-client. | 9 | * Add /etc/ssh/ssh_config.d/ to openssh-client. |
diff --git a/debian/openssh-client.postinst b/debian/openssh-client.postinst index ec0ad2b2b..cf046ed7c 100644 --- a/debian/openssh-client.postinst +++ b/debian/openssh-client.postinst | |||
@@ -2,7 +2,6 @@ | |||
2 | set -e | 2 | set -e |
3 | 3 | ||
4 | action="$1" | 4 | action="$1" |
5 | oldversion="$2" | ||
6 | 5 | ||
7 | umask 022 | 6 | umask 022 |
8 | 7 | ||
diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst index 552b0744e..f45f5851c 100644 --- a/debian/openssh-server.postinst +++ b/debian/openssh-server.postinst | |||
@@ -5,7 +5,6 @@ set -e | |||
5 | db_version 2.0 | 5 | db_version 2.0 |
6 | 6 | ||
7 | action="$1" | 7 | action="$1" |
8 | oldversion="$2" | ||
9 | 8 | ||
10 | umask 022 | 9 | umask 022 |
11 | 10 | ||
@@ -47,7 +46,7 @@ create_key() { | |||
47 | 46 | ||
48 | if echo "$hostkeys" | grep -x "$file" >/dev/null && \ | 47 | if echo "$hostkeys" | grep -x "$file" >/dev/null && \ |
49 | [ ! -f "$file" ] ; then | 48 | [ ! -f "$file" ] ; then |
50 | echo -n $msg | 49 | printf %s "$msg" |
51 | ssh-keygen -q -f "$file" -N '' "$@" | 50 | ssh-keygen -q -f "$file" -N '' "$@" |
52 | echo | 51 | echo |
53 | if which restorecon >/dev/null 2>&1; then | 52 | if which restorecon >/dev/null 2>&1; then |
@@ -92,7 +91,7 @@ create_sshdconfig() { | |||
92 | password_authentication="$RET" | 91 | password_authentication="$RET" |
93 | 92 | ||
94 | trap cleanup EXIT | 93 | trap cleanup EXIT |
95 | new_config="$(tempfile)" | 94 | new_config="$(mktemp)" |
96 | cp -a /usr/share/openssh/sshd_config "$new_config" | 95 | cp -a /usr/share/openssh/sshd_config "$new_config" |
97 | if [ "$permit_root_login" != true ]; then | 96 | if [ "$permit_root_login" != true ]; then |
98 | sed -i 's/^#*PermitRootLogin .*/PermitRootLogin yes/' \ | 97 | sed -i 's/^#*PermitRootLogin .*/PermitRootLogin yes/' \ |
diff --git a/debian/openssh-server.ssh.init b/debian/openssh-server.ssh.init index 620af70e0..4f0fb10de 100755 --- a/debian/openssh-server.ssh.init +++ b/debian/openssh-server.ssh.init | |||
@@ -68,6 +68,7 @@ check_privsep_dir() { | |||
68 | 68 | ||
69 | check_config() { | 69 | check_config() { |
70 | if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then | 70 | if [ ! -e /etc/ssh/sshd_not_to_be_run ]; then |
71 | # shellcheck disable=SC2086 | ||
71 | /usr/sbin/sshd $SSHD_OPTS -t || exit 1 | 72 | /usr/sbin/sshd $SSHD_OPTS -t || exit 1 |
72 | fi | 73 | fi |
73 | } | 74 | } |
@@ -80,6 +81,7 @@ case "$1" in | |||
80 | check_for_no_start | 81 | check_for_no_start |
81 | check_dev_null | 82 | check_dev_null |
82 | log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" || true | 83 | log_daemon_msg "Starting OpenBSD Secure Shell server" "sshd" || true |
84 | # shellcheck disable=SC2086 | ||
83 | if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | 85 | if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then |
84 | log_end_msg 0 || true | 86 | log_end_msg 0 || true |
85 | else | 87 | else |
@@ -113,6 +115,7 @@ case "$1" in | |||
113 | start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /run/sshd.pid --exec /usr/sbin/sshd | 115 | start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile /run/sshd.pid --exec /usr/sbin/sshd |
114 | check_for_no_start log_end_msg | 116 | check_for_no_start log_end_msg |
115 | check_dev_null log_end_msg | 117 | check_dev_null log_end_msg |
118 | # shellcheck disable=SC2086 | ||
116 | if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | 119 | if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then |
117 | log_end_msg 0 || true | 120 | log_end_msg 0 || true |
118 | else | 121 | else |
@@ -131,6 +134,7 @@ case "$1" in | |||
131 | # old daemon stopped | 134 | # old daemon stopped |
132 | check_for_no_start log_end_msg | 135 | check_for_no_start log_end_msg |
133 | check_dev_null log_end_msg | 136 | check_dev_null log_end_msg |
137 | # shellcheck disable=SC2086 | ||
134 | if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | 138 | if start-stop-daemon --start --quiet --oknodo --chuid 0:0 --pidfile /run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then |
135 | log_end_msg 0 || true | 139 | log_end_msg 0 || true |
136 | else | 140 | else |
diff --git a/debian/openssh-server.ssh.runscript/finish b/debian/openssh-server.ssh.runscript/finish index 7e29ef1db..8c67acf43 100644 --- a/debian/openssh-server.ssh.runscript/finish +++ b/debian/openssh-server.ssh.runscript/finish | |||
@@ -3,14 +3,14 @@ set -e | |||
3 | 3 | ||
4 | NAME=ssh | 4 | NAME=ssh |
5 | 5 | ||
6 | [ $1 = -1 ] && echo "runsv: ERROR in $NAME: unexpected error or wrong sh syntax" | 6 | [ "$1" = -1 ] && echo "runsv: ERROR in $NAME: unexpected error or wrong sh syntax" |
7 | # no need to stop the service here, runsv will stop trying after the first attempt | 7 | # no need to stop the service here, runsv will stop trying after the first attempt |
8 | 8 | ||
9 | [ $1 = 161 ] && echo "runsv: ERROR $1 in $NAME: disabled by local settings" \ | 9 | [ "$1" = 161 ] && echo "runsv: ERROR $1 in $NAME: disabled by local settings" \ |
10 | && sv d $(dirname $0) && exit 0 | 10 | && sv d "$(dirname "$0")" && exit 0 |
11 | 11 | ||
12 | [ $1 = 162 ] && echo "runsv: ERROR $1 in $NAME: configtest or early setup failed" \ | 12 | [ "$1" = 162 ] && echo "runsv: ERROR $1 in $NAME: configtest or early setup failed" \ |
13 | && sv d $(dirname $0) && exit 0 | 13 | && sv d "$(dirname "$0")" && exit 0 |
14 | 14 | ||
15 | echo "$NAME Stopped" | 15 | echo "$NAME Stopped" |
16 | 16 | ||