diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-03-03 16:49:30 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-03-03 16:49:30 +0000 |
commit | 7a88571f033251e5ad67190f9dcf9e3e12800889 (patch) | |
tree | 84522c9b31bef5336dbb312c87bf4f76e362cdc5 | |
parent | 2c620740bd5c22275c84bacd9ea6602f99d2dd9f (diff) | |
download | postgresql-7a88571f033251e5ad67190f9dcf9e3e12800889.tar.gz postgresql-7a88571f033251e5ad67190f9dcf9e3e12800889.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 91353b56138..0aff9071a7f 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.15 2003/11/29 19:52:04 pgsql Exp $ +# $PostgreSQL: pgsql/src/bin/ipcclean/ipcclean.sh,v 1.15.6.1 2006/03/03 16:49:30 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 |