mirror of
https://github.com/postgres/postgres.git
synced 2025-07-24 14:22:24 +03:00
In ipcclean, check LOGNAME only if USER is not set.
Fixes problem with 'su' on some platforms.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user