Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lynis
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2016-07-05 13:11:38 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-07-05 13:11:38 +0300
commitb5b8861368cef8934fbe18c23f5918544e4f8be5 (patch)
tree4bb2e5403846cad469d5043c8b72623c2f550e83 /lynis
parent72ca2b926dde98b726a28119e26de33db30a2ef0 (diff)
Improve ID detection for Solaris
Diffstat (limited to 'lynis')
-rwxr-xr-xlynis8
1 files changed, 5 insertions, 3 deletions
diff --git a/lynis b/lynis
index 4a58e454..b1035b34 100755
--- a/lynis
+++ b/lynis
@@ -107,9 +107,11 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta
MYID=""
# Check user to determine file permissions later on. If we encounter Solaris, use related id binary instead
if [ -x /usr/xpg4/bin/id ]; then
- MYID=`/usr/xpg4/bin/id -u 2> /dev/null`
- else
- MYID=`id -u 2> /dev/null`
+ MYID=$(/usr/xpg4/bin/id -u 2> /dev/null)
+ elif [ `uname` = "SunOS" ]; then
+ MYID=$(id | tr '=' ' ' | tr '(' ' ' | awk '{ print $2 }' 2> /dev/null)
+ else
+ MYID=$(id -u 2> /dev/null)
fi
if [ "${MYID}" = "" ]; then Display "Could not find user ID with id command. Want to help improving Lynis? Raise a ticket at ${PROGRAM_SOURCE}"; ExitFatal; fi
#