unison icon indicating copy to clipboard operation
unison copied to clipboard

Messages and/or logic are confused about permissions/FAT

Open gdt opened this issue 3 years ago • 4 comments

There are features that some but not filesystems have:

  • permissions
  • extended attributes
  • ACLs

Of these, not having permission is deficient, and I view the others as optional.

Sync should do something rational in all cases, and it should be automatic if possible.

Currently there is some "sync involving a FAT partition" option which seems to be code for "filesystem is deficient because it does not support permissions".

To fix, do one of

  • change the preference and any associated error messages to "filesystem does not support permissions". Add a hint about that preference to the error message.
  • treat permissions like xattr and acl, and just don't try to set permissions on deficient filesystems. Be careful not to result in permission changes on POSIX-compliant filesystems. This is probably the better approach.

For context, see #591. Note that this has not been reproduced on 2.51.5, and I'm making an exception (for a bug not reproduced on the most recent release).

gdt avatar Feb 16 '22 12:02 gdt

I think this issue is just about the GUI screen in the profile creation wizard and the explanation provided on that screen. The message should mention that this option is relevant only when syncing to FAT on non-Windows systems. (When one of the machines is Windows, this is automatically detected.)

This is the actual documentation for the "fat" preference:

          When this is set to true, Unison will use appropriate options to
          synchronize efficiently and without error a replica located on a
          FAT filesystem on a non-Windows machine: do not synchronize
          permissions (perms = 0); never use chmod (dontchmod = true);
          treat filenames as case insensitive (ignorecase = true); do not
          attempt to synchronize symbolic links (links = false); ignore
          inode number changes when detecting updates (ignoreinodenumbers
          = true). Any of these change can be overridden by explicitly
          setting the corresponding preference in the profile.

It is just a convenience option to set multiple preferences automatically because Unison currently doesn't detect filesystem type and when running on non-Windows system expects POSIX semantics (and rightly so).

tleedjarv avatar Feb 18 '22 12:02 tleedjarv

OK, but is it really "FAT", or is it "deficient filesystem"? And, it seems some variety of Windows filesystems have some of those abilities, and some don't.

gdt avatar Feb 18 '22 13:02 gdt

I don't think it is "deficient filesystem". NTFS for sure supports many-many things but those features might not be available on a non-Windows system. So, deficient driver, I'd wager.

Sure, it can't be just FAT but what other widely-used fs does not support these basic features? (exFAT is also FAT, so doesn't count, in my view)

tleedjarv avatar Feb 18 '22 13:02 tleedjarv

Good point about FS vs driver-and-FS.

gdt avatar Feb 27 '22 14:02 gdt