diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-09-03 00:07:22 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-09-03 00:07:22 -0700 |
| commit | 7e1aad0b54bd3d6d1bc2bd8940aeeaf7186bcfa4 (patch) | |
| tree | 6aabe62fc9fd7d02ee92037386bb54de63910080 /weed/command/mount_std.go | |
| parent | 68e878adb5d63cb961fdff8585bd6eede3b616f1 (diff) | |
| download | seaweedfs-7e1aad0b54bd3d6d1bc2bd8940aeeaf7186bcfa4.tar.xz seaweedfs-7e1aad0b54bd3d6d1bc2bd8940aeeaf7186bcfa4.zip | |
mount: map uid/gid between local and filer
Diffstat (limited to 'weed/command/mount_std.go')
| -rw-r--r-- | weed/command/mount_std.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index 3975575e9..44e945f23 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -5,6 +5,7 @@ package command import ( "context" "fmt" + "github.com/chrislusf/seaweedfs/weed/filesys/meta_cache" "os" "os/user" "path" @@ -115,6 +116,13 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { } } + // mapping uid, gid + uidGidMapper, err := meta_cache.NewUidGidMapper(*option.uidMap, *option.gidMap) + if err != nil { + fmt.Printf("failed to parse %s %s: %v\n", *option.uidMap, *option.gidMap, err) + return false + } + // Ensure target mount point availability if isValid := checkMountPointAvailable(dir); !isValid { glog.Fatalf("Expected mount to still be active, target mount point: %s, please check!", dir) @@ -174,6 +182,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { Umask: umask, OutsideContainerClusterMode: *mountOptions.outsideContainerClusterMode, Cipher: cipher, + UidGidMapper: uidGidMapper, }) // mount |
