summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-09-05 11:28:25 +0200
committerStef Walter <stef@thewalter.net>2013-09-05 11:28:25 +0200
commit8d834060b5af54dcc9581840dfb6452a17a7a7d3 (patch)
treee746de823a0891094a8c9fdee94b488a3c4315a4
parenta5713df2c05debd269615226b41e1e0b83de2ba3 (diff)
downloadp11-kit-8d834060b5af54dcc9581840dfb6452a17a7a7d3.tar.gz
extract-compat: Skip extraction if running as non-root
-rwxr-xr-xtrust/trust-extract-compat.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/trust/trust-extract-compat.in b/trust/trust-extract-compat.in
index 2d8809c..9b46055 100755
--- a/trust/trust-extract-compat.in
+++ b/trust/trust-extract-compat.in
@@ -11,6 +11,12 @@ if [ $# -ne 0 ]; then
exit 2
fi
+uid=$(id -u)
+if [ "$uid" != 0 ]; then
+ echo "trust: running as non-root user: skip extracting compat bundles" >&2
+ exit 0
+fi
+
echo "trust: the placeholder extract-compat command has not been customized by your distribution." >&2
# You can use commands like this to extract data from trust modules