mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-12 07:46:28 +00:00
list_gnupg_ciphers: Pipe everything into /dev/null
Firstly the printed binary path is in the wrong place. Reading the text, one assumes Ciphers coming next. Secondly it doesn't make sense to check there for a missing gnupg installation. Before calling list_gnupg_ciphers(), there is a direct call for gpg --version. If that fails the whole text is scrambled and no error reported Dropping the output from which allows to remove the space from printing the ciphers. The text is correctly aligned now
This commit is contained in:
parent
61fdab85be
commit
e15c58dfd7
4
tomb
4
tomb
@ -1360,7 +1360,7 @@ gen_key() {
|
|||||||
# prints an array of ciphers available in gnupg (to encrypt keys)
|
# prints an array of ciphers available in gnupg (to encrypt keys)
|
||||||
list_gnupg_ciphers() {
|
list_gnupg_ciphers() {
|
||||||
# prints an error if GnuPG is not found
|
# prints an error if GnuPG is not found
|
||||||
which gpg 2>/dev/null || _failure "gpg (GnuPG) is not found, Tomb cannot function without it."
|
which gpg &>/dev/null || _failure "gpg (GnuPG) is not found, Tomb cannot function without it."
|
||||||
|
|
||||||
ciphers=(`gpg --version | awk '
|
ciphers=(`gpg --version | awk '
|
||||||
BEGIN { ciphers=0 }
|
BEGIN { ciphers=0 }
|
||||||
@ -1368,7 +1368,7 @@ BEGIN { ciphers=0 }
|
|||||||
/^Hash:/ { ciphers=0 }
|
/^Hash:/ { ciphers=0 }
|
||||||
{ if(ciphers==0) { next } else { gsub(/,/,""); print; } }
|
{ if(ciphers==0) { next } else { gsub(/,/,""); print; } }
|
||||||
'`)
|
'`)
|
||||||
print " ${ciphers}"
|
print "${ciphers}"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user