]> granicus.if.org Git - p11-kit/commitdiff
extract-compat: Skip extraction if running as non-root
authorStef Walter <stef@thewalter.net>
Thu, 5 Sep 2013 09:28:25 +0000 (11:28 +0200)
committerStef Walter <stef@thewalter.net>
Thu, 5 Sep 2013 09:28:25 +0000 (11:28 +0200)
trust/trust-extract-compat.in

index 2d8809c765647624a7220a727575bd357bac5588..9b460552454964a8608e0e16d22351b8d8875c93 100755 (executable)
@@ -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