Skip to content

Commit

Permalink
for #811: allow some perm warnings in non-verbose mode (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrabinowitz committed Apr 16, 2022
1 parent 80ccb42 commit 084a525
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Adds `SECRETS_GPG_ARMOR` env variable to use `gpg --armor`
when encrypting files, so secret files are stored
in text format rather than binary (#631)
- Suppress fewer permission warnings from gnupg in verbose mode (#811)
- Allow gnupg permission warnings in `tell`, `hide`, `reveal`, and `removeperson` (#811)
- `git secret init` now sets `.gitsecret/keys` permission to 0700 (#811)

### Bugfixes
Expand Down
3 changes: 2 additions & 1 deletion src/_utils/_git_secret_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ function _decrypt {
fi

if [[ -z "$_SECRETS_VERBOSE" ]]; then
args+=( "--quiet" "--no-permission-warning" )
# we no longer use --no-permission-warning here, for #811
args+=( "--quiet" )
fi

set +e # disable 'set -e' so we can capture exit_code
Expand Down
4 changes: 1 addition & 3 deletions src/commands/git_secret_hide.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ function hide {
args+=( '--armor' )
fi

if [[ -n "$_SECRETS_VERBOSE" ]]; then
args+=( '--no-permission-warning' )
fi
# we no longer use --no-permission-warning here in non-verbose mode, for #811

# we depend on $recipients being split on whitespace
# shellcheck disable=SC2206
Expand Down
4 changes: 1 addition & 3 deletions src/commands/git_secret_removeperson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ function removeperson {
_assert_keyring_contains_emails_at_least_once "$secrets_dir_keys" "git-secret keyring" "${emails[@]}"

local args=( --homedir "$secrets_dir_keys" --batch --yes )
if [[ -n "$_SECRETS_VERBOSE" ]]; then
args+=( '--no-permission-warning' )
fi
# we no longer use --no-permission-warning here in non-verbose mode, for #811

for email in "${emails[@]}"; do
# see https://github.com/bats-core/bats-core#file-descriptor-3-read-this-if-bats-hangs for info about 3>&-
Expand Down
5 changes: 3 additions & 2 deletions src/commands/git_secret_tell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ function tell {
$SECRETS_GPG_COMMAND --export -a "$email" > "$keyfile" 3>&-
exit_code=$?
else
# It means that homedir is set as an extra argument via `-d`:
$SECRETS_GPG_COMMAND --no-permission-warning --homedir="$homedir" \
# This means that homedir is set as an extra argument via `-d`:
# we no longer use --no-permission-warning here, for #811
$SECRETS_GPG_COMMAND --homedir="$homedir" \
--export -a "$email" > "$keyfile" 3>&-
exit_code=$?
fi
Expand Down

0 comments on commit 084a525

Please sign in to comment.