mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
merge branch 'pr-3623'
Evan Phoenix (1): Fixes inability to use /dev/null when inside a container LGTMs: kolyshkin cyphar Closes #3623
This commit is contained in:
@@ -133,8 +133,18 @@ func systemdProperties(r *configs.Resources) ([]systemdDbus.Property, error) {
|
||||
// rules separately to systemd) we can safely skip entries that don't
|
||||
// have a corresponding path.
|
||||
if _, err := os.Stat(entry.Path); err != nil {
|
||||
logrus.Debugf("skipping device %s for systemd: %s", entry.Path, err)
|
||||
continue
|
||||
// Also check /sys/dev so that we don't depend on /dev/{block,char}
|
||||
// being populated. (/dev/{block,char} is populated by udev, which
|
||||
// isn't strictly required for systemd). Ironically, this happens most
|
||||
// easily when starting containerd within a runc created container
|
||||
// itself.
|
||||
|
||||
// We don't bother with securejoin here because we create entry.Path
|
||||
// right above here, so we know it's safe.
|
||||
if _, err := os.Stat("/sys" + entry.Path); err != nil {
|
||||
logrus.Warnf("skipping device %s for systemd: %s", entry.Path, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
deviceAllowList = append(deviceAllowList, entry)
|
||||
|
||||
Reference in New Issue
Block a user