Comment 8 for bug 1018499

Revision history for this message
Daniel Wennberg (daniel-wennberg) wrote :

I had a similar problem on Windows 7, except that a small number of files in My Documents actually did sync from the beginning; the rest, however, required Ubuntu One running as administrator to sync. I use a folder sync utlilty called Memeo AutoSync to keep a bidirectionally synced copy of My Documents on an external drive, and I realized that the files syncing from the beginning were files that Memeo has never written to (they were created in My Documents, and the copy on the external drive has never been edited). Robert and Jon, have your non-syncing files been created or moved in unconventional ways (for instance by cheap/bad software)?

It appears that Memeo always writes files and folders with the permissions Robert listed in #3 (the default permissions for objects without special restrictions, lets call them general permissions). But the home directory has its own default permissions, and it seems like Ubuntu One only works with these unless running with admin rights. This might sound funny considering that the home permissions are in many ways more restrictive than the general permissions, but perhaps the limitation is related to that Ubuntu One only will sync of folders inside home? (My guess is that Ubuntu One requires the necessary permissions granted specifically to the current user; the current user being in a group with the necessary permissions is not enough.)

Permissions are inheritable, and I suppose that any well written program, utlilty, shell extension etc. will respect this unless there's a reason not to. Hence, any file in the My Documents folder will have home permissions, and our problem would never occur. Perhaps the lack of flexibility with permissions could be considered a bug in Ubuntu One, but I primarily blame Memeo AutoSync for not respecting inheritable permissions. I'll go looking for a better folder sync utility.

There is a simple way to fix the permissions for the affected files:
1. Make sure that the parent folder of the contents you want to sync (the one at the home directory level, in my case the My Documents folder) has the home permissions - it probably will. To check, open the folder properties and go to the "Security" tab. The following users/groups should have full control ("Allow" checked on all lines except "Special permissions"): "SYSTEM", "<username> (<computer-name>\<username>)" and "Administrators (<computer-name>\Administrators)". No other users or groups should be listed. If anything is wrong, changing it might be difficult, but not impossible; play around with changing owner of the folder etc.

2. Force all the contents of this folder to inherit its permissions: While still in the "Security" tab, click "Advanced", then click "Change Permissions...". Check the box labeled "Replace all child permissions with inheritable permissions from this object", click "OK" and click "Yes" in the warning dialog.

Now Ubuntu One should work with all files in this folder. To make the fix permanent, stop using the bad software. If you want to continue using both it and Ubuntu One, you will have to repeat the described procedure at regular intervals to keep everyhting in sync.

The procedure will also work if done on the home folder itself (C:\User\<username>), but that will change the permissions of some protected operating system junctions etc. hidden in the home directory, so I don't think its a good idea. If you perform it on My Documents, My Music, My Pictures, My Videos and any folders you know the bad software has been touching, everything should be fine.