Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Check the project build version of opendirectoryd to confirm Security Update 2017-001 is installed
import subprocess
factoid = 'opendirectoryd_version'
def fact():
Returns the "project version" number used to build opendirectoryd
per to check that
"Security Update 2017-001" is installed
result = 'None'
proc = subprocess.Popen(
['/usr/bin/what', '/usr/libexec/opendirectoryd'],
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]

This comment has been minimized.

Copy link
Owner Author

@haircut haircut commented Nov 30, 2017

opendirectoryd-483.1.5 on macOS High Sierra 10.13
opendirectoryd-483.20.7 on macOS High Sierra 10.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment