unison keeps changing owner, group, and permissions

148 Views Asked by At

I am using the unison file synchronizer between Windows 10 and Debian 12. For some reason it keeps changing the owner, the group, and the permissions of a file.

Before:

-rw-rw---- 1 www-data www-data 7448 Nov 30 09:13 trac.ini

After:

-rw-r--r-- 1 thomas  thomas  7447 Nov 30 09:24 trac.ini

The user thomas is part of the www-data group and is used for unison synchronization. I am using unison 2.53.3 with the following settings:

owner = false 
group = false
dontchmod = true
perms=0
acl = false

Do you know why the file properties keep changing?

Edit 2023-12-01

I assume the reason is that unison

  1. creates a new, temporary file,
  2. deletes the existing file, and
  3. renames the temporary file to the name of the deleted file.

The new file receives the default permissions, owner, and group of the user who is running unison.

If my assumption is correct, how are the above settings supposed to be used? Or is just not possible between Windows and Linux?

Here are the log entries:

Unison 2.53.3 (ocaml 4.14.0) started propagating changes at 12:17:50.57 on 30 Nov 2023
[BGN] Updating file trac/conf/trac.ini from D:/ServerSync/www to //debian12//home/www
[files] copy D:/ServerSync/www trac/conf/trac.ini ---> //debian12//home/www trac/conf/trac.ini
[update] updateArchive D:/ServerSync/www trac/conf/trac.ini
[pred] ignore 'trac/conf/trac.ini' = false
[files] copyRec trac/conf/trac.ini --> .unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp  (really to trac.ini)
[abort] Checking line 0
[copy] copyRegFile(D:/ServerSync/www,trac/conf/trac.ini) -> (//debian12//home/www,trac.ini,/home/www/trac/conf,.unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp,modified on 2023-11-30 at 12:15:04  size 7449      unknown permissions)
[abort] Checking line 0
[server: pred] follow 'trac/conf/trac.ini' = false
[server: fspath] Os.findWorkingDir(/home/www,trac/conf/trac.ini) = (/home/www/trac/conf,trac.ini)
[server: copy] tryCopyMovedFile: -> .unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp /(86a468d364d8ac9b053abc05705cade5,)/
[server: xferhint] lookup: fp = (86a468d364d8ac9b053abc05705cade5,)
[server: copy] tryCopyMovedFile didn't work, so now we actually transfer
[server: copy] reallyTransferFile(D:/ServerSync/www,trac/conf/trac.ini) -> (/home/www/trac/conf,.unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp,trac.ini,modified on 2023-11-30 at 12:15:04  size 7449      unknown permissions)
[server: rsync] preprocessing
[server: rsynclog] block size = 700 bytes; block count = 10; strong checksum size = 3
[abort] Checking line 0
[rsync] compressing
[rsynclog] compression buffer size = 8192 bytes
[rsynclog] block size = 700 bytes
[rsynclog] 64 hash table entries
[rsynclog] 54 empty, 10 used, 0 collided
[rsynctoken] updating the compression buffer
[rsynctoken] new length = 7449 bytes
[rsynctoken] pushing string (pos:0/65500 len:702)
[rsynctoken] pushing block (pos:705/65500)
[rsynctoken] growing blocks (pos:710/65500)
[rsynctoken] pushing string (pos:710/65500 len:447)
[rsynctoken] pushing EOF (pos:1160/65500)
[rsynctoken] flushing the token queue
[rsynclog] hit-hit = 9, hit-miss = 0, miss-miss = 3, hit rate = 100%
[server: rsynclog] 10 blocks
[server: copy] Starting the actual transfer
[server: abort] Checking line 0
[server: rsynctoken] decompressing string (702 bytes)
[server: rsynctoken] decompressing 9 block(s) (sequence 1->9)
[server: rsynctoken] decompressing string (447 bytes)
[server: copy] transferResourceForkAndSetFileinfo .unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp
[server: copy] Resource fork transferred for trac.ini; doing last paranoid check
[server: xferhint] insertEntry: fspath=/home/www/trac/conf, path=.unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp, fp=(86a468d364d8ac9b053abc05705cade5,)
[files] rename(root=//debian12//home/www, localPath=trac/conf/trac.ini, pathOld=.unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp, pathNew=trac.ini)
[server: update] checkNoUpdates /home/www trac/conf/trac.ini
[server: update] buildUpdateRec: /home/www/trac/conf/trac.ini
[server: update] checkContentsChange: archStamp is inode (106173286) / info.inode (106173286) / times: 1701342849.592926 = 1701342849.592926... true / lengths: 7447 - 7447
[server: xferhint] insertEntry: fspath=/home/www, path=trac/conf/trac.ini, fp=(11c589c1b5293a98bf86827d1068c654,)
[server: update]   archive digest = (11c589c1b5293a98bf86827d1068c654,)   current digest = (11c589c1b5293a98bf86827d1068c654,)
[server: files] Renaming .unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp to trac.ini in /home/www/trac/conf; root is /home/www
[server: files] rename: moveFirst=false
[server: stasher] backup: /home/www / trac/conf/trac.ini
[server: pred] follow 'trac/conf/trac.ini' = false
[server: fspath] Os.findWorkingDir(/home/www,trac/conf/trac.ini) = (/home/www/trac/conf,trac.ini)
[server: pred] backup 'trac/conf/trac.ini' = false
[server: stasher] Path /home/www / trac/conf/trac.ini does not need to be backed up
[server: os] rename /home/www/trac/conf/.unison.trac.ini.3cf645660f038354c49973b861281767.unison.tmp to /home/www/trac/conf/trac.ini
[update] updateArchive D:/ServerSync/www trac/conf/trac.ini
[pred] ignore 'trac/conf/trac.ini' = false
[update] replaceArchiveLocal D:/ServerSync/www trac/conf/trac.ini
[update] Setting archive for //mywindows/D:/ServerSync/www
[pred] backupcurr 'trac/conf/trac.ini' = false
[END] Updating file trac/conf/trac.ini
<>[server: files] Contents of /home/www/trac/conf/trac.ini after renaming = 86a468d364d8ac9b053abc05705cade5
[server: pred] backupcurr 'trac/conf/trac.ini' = false
[server: xferhint] insertEntry: fspath=/home/www, path=trac/conf/trac.ini, fp=(86a468d364d8ac9b053abc05705cade5,)
[server: update] replaceArchiveLocal /home/www trac/conf/trac.ini
[server: update] Setting archive for //debian12//home/www
Unison 2.53.3 (ocaml 4.14.0) finished propagating changes at 12:17:50.77 on 30 Nov 2023, 0.202 s
0

There are 0 best solutions below