Skip to content

Commit

Permalink
Remove FdoSecret 'dummy-entry' workaround for KPXC
Browse files Browse the repository at this point in the history
Thanks to the merge of PR#6943 [0] whenever a process runs a search
while the keyring is locked the user will be prompted to unlock it.

[0] keepassxreboot/keepassxc#6943
  • Loading branch information
StayPirate committed Jun 13, 2022
1 parent 1dc09c0 commit dadbf90
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
#!/usr/bin/env -S bash -i

unlock_wallet() {
echo "check the explanation attribute ;)" | secret-tool store --label="dummy-entry" explanation \
"Because of quirks in the gnome libsecret API, a dummy entry needs to be stored in order to \
guarantee that this keyring was properly unlocked. More details at http://crbug.com/660005 and \
https://github.com/keepassxreboot/keepassxc/issues/4443"
}

get_user() {
unlock_wallet
secret-tool search client sieveshell workstation wintermute 2>&1 | \
grep -E "^attribute\.UserName" | \
cut -d " " -f3
}

get_pass() {
unlock_wallet
secret-tool search client sieveshell workstation wintermute 2>&1 | \
grep -E "^secret" | \
cut -d " " -f3
Expand All @@ -29,9 +20,6 @@ local managesieve_port=4190
# If sieveshell is not installed skip this check w/o blocking the commit
type sieveshell >/dev/null 2>&1 || return 0

# Ensure the local wallet is unlocked before query for username and password
unlock_wallet

# This hook has to be run from there or it won't find all the sieve files
find $(git rev-parse --show-toplevel) -type f -name "*.sieve" -printf "put %p %f\n" | sort -nr | \
sieveshell --user $(get_user) \
Expand All @@ -41,4 +29,4 @@ sieveshell --user $(get_user) \
$managesieve_address
}

main
main

0 comments on commit dadbf90

Please sign in to comment.