Promiscuous regex for OSX version check in InstallAgent.sh and InstallServer.sh

21 views
Skip to first unread message

K.Lange

unread,
May 15, 2015, 1:06:42 PM5/15/15
to osse...@googlegroups.com

The following code in src/Install[Agent|Server].sh needs to be changed, specifically the reggae used for determining Product version. 

The expression is far too promiscuous, not evaluating as expected, and failing on OS X Yosemite (10.10.x).




        # Creating for <= 10.4

        /usr/bin/sw_vers 2>/dev/null| grep "ProductVersion" | grep -E "10.2.|10.3|10.4" > /dev/null 2>&1


Instead should be


        # Creating for <= 10.4

        /usr/bin/sw_vers 2>/dev/null| grep "ProductVersion" | awk '{ print $2 }' | grep -E "^10\.[1234]\." > /dev/null 2>&1

Mark Campbell

unread,
Nov 4, 2020, 9:21:13 AM11/4/20
to ossec-dev
Reply all
Reply to author
Forward
0 new messages