[PATCH] Don't chmod device nodes for ! lines

From: Alyssa Ross <hi_at_alyssa.is>
Date: Thu, 6 Nov 2025 16:18:19 +0100

Busybox mdev will not chmod the device node when the matched rule
contains a '!'. Matching this behaviour makes it possible for a rule
to preserve the mode set by the kernel for devices that are created
automatically by devtmpfs.

Signed-off-by: Alyssa Ross <hi_at_alyssa.is>
---
 src/mdevd/mdevd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c
index bbef872..bf81c7b 100644
--- a/src/mdevd/mdevd.c
+++ b/src/mdevd/mdevd.c
_at__at_ -640,7 +640,7 _at__at_ static inline int run_scriptelem (struct uevent_s const *event, scriptelem const
       break ;
     }
   }
-  if (nodelen && ud->action == ACTION_ADD && ud->mmaj >= 0)
+  if (elem->movetype != MOVEINFO_NOCREATE && nodelen && ud->action == ACTION_ADD && ud->mmaj >= 0)
   {
     if (!makesubdirs(node)) return -1 ;
     if (dryrun)
base-commit: a25ba0f5dff29b8782dbd11741e33ea6bf0f8e26
-- 
2.51.0
Received on Thu Nov 06 2025 - 16:18:19 CET

This archive was generated by hypermail 2.4.0 : Thu Nov 06 2025 - 16:19:40 CET