mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-20 21:27:32 +00:00
Merge pull request #2673 from ThomasWaldmann/negative-ids
FUSE: fix negative uid/gid crash, fixes #2674
This commit is contained in:
commit
b51198ebe7
1 changed files with 5 additions and 3 deletions
|
@ -70,7 +70,9 @@ def __init__(self, key, repository, manifest, args, cached_repo):
|
|||
self.items = {}
|
||||
self.parent = {}
|
||||
self.contents = defaultdict(dict)
|
||||
self.default_dir = Item(mode=0o40755, mtime=int(time.time() * 1e9), uid=os.getuid(), gid=os.getgid())
|
||||
self.default_uid = os.getuid()
|
||||
self.default_gid = os.getgid()
|
||||
self.default_dir = Item(mode=0o40755, mtime=int(time.time() * 1e9), uid=self.default_uid, gid=self.default_gid)
|
||||
self.pending_archives = {}
|
||||
self.cache = ItemCache()
|
||||
data_cache_capacity = int(os.environ.get('BORG_MOUNT_DATA_CACHE_ENTRIES', os.cpu_count() or 1))
|
||||
|
@ -263,8 +265,8 @@ def getattr(self, inode, ctx=None):
|
|||
entry.attr_timeout = 300
|
||||
entry.st_mode = item.mode
|
||||
entry.st_nlink = item.get('nlink', 1)
|
||||
entry.st_uid = item.uid
|
||||
entry.st_gid = item.gid
|
||||
entry.st_uid = item.uid if item.uid >= 0 else self.default_uid
|
||||
entry.st_gid = item.gid if item.gid >= 0 else self.default_gid
|
||||
entry.st_rdev = item.get('rdev', 0)
|
||||
entry.st_size = item.get_size()
|
||||
entry.st_blksize = 512
|
||||
|
|
Loading…
Reference in a new issue