From 2f815da5b29d72e25a32c3ea3c3fd207842cea7e Mon Sep 17 00:00:00 2001 From: Christopher Engelhard Date: Aug 19 2020 12:18:30 +0000 Subject: add patch to fix failed sudo detection when shell is not bash --- diff --git a/acme-sh/0001-fix-sudo-detection.patch b/acme-sh/0001-fix-sudo-detection.patch new file mode 100644 index 0000000..b0e7d7e --- /dev/null +++ b/acme-sh/0001-fix-sudo-detection.patch @@ -0,0 +1,23 @@ +diff -Naur a/acme.sh b/acme.sh +--- a/acme.sh 2020-05-04 02:41:37.000000000 +0200 ++++ b/acme.sh 2020-08-19 14:15:09.045969454 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env sh ++#!/usr/bin/sh + + VER=2.8.6 + +@@ -6415,10 +6415,10 @@ + #it's root using sudo, no matter it's using sudo or not, just fine + return 0 + fi +- if [ "$SUDO_COMMAND" = "/bin/su" ] || [ "$SUDO_COMMAND" = "/bin/bash" ]; then ++ if [ -n "$SUDO_COMMAND" ]; then + #it's a normal user doing "sudo su", or `sudo -i` or `sudo -s` +- #fine +- return 0 ++ _endswith "$SUDO_COMMAND" /bin/su || grep "^$SUDO_COMMAND\$" /etc/shells >/dev/null 2>&1 ++ return $? + fi + #otherwise + return 1