diff options
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-event.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c index ad6db83aea..9c2ce1d388 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -38,6 +38,7 @@ struct udev_event *udev_event_new(struct udev_device *dev) event = calloc(1, sizeof(struct udev_event)); if (event == NULL) return NULL; + event->mode = 0600; event->dev = dev; event->udev = udev_device_get_udev(dev); udev_list_init(&event->run_list); @@ -643,12 +644,10 @@ 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; - } + /* change default 0600 to 0660 if a group is assigned */ + if (event->mode == 0600 && event->gid > 0) + event->mode = 0660; + err = udev_node_add(dev, event->mode, event->uid, event->gid); } |