filer copy added uid/gid

This commit is contained in:
Chris Lu
2018-05-21 01:25:30 -07:00
parent f07482382b
commit 9dd228747c
10 changed files with 163 additions and 94 deletions

View File

@@ -68,7 +68,7 @@ func runCopy(cmd *Command, args []string) bool {
return false
}
filerDestination := args[len(args)-1]
fileOrDirs := args[0 : len(args)-1]
fileOrDirs := args[0: len(args)-1]
filerUrl, err := url.Parse(filerDestination)
if err != nil {
@@ -136,7 +136,8 @@ func doEachCopy(fileOrDir string, host string, path string) bool {
path = path + fi.Name()
}
if err = filer_operation.RegisterFile(host, path, results[0].Fid, parts[0].FileSize, copy.secret); err != nil {
if err = filer_operation.RegisterFile(host, path, results[0].Fid, parts[0].FileSize,
os.Getuid(), os.Getgid(), copy.secret); err != nil {
fmt.Printf("Failed to register file %s on %s: %v\n", fileOrDir, host, err)
return false
}