summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-09-02 10:15:30 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-09-02 10:15:30 -0400
commit35d94a45ef770f42e69bc2944e35022808b7809a (patch)
treebe155e725c1aa3aa6b8fed426bf0aa0d99a24bfd /src
parent786cd57174ab98f4e88512ce55b3ea4bb30e7099 (diff)
the way i modified the log function breaks when IFS is set to something funny; fix it. Move happy messages from error to info.
Diffstat (limited to 'src')
-rw-r--r--src/common20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/common b/src/common
index 16235a2..3b3b7a5 100644
--- a/src/common
+++ b/src/common
@@ -35,11 +35,15 @@ log() {
local priority
local level
local output
- # don't include SILENT in alllevels: it's handled separately
- # list in decreasing verbosity (all caps)
- local alllevels="DEBUG INFO ERROR"
+ local alllevels
local found=
+ # don't include SILENT in alllevels: it's handled separately
+ # list in decreasing verbosity (all caps).
+ # separate with $IFS explicitly, since we do some fancy footwork
+ # elsewhere.
+ alllevels="DEBUG${IFS}INFO${IFS}ERROR"
+
# translate lowers to uppers in global log level
LOG_LEVEL=$(echo "$LOG_LEVEL" | tr "[:lower:]" "[:upper:]")
@@ -48,7 +52,7 @@ log() {
return
fi
- for level in $alllevels; do
+ for level in $alllevels ; do
if [ "$LOG_LEVEL" = "$level" ] ; then
found=true
fi
@@ -481,7 +485,7 @@ process_user_id() {
# if the gpg query return code is not 0, return 1
if [ "$?" -ne 0 ] ; then
- log error " no primary keys found."
+ log info " no primary keys found."
return 1
fi
@@ -498,7 +502,7 @@ process_user_id() {
lastKeyOK=
fingerprint=
- log error " primary key found: $keyid"
+ log info " primary key found: $keyid"
# if overall key is not valid, skip
if [ "$validity" != 'u' -a "$validity" != 'f' ] ; then
@@ -547,7 +551,7 @@ process_user_id() {
# output a line for the primary key
# 0 = ok, 1 = bad
if [ "$keyOK" -a "$uidOK" -a "$lastKeyOK" ] ; then
- log error " * acceptable primary key."
+ log info " * acceptable primary key."
if [ -z "$sshKey" ] ; then
log error " ! primary key could not be translated (not RSA or DSA?)."
else
@@ -603,7 +607,7 @@ process_user_id() {
# output a line for the sub key
# 0 = ok, 1 = bad
if [ "$keyOK" -a "$uidOK" -a "$lastKeyOK" ] ; then
- log error " * acceptable sub key."
+ log info " * acceptable sub key."
if [ -z "$sshKey" ] ; then
log error " ! sub key could not be translated (not RSA or DSA?)."
else