mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-29 16:30:44 +01:00
shell: restrict export file permissions, rollback policy on user create failure
- s3.iam.export: use os.OpenFile with mode 0600 instead of os.Create to protect exported credentials from other users - s3.user.provision: rollback the created policy if CreateUser fails, with a warning if the rollback itself fails
This commit is contained in:
1 parent
57086977ee
commit
a898fe8e28
2 files changed
+6
-2
No files matched your search
@@ -59,7 +59,7 @@ func (c *commandS3IAMExport) Do(args []string, commandEnv *CommandEnv, writer io
|
||||
|
||||
var out io.Writer = writer
|
||||
if *file != "" {
|
||||
fp, err := os.Create(*file)
|
||||
fp, err := os.OpenFile(*file, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create file: %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user