sitecopy insists on a ~/.netrc with 600 permissions, but my ~/ is on an NTFS partition

I am desperately trying to get sitecopy to run from my computer, but the stupid thing seems to insist on reading my ~/.netrc file, even if the manpage seems to say otherwise ("If it exists, the ~/.netrc will be searched for a password if one is not specified."; see, e.g. http://linux.die.net/man/1/sitecopy)

~/.netrc does not exist in my home directory, but nevertheless, sitecopy seems to expect it, saying that it does not have the right permissions (which should be 600). And that expectation seems to be hardcoded, at least I have not found an option or switch or whatever.

I would of course be happy to simply put an empty .netrc file there and give it the right permissions, but this is where the real trouble starts: My home directory resides on a separate partition, which is formatted as NTFS, and mounted using ntfs-3g.

I have not found out yet if (and if indeed, then how) it is possible to give files on a partition mounted with ntfs-3g individual permissions. As far as I can tell, all I can control is the umask (in /etc/fstab), which then applies to all the files on the partition. Now setting the umask to 177 and accepting that all files have 600 permissions does not work because that keeps me from entering any directory on the partition (you need the execute bit of the directory set for that).

I have also tried symlinking (which works on NTFS, just in case you didn't know ;-)) to a file on a different partition where permissions can be set individually, but that won't fool sitecopy, presumably because it checks the permissions of the symlink, not of the target.

Does anybody know any solution to this dilemma, regardless at which level? The only thing that is not an option is reformatting my home partition as e3fs or something similar. (I need to dual-boot to Windoze.) I would be ever so grateful!

Best regards,

Florian


Solution 1:

You can try to fool your application, by telling it your $HOME is somewhere else.

Create a directory like /linuxhome, where you can set permissions as you like, put your .netrc in it with appropriate permissions, and then you can run sitecopy via command line :

HOME=/linuxhome sitecopy

or adapt to the actual command if it is not sitecopy.

Solution 2:

Another possibility, on Linux, is to create the file elsewhere (for example, /var/tmp) with the correct permissions, then either symlink it (as stat() will return the symlink target's permissions)...

ln -s /var/tmp/netrc /home/user286915/.netrc

(Note: ntfs-3g creates Cygwin-format file-based symlinks, not Windows 7-format reparse points.)


...or, if this was not NTFS but a completely Unix-impaired filesystem like FAT32, bind-mount it on top of ~/.netrc every time you boot:

mount --bind /var/tmp/netrc /home/user286915/.netrc

In /etc/fstab it would be expressed as:

/var/tmp/netrc  /home/user286915/.netrc  none  bind  0  0