Created
November 30, 2017 14:19
-
-
Save haircut/a200be663d074d7d732c89829c6983ae to your computer and use it in GitHub Desktop.
Check the project build version of opendirectoryd to confirm Security Update 2017-001 is installed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
factoid = 'opendirectoryd_version' | |
def fact(): | |
''' | |
Returns the "project version" number used to build opendirectoryd | |
per https://support.apple.com/en-gb/HT208315 to check that | |
"Security Update 2017-001" is installed | |
''' | |
result = 'None' | |
try: | |
proc = subprocess.Popen( | |
['/usr/bin/what', '/usr/libexec/opendirectoryd'], | |
stdout=subprocess.PIPE, | |
stderr=subprocess.PIPE | |
) | |
stdout, _ = proc.communicate() | |
except (IOError, OSError): | |
stdout = None | |
if stdout: | |
result = stdout.splitlines()[-1].split(':')[-1] | |
return {factoid: result} | |
if __name__ == '__main__': | |
print '<result>%s</result>' % fact()[factoid] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
opendirectoryd-483.1.5 on macOS High Sierra 10.13
opendirectoryd-483.20.7 on macOS High Sierra 10.13.1