borg
borg copied to clipboard
error handling in ACL code
currently, the acl get/set functions are called, but their return code is not evaluated.
this should be reviewed, considering:
- is it good? like "doing as much as possible". we also have some other places that try stuff and silently fail (e.g. if a file owned by another user is restored and we are not root: we can not chown to the other user then. we try it and silently fail, so the file is just owned by current user.)
- is it bad? like "hiding severe issues".
Error handling could be added like this (linux):
+ rc = acl_set_file(path, ...)
+ if rc < 0:
+ error_number = errno.errno
+ raise OSError(error_number, strerror(error_number).decode(), path)
As this is platform code, all platforms have to be considered.
guess best is: raise OSError there and deal with it at a higher layer.
http://wiki.linux-nfs.org/wiki/index.php/ACLs about nfs v4 ACLs (and others)