summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-01-16 17:32:33 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-01-16 17:32:33 +0100
commit248ec5ab008a1dfa5bf441b0d40b6c1859954746 (patch)
treec494a1222789586710297ee989e0b0342effcbb8 /cmdline
parent39cc82288036a005226564fadd05ef19ef0037bb (diff)
* cmdline/apt-key:
- don't set trustdb-name as non-root so 'list' and 'finger' can be used without being root (Closes: #393005, #592107)
Diffstat (limited to 'cmdline')
-rwxr-xr-xcmdline/apt-key7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmdline/apt-key b/cmdline/apt-key
index b39ab12e4..c1e01a776 100755
--- a/cmdline/apt-key
+++ b/cmdline/apt-key
@@ -5,7 +5,12 @@ unset GREP_OPTIONS
# We don't use a secret keyring, of course, but gpg panics and
# implodes if there isn't one available
-GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg"
+GPG_CMD='gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg'
+
+if ! id -u > /dev/null; then
+ GPG_CMD="$GPG_CMD --trustdb-name /etc/apt/trustdb.gpg"
+fi
+
GPG="$GPG_CMD"
MASTER_KEYRING=""