From d0fd6df32613dbdb0db3c1e6a7431312572d53e4 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Wed, 27 Nov 2019 11:01:08 -0700 Subject: [PATCH] ceph-daemon: chown uid/gid `ceph-volume` tmpfiles Signed-off-by: Michael Fritch --- src/ceph-daemon/ceph-daemon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ceph-daemon/ceph-daemon b/src/ceph-daemon/ceph-daemon index 7a7db2a8eb7..464d82d918d 100755 --- a/src/ceph-daemon/ceph-daemon +++ b/src/ceph-daemon/ceph-daemon @@ -1354,6 +1354,7 @@ def command_ceph_volume(): if args.fsid: make_log_dir(args.fsid) + (uid, gid) = extract_uid_gid() mounts = get_container_mounts(args.fsid, 'osd', None) tmp_config = None @@ -1367,12 +1368,14 @@ def command_ceph_volume(): # tmp keyring file tmp_keyring = tempfile.NamedTemporaryFile(mode='w') os.fchmod(tmp_keyring.fileno(), 0o600) + os.fchown(tmp_keyring.fileno(), uid, gid) tmp_keyring.write(keyring) tmp_keyring.flush() # tmp config file tmp_config = tempfile.NamedTemporaryFile(mode='w') os.fchmod(tmp_config.fileno(), 0o600) + os.fchown(tmp_keyring.fileno(), uid, gid) tmp_config.write(config) tmp_config.flush() -- 2.39.5