NetFSMountURLSync not supressing authentication dialog when specifying kNAUIOptionNoUI

I've run into a strange scenario with macOS 10.12 keychain authentication and NetFSMountURLSync.


Typically the below code only prompts for a keychain password the first time, then when run a second time it correctly uses the keychain to authenticate without displaying the login prompt. In the macOS 10.12 environment it will always display the authentication dailog despite using the kNAUIOptionKey option.

...

CFDictionarySetValue(mountOpts, kNAUIOptionKey, kNAUIOptionNoUI); // not working, authentication dialog keeps showing

NetFSMountURLSync(share2, NULL, NULL, NULL, NULL, mountOpts, &mountpoints);


Documentation states:

// * The following dictionary keys for open_options are supported:

// * kNAUIOptionKey = UIOption Suppress authentication dialog UI.


Is this possbily a bug, or is there another workaround someone can suggest?



Thanks!

Replies

I’d argue that if you pass the ‘no UI’ flag to a routine and it displays UI anyway, that’s a bug. Please file it as such, then post your bug number, just for the record.

Keep in mind that the fix for a bug like this is that the routine will fail rather than present a UI. That seems like it’s not what you’re looking for.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

macOS Sierra 10.12.2 seems to correct the issue I was having.


I also saw this, but did not need to enable > https://support.apple.com/en-us/HT207112