summaryrefslogtreecommitdiff
path: root/cmdline/apt-key.in
diff options
context:
space:
mode:
Diffstat (limited to 'cmdline/apt-key.in')
-rw-r--r--cmdline/apt-key.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 74ca4d135..36824b6ec 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -287,6 +287,11 @@ while [ -n "$1" ]; do
FORCED_KEYRING="$1"
shift
;;
+ --secret-keyring)
+ shift
+ FORCED_SECRET_KEYRING="$1"
+ shift
+ ;;
--fakeroot)
requires_root() { true; }
shift
@@ -355,6 +360,12 @@ if [ "$command" != "help" ]; then
GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"
GPG="$GPG_CMD"
+ # for advanced operations, we might really need a secret keyring after all
+ if [ -n "$FORCED_SECRET_KEYRING" ] && [ -r "$FORCED_SECRET_KEYRING" ]; then
+ rm -f "$SECRETKEYRING"
+ cp -a "$FORCED_SECRET_KEYRING" "$SECRETKEYRING"
+ fi
+
# gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead.
if ! [ -e "$TRUSTEDFILE" ]; then
if [ -w "$(dirname "$TRUSTEDFILE")" ]; then