OSXvnc "Could not access password file"


I’ve been trying to help someone connect to his Mac via VNC. He stores the password like this:

mymac% storepasswd secretpass /Users/username/vncpassword

Once storepasswd reports success and we confirm that /Users/username/vncpasswd exists and is readable by him, he starts the VNC server like this:

mymac% osxvnc-server -rfbauth /Users/username/vncpassword

… and it appears to listen just fine. He directs a VNC viewer to this running VNC server and types secretpass at the password prompt. The server complains “Could not access password file” and he’s not allowed in. Is this a known bug? Any ideas?

Oh, apparently this message occurs in rfbAuthProcessClientMessage() when the result of vncDecryptPasswdFromFile() is NULL. Looking at vncDecryptPasswdFromFile(), it appears that there are two conditions under which that function will return NULL either it can’t open the password file for reading or it reads an EOF byte from the password file. I’m willing to bet that it’s the former. Hmm.