From: Sage Weil Date: Fri, 4 Oct 2019 20:58:19 +0000 (-0500) Subject: ceph-daemon: fchmod before writing to keyring file X-Git-Tag: v15.1.0~1313^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d65f49de17b0ce06e9435ea0ac04011b87a94959;p=ceph-ci.git ceph-daemon: fchmod before writing to keyring file Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index 8a652ec3072..79fb8a1b034 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -618,9 +618,9 @@ def command_bootstrap(): # output files if args.output_keyring: with open(args.output_keyring, 'w') as f: + os.fchmod(f.fileno(), 0o600) f.write('[client.admin]\n' '\tkey = ' + admin_key + '\n') - os.fchmod(f.fileno(), 0o600) logging.info('Wrote keyring to %s' % args.output_keyring) if args.output_config: with open(args.output_config, 'w') as f: