diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-03-03 16:49:21 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-03-03 16:49:21 +0000 |
commit | a6add72ac377c2087fb37a44f960d94fbf18ca3d (patch) | |
tree | 1921fa6e1690c65c14875f964acfb7b0662b78e5 | |
parent | 587bc8188781656fb3de01ebfcbd5a23754edd5c (diff) | |
download | postgresql-a6add72ac377c2087fb37a44f960d94fbf18ca3d.tar.gz postgresql-a6add72ac377c2087fb37a44f960d94fbf18ca3d.zip |
In ipcclean, check LOGNAME only if USER is not set.
Fixes problem with 'su' on some platforms.
-rw-r--r-- | src/bin/ipcclean/ipcclean.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/ipcclean/ipcclean.sh b/src/bin/ipcclean/ipcclean.sh index 1192f82196e..9fc764e8a9a 100644 --- a/src/bin/ipcclean/ipcclean.sh +++ b/src/bin/ipcclean/ipcclean.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $PostgreSQL: pgsql/src/bin/ipcclean/ipcclean.sh,v 1.16 2006/01/05 01:56:29 momjian Exp $ +# $PostgreSQL: pgsql/src/bin/ipcclean/ipcclean.sh,v 1.17 2006/03/03 16:49:21 momjian Exp $ # CMDNAME=`basename $0` @@ -19,7 +19,8 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then exit 0 fi -if [ "$USER" = 'root' -o "$LOGNAME" = 'root' ] +# only check $LOGNAME if $USER is not set +if [ "$USER" = 'root' -o \( ! "$USER" -a "$LOGNAME" = 'root' \) ] then ( echo "$CMDNAME: cannot be run as root" 1>&2 |