From: greg@kroah.com Date: Thu, 4 Dec 2003 01:41:02 +0000 (-0800) Subject: [PATCH] add support for the default_mode variable, as it is documented... X-Git-Tag: 008~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8957102244524980f5008dcaf4cbf271a5254531;p=systemd [PATCH] add support for the default_mode variable, as it is documented... --- diff --git a/namedev.c b/namedev.c index b9e09941..f4c263f5 100644 --- a/namedev.c +++ b/namedev.c @@ -138,8 +138,12 @@ int add_config_dev(struct config_device *new_dev) static mode_t get_default_mode(struct sysfs_class_device *class_dev) { - /* just default everyone to rw for the world! */ - return 0666; + mode_t mode = 0600; /* default to owner rw only */ + + if (strlen(default_mode_str) != 0) { + mode = strtol(default_mode_str, NULL, 8); + } + return mode; } static void build_kernel_number(struct sysfs_class_device *class_dev, struct udevice *udev)