HCoop
/
hcoop
/
zz_old
/
config
/
exim4-hopper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df81995
)
exim4/get-token: Fix some edge cases, log weirdness better.
author
root
<root@deleuze.hcoop.net>
Sun, 3 Feb 2008 02:36:07 +0000
(21:36 -0500)
committer
root
<root@deleuze.hcoop.net>
Tue, 17 Jun 2008 04:21:52 +0000
(
00:21
-0400)
get-token
patch
|
blob
|
blame
|
history
diff --git
a/get-token
b/get-token
index
0c7abe5
..
b7b5e02
100755
(executable)
--- a/
get-token
+++ b/
get-token
@@
-13,21
+13,23
@@
REALUSER=$(whoami)
USER=$1
REALUSER=$(whoami)
USER=$1
-LOGFILE=/tmp/exim4/
get-token-log.$USER
+LOGFILE=/tmp/exim4/
weird-error.log
if test "$REALUSER" = "root"; then
if test "$2" = "norecurse"; then
echo "Error: running as root even after trying to change to $USER" \
if test "$REALUSER" = "root"; then
if test "$2" = "norecurse"; then
echo "Error: running as root even after trying to change to $USER" \
- > $LOGFILE
+ >
>
$LOGFILE
exit 1
fi
# Decide whether the user exists: getent returns 0 error code if so
getent passwd "$USER" >/dev/null
if test $? -ne 0; then
exit 1
fi
# Decide whether the user exists: getent returns 0 error code if so
getent passwd "$USER" >/dev/null
if test $? -ne 0; then
- echo "$USER is not a local user, so ignoring them"
+ echo "$USER is not a local user, so ignoring them" \
+ >> $LOGFILE
exit 1
else
exit 1
else
+ USER=$(getent passwd "$1" | cut -d':' -f 1)
exec su $USER -c "$0 $1 norecurse"
fi
fi
exec su $USER -c "$0 $1 norecurse"
fi
fi
@@
-37,7
+39,8
@@
USER=$(getent passwd "$USER" | cut -d':' -f 1)
LOGFILE=/tmp/exim4/get-token-log.$USER
if test -z "$USER"; then
LOGFILE=/tmp/exim4/get-token-log.$USER
if test -z "$USER"; then
- echo "$USER is not a local user, so ignoring them"
+ echo "$USER is not a local user, so ignoring them" \
+ >> /tmp/exim4/weird-error.log
exit 1
fi
exit 1
fi