Commit a6add72a authored by Bruce Momjian's avatar Bruce Momjian

In ipcclean, check LOGNAME only if USER is not set.

Fixes problem with 'su' on some platforms.
parent 587bc818
#!/bin/sh #!/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` CMDNAME=`basename $0`
...@@ -19,7 +19,8 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then ...@@ -19,7 +19,8 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then
exit 0 exit 0
fi fi
if [ "$USER" = 'root' -o "$LOGNAME" = 'root' ] # only check $LOGNAME if $USER is not set
if [ "$USER" = 'root' -o \( ! "$USER" -a "$LOGNAME" = 'root' \) ]
then then
( (
echo "$CMDNAME: cannot be run as root" 1>&2 echo "$CMDNAME: cannot be run as root" 1>&2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment