diff options
author | pr131582 <none@none> | 2008-05-27 02:49:26 -0700 |
---|---|---|
committer | pr131582 <none@none> | 2008-05-27 02:49:26 -0700 |
commit | 8c206d179daa8d2ab7f72877d30fff11fa3828f4 (patch) | |
tree | 3c01c9a098f28225ba06aa2affab4a6ccfa896e5 /usr/src/cmd/devfsadm/devfsadm.c | |
parent | 4f21de4de62438ab8d68068436ab239e141e47a1 (diff) | |
download | illumos-joyent-8c206d179daa8d2ab7f72877d30fff11fa3828f4.tar.gz |
6611349 "devfsadm -d" does not restore permissions of allocatable device from "/etc/minor_perm".
Diffstat (limited to 'usr/src/cmd/devfsadm/devfsadm.c')
-rw-r--r-- | usr/src/cmd/devfsadm/devfsadm.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c index e764eb29a1..6598cc3639 100644 --- a/usr/src/cmd/devfsadm/devfsadm.c +++ b/usr/src/cmd/devfsadm/devfsadm.c @@ -431,6 +431,17 @@ main(int argc, char *argv[]) } else { /* not a daemon, so just build /dev and /devices */ + + /* + * If turning off device allocation, load the + * minor_perm file because process_devinfo_tree() will + * need this in order to reset the permissions of the + * device files. + */ + if (devalloc_flag == DA_OFF) { + read_minor_perm_file(); + } + process_devinfo_tree(); if (devalloc_flag != 0) /* Enable/disable device allocation */ @@ -3014,10 +3025,13 @@ reset_node_permissions(di_node_t node, di_minor_t minor) return; } - if ((devalloc_flag == DA_ON) || (devalloc_is_on == 1)) { + if ((devalloc_flag == DA_ON) || + ((devalloc_is_on == 1) && (devalloc_flag != DA_OFF))) { /* - * we are here either to turn device allocation on - * or to add a new device while device allocation in on + * we are here either to turn device allocation on or + * to add a new device while device allocation is on + * (and we've confirmed that we're not turning it + * off). */ mode = DEALLOC_MODE; uid = DA_UID; |