|
@@ -1399,28 +1399,32 @@ class FilesystemObjectProcessors:
|
|
item.update(self.metadata_collector.stat_attrs(st, path)) # can't use FD here?
|
|
item.update(self.metadata_collector.stat_attrs(st, path)) # can't use FD here?
|
|
return status
|
|
return status
|
|
|
|
|
|
- def process_pipe(self, *, path, cache, fd, mode, user, group):
|
|
|
|
|
|
+ def process_pipe(self, *, path, cache, fd, mode, user=None, group=None):
|
|
status = "i" # stdin (or other pipe)
|
|
status = "i" # stdin (or other pipe)
|
|
self.print_file_status(status, path)
|
|
self.print_file_status(status, path)
|
|
status = None # we already printed the status
|
|
status = None # we already printed the status
|
|
- uid = user2uid(user)
|
|
|
|
- if uid is None:
|
|
|
|
- raise Error("no such user: %s" % user)
|
|
|
|
- gid = group2gid(group)
|
|
|
|
- if gid is None:
|
|
|
|
- raise Error("no such group: %s" % group)
|
|
|
|
|
|
+ if user is not None:
|
|
|
|
+ uid = user2uid(user)
|
|
|
|
+ if uid is None:
|
|
|
|
+ raise Error("no such user: %s" % user)
|
|
|
|
+ else:
|
|
|
|
+ uid = None
|
|
|
|
+ if group is not None:
|
|
|
|
+ gid = group2gid(group)
|
|
|
|
+ if gid is None:
|
|
|
|
+ raise Error("no such group: %s" % group)
|
|
|
|
+ else:
|
|
|
|
+ gid = None
|
|
t = int(time.time()) * 1000000000
|
|
t = int(time.time()) * 1000000000
|
|
- item = Item(
|
|
|
|
- path=path,
|
|
|
|
- mode=mode & 0o107777 | 0o100000, # forcing regular file mode
|
|
|
|
- uid=uid,
|
|
|
|
- user=user,
|
|
|
|
- gid=gid,
|
|
|
|
- group=group,
|
|
|
|
- mtime=t,
|
|
|
|
- atime=t,
|
|
|
|
- ctime=t,
|
|
|
|
- )
|
|
|
|
|
|
+ item = Item(path=path, mode=mode & 0o107777 | 0o100000, mtime=t, atime=t, ctime=t) # forcing regular file mode
|
|
|
|
+ if user is not None:
|
|
|
|
+ item.user = user
|
|
|
|
+ if group is not None:
|
|
|
|
+ item.group = group
|
|
|
|
+ if uid is not None:
|
|
|
|
+ item.uid = uid
|
|
|
|
+ if gid is not None:
|
|
|
|
+ item.gid = gid
|
|
self.process_file_chunks(item, cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(fd)))
|
|
self.process_file_chunks(item, cache, self.stats, self.show_progress, backup_io_iter(self.chunker.chunkify(fd)))
|
|
item.get_size(memorize=True)
|
|
item.get_size(memorize=True)
|
|
self.stats.nfiles += 1
|
|
self.stats.nfiles += 1
|