winnfsd/vagrant-winnfsd

Can't modify file permissions or preserve modification dates in guest box

rlue opened this issue · 2 comments

rlue commented

Can't imagine I'm the first one to run across this problem, but I don't see it in the issues anywhere, open or closed.

The title says it all. To illustrate:

[vagrant@host vagrant]$ mkdir foo
[vagrant@host vagrant]$ touch foo/bar
[vagrant@host vagrant]$ ls -al foo/
total 0
drwxrwxrwx. 1 root root  0 Sep  1 06:07 .
drwxrwxrwx. 1 root root  0 Sep  1 06:06 ..
-rwxrwxrwx. 1 root root  0 Sep  1 06:07 bar
[vagrant@host vagrant]$ chmod 600 foo/bar
[vagrant@host vagrant]$ ls -al foo/
total 0
drwxrwxrwx. 1 root root  0 Sep  1 06:07 .
drwxrwxrwx. 1 root root  0 Sep  1 06:06 ..
-rwxrwxrwx. 1 root root  0 Sep  1 06:07 bar

In addition, files copied with rsync -t or cp -p don't preserve timestamps, but rather set modification dates equal to the file creation date. This is causing problems for rsync, which depends on timestamps to know when to copy files over and when to leave them alone.

I've also tried with vagrant-bindfs. It fixes the uid and sets file permissions for regular files to 644 instead, but still leaves these properties immutable.

rlue commented

My knowledge of filesystems is very limited, so forgive my ignorance on the subject.

After a little googling, my understanding is that NTFS simply doesn't store UNIX permissions bits in the first place, which means that in the absence of some kind of external user map file (like the one described here), it would be impossible to simultaneously sync folders to an NTFS drive and implement UNIX-style permissions beyond setting a default for all files and directories within the shared folder.

Is this correct? If so, I am prepared to close this issue.

Hey @rlue,

you're correct, apart from some kind of mapping i do not see how one can implement unix permissions.

It would be possible to change the default permissions via a command line flag (not implemented, similar to the uid flag that is already present), but that would't allow you to change the permissions later on.