diff --git a/debian/patches/Indicate-that-sudo-is-required.patch b/debian/patches/Indicate-that-sudo-is-required.patch new file mode 100644 index 0000000..73d6dbb --- /dev/null +++ b/debian/patches/Indicate-that-sudo-is-required.patch @@ -0,0 +1,64 @@ +From: Sophie Brun +Date: Fri, 19 Nov 2021 11:36:54 +0100 +Subject: Indicate that sudo is required + + +Last-Update: 2021-11-23 +The Db is located in /var/lib/poshc2. We need to be root to write / use +the db. +--- + resources/scripts/posh | 6 ++++++ + resources/scripts/posh-log | 6 ++++++ + resources/scripts/posh-server | 6 ++++++ + 3 files changed, 18 insertions(+) + +diff --git a/resources/scripts/posh b/resources/scripts/posh +index 7e55f13..a1d7b25 100755 +--- a/resources/scripts/posh ++++ b/resources/scripts/posh +@@ -8,6 +8,12 @@ function ctrl_c() { + exit + } + ++# Check if running as root ++if [[ $EUID -ne 0 ]]; then ++ echo -e "Error: $0 must be run as root" 1>&2 ++ exit 1 ++fi ++ + source /usr/bin/_posh-common + get_posh_dir + +diff --git a/resources/scripts/posh-log b/resources/scripts/posh-log +index 508092e..3c3fdd9 100755 +--- a/resources/scripts/posh-log ++++ b/resources/scripts/posh-log +@@ -1,5 +1,11 @@ + #!/bin/bash + ++# Check if running as root ++if [[ $EUID -ne 0 ]]; then ++ echo -e "Error: $0 must be run as root" 1>&2 ++ exit 1 ++fi ++ + source /usr/bin/_posh-common + get_posh_project_dir + +diff --git a/resources/scripts/posh-server b/resources/scripts/posh-server +index ff220d6..a7c1858 100755 +--- a/resources/scripts/posh-server ++++ b/resources/scripts/posh-server +@@ -8,6 +8,12 @@ function ctrl_c() { + exit + } + ++# Check if running as root ++if [[ $EUID -ne 0 ]]; then ++ echo -e "Error: $0 must be run as root" 1>&2 ++ exit 1 ++fi ++ + source /usr/bin/_posh-common + get_posh_dir + get_posh_project_dir diff --git a/debian/patches/series b/debian/patches/series index 4ef893b..2626808 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ remove-git-usage.patch rename-payload-templates.patch use-cryptodome.patch +Indicate-that-sudo-is-required.patch