Skip to content

Commit 0e2367b

Browse files
committed
disable allow_other mount option
1 parent 3fbecb2 commit 0e2367b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/blobfuse/nodeserver.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
7878
attrib := req.GetVolumeContext()
7979
mountFlags := req.GetVolumeCapability().GetMount().GetMountFlags()
8080

81-
klog.V(2).Infof("target %v\nfstype %v\n\nreadonly %v\nvolumeId %v\ncontext %v\nmountflags %v\n",
82-
targetPath, fsType, readOnly, volumeID, attrib, mountFlags)
83-
8481
var accountName, accountKey, containerName string
8582

8683
secrets := req.GetSecrets()
@@ -116,18 +113,22 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu
116113
}
117114
}
118115

119-
// "allow_other" option refer to http://manpages.ubuntu.com/manpages/xenial/man8/mount.fuse.8.html
120-
options := []string{"-o allow_other"}
116+
// todo: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf
117+
options := []string{}
121118
if readOnly {
122119
options = append(options, "-o ro")
123120
}
124121
mountOptions := k8sutil.JoinMountOptions(mountFlags, options)
125122

123+
klog.V(2).Infof("target %v\nfstype %v\n\nreadonly %v\nvolumeId %v\ncontext %v\nmountflags %v\nmountOptions %v\n",
124+
targetPath, fsType, readOnly, volumeID, attrib, mountFlags, mountOptions)
125+
126126
cmd := exec.Command("/usr/blob/blobfuse", targetPath, "--tmp-path=/mnt/"+volumeID,
127127
"--container-name="+containerName, util.GetMountOptions(mountOptions))
128128
cmd.Env = append(os.Environ(), "AZURE_STORAGE_ACCOUNT="+accountName, "AZURE_STORAGE_ACCESS_KEY="+accountKey)
129-
err = cmd.Run()
129+
output, err := cmd.CombinedOutput()
130130
if err != nil {
131+
klog.Errorf("Mount failed with error: %v", string(output))
131132
notMnt, mntErr := d.mounter.IsLikelyNotMountPoint(targetPath)
132133
if mntErr != nil {
133134
klog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr)

0 commit comments

Comments
 (0)