Fix ticket #907: mknod fails due to path not found
parent
a3874084b2
commit
360120b1f0
|
@ -1253,13 +1253,16 @@ class OpengnsysGitLibrary:
|
|||
os.mknod(full_path, mode = file_mode, device = data['rdev'])
|
||||
else:
|
||||
self.logger.warning(f"Unknown file type for {filename}: {file_mode}")
|
||||
|
||||
# chown clears suid bit, so even though it's redundant in most cases and already
|
||||
# done above, set the full perms on the file again anyway.
|
||||
os.chown(full_path, data['uid'], data['gid'])
|
||||
os.chmod(full_path, file_mode)
|
||||
except FileExistsError as exists:
|
||||
self.logger.debug(f"Exists: {full_path}")
|
||||
except OSError as oserr:
|
||||
self.logger.warning(f"Failed to create special file {full_path}: Error {oserr.errno}: {oserr.strerror}")
|
||||
|
||||
# chown clears suid bit, so even though it's redundant in most cases and already
|
||||
# done above, set the full perms on the file again anyway.
|
||||
os.chown(full_path, data['uid'], data['gid'])
|
||||
os.chmod(full_path, file_mode)
|
||||
|
||||
self.logger.info("Metadata restoration completed.")
|
||||
|
||||
|
|
Loading…
Reference in New Issue