If the uid or gid passed to copy_tree(), copy_files() or
move_files() is 0 (the root user), the current check for
`if not uid or not gid` does the wrong thing, i.e. it
thinks the uid and/or gid aren't set, then calls out to
extract_uid_gid(), which fails when run against
prometheus/grafana/alertmanager containers.
Fixes: https://tracker.ceph.com/issues/47745
Signed-off-by: Tim Serong <tserong@suse.com>
"""
Copy a directory tree from src to dst
"""
- if not uid or not gid:
+ if uid is None or gid is None:
(uid, gid) = extract_uid_gid()
for src_dir in src:
"""
Copy a files from src to dst
"""
- if not uid or not gid:
+ if uid is None or gid is None:
(uid, gid) = extract_uid_gid()
for src_file in src:
"""
Move files from src to dst
"""
- if not uid or not gid:
+ if uid is None or gid is None:
(uid, gid) = extract_uid_gid()
for src_file in src: