Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
bf8337b8
Commit
bf8337b8
authored
Mar 03, 2006
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ipcclean to use try 'id' first for root check.
parent
28edbdb7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/bin/ipcclean/ipcclean.sh
src/bin/ipcclean/ipcclean.sh
+14
-3
No files found.
src/bin/ipcclean/ipcclean.sh
View file @
bf8337b8
#!/bin/sh
#!/bin/sh
#
#
# $PostgreSQL: pgsql/src/bin/ipcclean/ipcclean.sh,v 1.1
7 2006/03/03 16:49:21
momjian Exp $
# $PostgreSQL: pgsql/src/bin/ipcclean/ipcclean.sh,v 1.1
8 2006/03/03 21:52:37
momjian Exp $
#
#
CMDNAME
=
`
basename
$0
`
CMDNAME
=
`
basename
$0
`
...
@@ -19,8 +19,19 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then
...
@@ -19,8 +19,19 @@ if [ "$1" = '-?' -o "$1" = "--help" ]; then
exit
0
exit
0
fi
fi
# only check $LOGNAME if $USER is not set
# test for running as root
if
[
"
$USER
"
=
'root'
-o
\(
!
"
$USER
"
-a
"
$LOGNAME
"
=
'root'
\)
]
ISROOT
=
"N"
if
id
-u
>
/dev/null 2>&1
then if
[
`
id
-u
`
-eq
0
]
then
ISROOT
=
"Y"
fi
elif
# only check $LOGNAME if $USER is not set
[
"
$USER
"
=
'root'
-o
\(
!
"
$USER
"
-a
"
$LOGNAME
"
=
'root'
\)
]
then
ISROOT
=
"Y"
fi
if
[
"
$ISROOT
"
=
"Y"
]
then
then
(
(
echo
"
$CMDNAME
: cannot be run as root"
1>&2
echo
"
$CMDNAME
: cannot be run as root"
1>&2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment