I've also seen using the -a0 option instead of the -i and using cat filename piped to the mount_webdav command.
I've created the file with uint32-username-uint32-password where the uint32s contain the lengths (big endian) of username and password respectively. No dashes, obviously.
So 'cat file | mount_webdav -a0 http://idisk.mac.com/username /Volumes/username' doesn't work. There's a nasty little note in the man page that -a is deprecated. That's fine, I suppose.
I want to be able to mount the iDisk filesystem either from the command line or in C code. I really don't care which as I'm currently using C code to wrap a system call anyway.
What am I doing wrong, or more importantly what do I need to do?
Imported from the Apple Support Forums via the Wayback Machine 🔗
Just leave off the "-i" part and let it use the keychain. That is far more secure anyway.
If you really have your heart set of storing passwords in the plain text file, you definitely don't want any uints, just returns or newlines, whichever works. You might try using popen instead of running it through the shell.
0
D7·
Imported from the Apple Support Forums via the Wayback Machine 🔗
My apologies. I apparently missed the email notice with you response.
Anyway, when I leave off the "-i" part as you suggested, the mount doesn't occur. Does it use the keychain on your system and mount successfully?
In the meantime I decided to delve deep into this problem by temporarily replacing the mount_webdav command with my own version to snoop what the system is passing. Turns out it is passing additional null characters in the username password file--not sure if that's significant or not. The old manual page for mount_webdav ( http://www.opensource.apple.com/source/webdavfs/webdavfs-115/mount.tproj/mount_w ebdav.8) was difficult to find but provides some good hints at exactly what is needed code-wise, except for the remaining call to system (). It never occurred to me that the system would pass open file descriptors between a parent and child process.
In any case I did manage to mount my iDisk from my program and it is relatively secure given the techniques specified in the old manual page but I do like the idea of using the keychain. I can think of some ways to grab the contents of the file even using the specified techniques. Believe me I have no desire of using text files for passwords. I have a package already written that retrieves the password from the keychain and I use it for the mounting. Again, though, if mount_webdav will retrieve it automatically I'd prefer doing that.