]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: chown uid/gid `ceph-volume` tmpfiles
authorMichael Fritch <mfritch@suse.com>
Wed, 27 Nov 2019 18:01:08 +0000 (11:01 -0700)
committerMichael Fritch <mfritch@suse.com>
Mon, 2 Dec 2019 23:17:42 +0000 (16:17 -0700)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/ceph-daemon/ceph-daemon

index 7a7db2a8eb765427c659f2953c698645876afd16..464d82d918d947df42d436d33f15b3b52ebe9ee7 100755 (executable)
@@ -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()