borg icon indicating copy to clipboard operation
borg copied to clipboard

error handling in ACL code

Open ThomasWaldmann opened this issue 7 years ago • 1 comments

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.

ThomasWaldmann avatar Aug 15 '18 13:08 ThomasWaldmann

guess best is: raise OSError there and deal with it at a higher layer.

ThomasWaldmann avatar Aug 15 '18 13:08 ThomasWaldmann

http://wiki.linux-nfs.org/wiki/index.php/ACLs about nfs v4 ACLs (and others)

ThomasWaldmann avatar Mar 02 '24 20:03 ThomasWaldmann