jipegit/OSXAuditor

IndexError: list index out of range for SystemVersionPlist array

Closed this issue · 5 comments

I'm having this error

PrimaVita:OSXAuditor-master asb$ sudo python osxauditor.py
DEBUG: Mac OS X Obj-C Foundation successfully imported
[INFO] Header
Traceback (most recent call last):
  File "osxauditor.py", line 1702, in <module>
    Main()
  File "osxauditor.py", line 1635, in Main
    AuditedSystemVersion = GetAuditedSystemVersion()
  File "osxauditor.py", line 1228, in GetAuditedSystemVersion
    "PatchVersion": int(SystemVersionPlist["ProductVersion"].split('.')[2])
IndexError: list index out of range
PrimaVita:OSXAuditor-master asb$ sudo /usr/bin/python osxcollector.py
/usr/bin/python: can't open file 'osxcollector.py': [Errno 2] No such file or directory

+1

I commented it out and it ran. (but I got another issue later)

I'm running Yosemite btw...

I'm also running Yosemite

This worked on Yosemite, update the major version to "1" as my version of OSX is 10.10.

    if SystemVersionPlist:
        if "ProductName" in SystemVersionPlist: SysVersion = SystemVersionPlist["ProductName"]
        if "ProductVersion" in SystemVersionPlist: SysVersion += " " + SystemVersionPlist["ProductVersion"]
        if "ProductBuildVersion" in SystemVersionPlist: SysVersion += " build " + SystemVersionPlist["ProductBuildVersion"]

        OSX_VERSION = {
            "ProductBuildVersion": SystemVersionPlist["ProductBuildVersion"],
            "ProductVersion": SystemVersionPlist["ProductVersion"],
            "MajorVersion": int(SystemVersionPlist["ProductVersion"].split('.')[1]),
            "MinorVersion": int(SystemVersionPlist["ProductVersion"].split('.')[1]),
            "PatchVersion": int(SystemVersionPlist["ProductVersion"].split('.')[0])
        }

Thank you for posting this fix!

Fixed, thanks.