summaryrefslogtreecommitdiffstats
path: root/debian/check-ucf-md5sums
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 19:49:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 19:49:47 +0000
commit9c5dd847393c7c0f37ef557d7a0d402deedd8d2a (patch)
treedcb9b4740181f58a5d235e8ca52f9855494f486e /debian/check-ucf-md5sums
parentAdding upstream version 1:9.6p1. (diff)
downloadopenssh-9c5dd847393c7c0f37ef557d7a0d402deedd8d2a.tar.xz
openssh-9c5dd847393c7c0f37ef557d7a0d402deedd8d2a.zip
Adding debian version 1:9.6p1-4.debian/1%9.6p1-4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/check-ucf-md5sums')
-rwxr-xr-xdebian/check-ucf-md5sums31
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/check-ucf-md5sums b/debian/check-ucf-md5sums
new file mode 100755
index 0000000..c9639f2
--- /dev/null
+++ b/debian/check-ucf-md5sums
@@ -0,0 +1,31 @@
+#! /bin/sh
+# Check whether debian/openssh-server.ucf-md5sum is up to date.
+set -e
+
+contains_md5sum () {
+ # shellcheck disable=SC3043
+ local md5sum
+ md5sum="$(md5sum | sed 's/ -$//')"
+ if grep -qx "$md5sum" debian/openssh-server.ucf-md5sum; then
+ return 0
+ else
+ echo "Missing from debian/openssh-server.ucf-md5sum: $md5sum" >&2
+ return 1
+ fi
+}
+
+ret=0
+
+<sshd_config contains_md5sum || ret=1
+<sshd_config \
+ sed 's/^#*PermitRootLogin .*/PermitRootLogin yes/' | \
+ contains_md5sum || ret=1
+<sshd_config \
+ sed 's/^#PasswordAuthentication .*/PasswordAuthentication no/' | \
+ contains_md5sum || ret=1
+<sshd_config \
+ sed 's/^#*PermitRootLogin .*/PermitRootLogin yes/' | \
+ sed 's/^#PasswordAuthentication .*/PasswordAuthentication no/' | \
+ contains_md5sum || ret=1
+
+exit "$ret"