From: Michael Fritch Date: Wed, 27 Nov 2019 18:01:08 +0000 (-0700) Subject: ceph-daemon: chown uid/gid `ceph-volume` tmpfiles X-Git-Tag: v15.1.0~674^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0fd6df32613dbdb0db3c1e6a7431312572d53e4;p=ceph.git ceph-daemon: chown uid/gid `ceph-volume` tmpfiles Signed-off-by: Michael Fritch --- diff --git a/src/ceph-daemon/ceph-daemon b/src/ceph-daemon/ceph-daemon index 7a7db2a8eb76..464d82d918d9 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()