From c1332ae89866f243f4817dc4d3bdd7f11d3f9a9a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 20 May 2010 06:24:45 +0200 Subject: [PATCH] use default mode of 0600 for nodes if gid == 0 --- udev/udev-event.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/udev/udev-event.c b/udev/udev-event.c index bcd0a8f1..ad6db83a 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -41,7 +41,6 @@ struct udev_event *udev_event_new(struct udev_device *dev) event->dev = dev; event->udev = udev_device_get_udev(dev); udev_list_init(&event->run_list); - event->mode = 0660; dbg(event->udev, "allocated event %p\n", event); return event; } @@ -644,6 +643,12 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) if (event->dev_db != NULL) udev_node_update_old_links(dev, event->dev_db); + if (event->mode == 0) { + if (event->gid > 0) + event->mode = 0660; + else + event->mode = 0600; + } err = udev_node_add(dev, event->mode, event->uid, event->gid); } -- 2.39.5