Merge pull request #1115 from rajasec/filemode-panic
Fixing runc panic for missing file mode
This commit is contained in:
commit
4161f2a63b
|
@ -537,6 +537,8 @@ func createDevices(spec *specs.Spec, config *configs.Config) error {
|
||||||
// merge in additional devices from the spec
|
// merge in additional devices from the spec
|
||||||
for _, d := range spec.Linux.Devices {
|
for _, d := range spec.Linux.Devices {
|
||||||
var uid, gid uint32
|
var uid, gid uint32
|
||||||
|
var filemode os.FileMode = 0666
|
||||||
|
|
||||||
if d.UID != nil {
|
if d.UID != nil {
|
||||||
uid = *d.UID
|
uid = *d.UID
|
||||||
}
|
}
|
||||||
|
@ -547,12 +549,15 @@ func createDevices(spec *specs.Spec, config *configs.Config) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if d.FileMode != nil {
|
||||||
|
filemode = *d.FileMode
|
||||||
|
}
|
||||||
device := &configs.Device{
|
device := &configs.Device{
|
||||||
Type: dt,
|
Type: dt,
|
||||||
Path: d.Path,
|
Path: d.Path,
|
||||||
Major: d.Major,
|
Major: d.Major,
|
||||||
Minor: d.Minor,
|
Minor: d.Minor,
|
||||||
FileMode: *d.FileMode,
|
FileMode: filemode,
|
||||||
Uid: uid,
|
Uid: uid,
|
||||||
Gid: gid,
|
Gid: gid,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue