From 5f2f6b56df60574db13eab1ba9c12a90d89dd9f1 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Wed, 15 Apr 2026 01:12:31 +1000 Subject: [PATCH] rootfs: switch createDevices argument order This argument order matches most other helpers we have and will also match the changes we are about to make to setupPtmx and setupDevSymlinks. Signed-off-by: Aleksa Sarai (cherry picked from commit fcf04eb41b0e3c74a6ba24c75bf50875e01240f5) Signed-off-by: Aleksa Sarai --- libcontainer/rootfs_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 4eb1cedaf..a6fdb5538 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -184,7 +184,7 @@ func prepareRootfs(pipe *syncSocket, iConfig *initConfig) (err error) { setupDev := needsSetupDev(config) if setupDev { - if err := createDevices(config, rootFd); err != nil { + if err := createDevices(rootFd, config); err != nil { return fmt.Errorf("error creating device nodes: %w", err) } if err := setupPtmx(config); err != nil { @@ -959,7 +959,7 @@ func reOpenDevNull() error { } // Create the device nodes in the container. -func createDevices(config *configs.Config, rootFd *os.File) error { +func createDevices(rootFd *os.File, config *configs.Config) error { useBindMount := userns.RunningInUserNS() || config.Namespaces.Contains(configs.NEWUSER) for _, node := range config.Devices {