Post not yet marked as solved
Post marked as unsolved with 7 replies, 598 views
I'm working on a cmdln tool which will (silently) mount an smb share (read-only, nobrowse), download file(s), unmount and cleanup. This fails when run as root. I would like to run it as root; the code needs to be able to run when no user is logged in.
The log shows:
Downloader: (loginsupport) [com.apple.NetAuthAgent:IPC] GetNetAuthAuthAgentPort: Calling bootstraplookup3() for com.apple.netauth.user.auth; uid = 0, euid = 0
Downloader: (loginsupport) [com.apple.NetAuthAgent:IPC] GetNetAuthAuthAgentPort: gNetAuthAuthAgentPort = 6403
Downloader: [com.acme.downloader:default] Failed to mount Optional(smb://pch-cores.local/cayman) because: 13
The same process, when run as some user (admin or not) works.
The log shows:
Downloader: (loginsupport) [com.apple.NetAuthAgent:IPC] GetNetAuthAuthAgentPort: Calling bootstraplookup3() for com.apple.netauth.user.auth; uid = 501, euid = 501
Downloader: (loginsupport) [com.apple.NetAuthAgent:IPC] GetNetAuthAuthAgentPort: gNetAuthAuthAgentPort = 6147
Downloader: [com.acme.downloader:default] Beginning file download for 10 files
I also have a version of the tool which shells out to /sbin/mount. This works in either context. I would prefer to stick with the higher level API - just because.
Is this a Keychain issue, or something else? Is there a fix/workaround for this?