diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-05-20 06:24:45 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2010-05-20 06:24:45 +0200 |
commit | c1332ae89866f243f4817dc4d3bdd7f11d3f9a9a (patch) | |
tree | b810e52ba4d97d49c88b5b85234779e634898993 /udev/udev-event.c | |
parent | 0c5c48040ac0f4c97f73fb3ac5493cc2d84a963b (diff) |
use default mode of 0600 for nodes if gid == 0
Diffstat (limited to 'udev/udev-event.c')
-rw-r--r-- | udev/udev-event.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c index bcd0a8f13d..ad6db83aea 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); } |