Fri 13 Jan 2006 12:57:02 PM UTC, original submission:
I am backing up from a linux server with ACLs to a linux server with ACLs. Both servers have different passwd/group files, i.e. some users from the source don't exist on the destination. I am not using user or group mapping files. I am using rdiff-backup-1.0.1 on Gentoo.
There is one file on the source with an ACL referencing user "gterrien", which doesn't exist on the destination. rdiff-backup warns that the ACL is dropped and continues. But it raises an uncaught exception and aborts as soon as it reaches a file without ACL but owned by "gterrien". The exception is due to calling os.chown() with "None" as the user parameter.
I could diagnose the cause as follows:
- The unknown user is detected in eas_acls.list_to_acl() after calling map_id_name().
- map_id_name() calls user_group.Map.get_id_from_name() to retrieve the id for a username.
- Map.get_id_from_name() calls Map.find_id_from_name(), which returns None if the username cannot be found.
- Map.get_id_from_name() gets None as the id and stores it in its cache name2id_dict.
- When rdiff-backup reaches the next file without ACL but with the same username, it calls user_group.Map.get_id().
- Map.get_id() looks the username up in the cache name2id_dict and finds an entry with value None, so it returns None instead of the id passed to get_id().
I am not familiar enough with the internal workings of rdiff-backup, so I am not sure what the correct fix would be.
I would propose either of the following:
- Check in Map.get_id_from_name() if find_id_from_name() returns None, and not store it in the cache if it is the case.
- Check in Map.get_id() if the value returned by the cache is None, and in that case to return the id passed as parameter.
Please feel free to contact me if you need more information or testing.
|