NetFSMountURLSync: cannot specify mount point

Originator:j.a.grigutis
Number:rdar://12788358 Date Originated:30-Nov-2012 03:47 PM
Status:Behaves correctly Resolved:01-Mar-2013 04:43 PM
Product:Mac OS X SDK Product Version:10.8.2/12C60
Classification:Serious Bug Reproducible:Always
 
Summary:
I'm trying to programmatically mount some WebDAV shares and I'd like to give the volumes specific names other than the default. For example, if I mount

	https://my.sharepoint.school.edu/personal/grigutis

I'd like it to appear in the Finder as

	/Volumes/My SharePoint Site

Instead of

	/Volumes/grigutis

I can do this with the mount_webdav command:

	$ mkdir /Volumes/My\ SharePoint\ Site
	$ mount_webdav -s -i https://my.sharepoint.school.edu/personal/grigutis /Volumes/My\ SharePoint\ Site

But I can't get this working with NetFSMountURLSync.


Steps to Reproduce:
	NSURL *url = [NSURL URLWithString:@"https://my.sharepoint.school.edu/personal/grigutis"];
	NSURL *mountpath = [NSURL fileURLWithPath:@"/Volumes/My SharePoint Site" isDirectory:YES];
	CFArrayRef mountpoints = NULL;
	int result = 0;
	result = NetFSMountURLSync((__bridge CFURLRef)url,
		(__bridge CFURLRef)mountpath,
		CFSTR("Kerberos"),
		CFSTR("NoPassword"),
		NULL,
		NULL,
		&mountpoints);


Expected Results:


Actual Results:
If the mount path directory exists, I get the Finder dialog:

	'There was a problem connecting to the server "my.sharepoint.school.edu". You do not have permission to access this server.'

and the function returns result 13.

If the mount path directory does not exist, I get the Finder dialog:

	'There was a problem connecting to the server "my.sharepoint.school.edu". The share does not exist on the server. Please check the share name, and then try again.'

and the function returns result 2.


Regression:
Calling the function with NULL for the mountpath argument works as expected (the default mount point is used).

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!