Merge pull request #5028 from Iceber/runtime-spec

oci: fix the file mode of the device
This commit is contained in:
Phil Estes 2021-02-22 09:25:56 -05:00 committed by GitHub
commit 08d765af95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) {
case mode&unix.S_IFCHR == unix.S_IFCHR: case mode&unix.S_IFCHR == unix.S_IFCHR:
devType = "c" devType = "c"
} }
fm := os.FileMode(mode) fm := os.FileMode(mode &^ unix.S_IFMT)
return &specs.LinuxDevice{ return &specs.LinuxDevice{
Type: devType, Type: devType,
Path: path, Path: path,

View File

@ -107,7 +107,7 @@ func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) {
case mode&unix.S_IFCHR == unix.S_IFCHR: case mode&unix.S_IFCHR == unix.S_IFCHR:
devType = "c" devType = "c"
} }
fm := os.FileMode(mode) fm := os.FileMode(mode &^ unix.S_IFMT)
return &specs.LinuxDevice{ return &specs.LinuxDevice{
Type: devType, Type: devType,
Path: path, Path: path,