mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-02 18:23:12 +00:00
Merge pull request #2598 from c3d/backport/2589-virtiofsd-perms-perms
stable-2.2 | virtiofs: Create shared directory with 0700 mode, not 0750
This commit is contained in:
commit
e58fabfc20
@ -68,6 +68,9 @@ const (
|
|||||||
kernelParamDebugConsole = "agent.debug_console"
|
kernelParamDebugConsole = "agent.debug_console"
|
||||||
kernelParamDebugConsoleVPort = "agent.debug_console_vport"
|
kernelParamDebugConsoleVPort = "agent.debug_console_vport"
|
||||||
kernelParamDebugConsoleVPortValue = "1026"
|
kernelParamDebugConsoleVPortValue = "1026"
|
||||||
|
|
||||||
|
// Restricted permission for shared directory managed by virtiofs
|
||||||
|
sharedDirMode = os.FileMode(0700) | os.ModeDir
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -516,7 +519,7 @@ func (k *kataAgent) setupSharedPath(ctx context.Context, sandbox *Sandbox) (err
|
|||||||
// create shared path structure
|
// create shared path structure
|
||||||
sharePath := getSharePath(sandbox.id)
|
sharePath := getSharePath(sandbox.id)
|
||||||
mountPath := getMountPath(sandbox.id)
|
mountPath := getMountPath(sandbox.id)
|
||||||
if err := os.MkdirAll(sharePath, DirMode); err != nil {
|
if err := os.MkdirAll(sharePath, sharedDirMode); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := os.MkdirAll(mountPath, DirMode); err != nil {
|
if err := os.MkdirAll(mountPath, DirMode); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user