diff options
author | Jan Parcel <Jan.Parcel@Sun.COM> | 2009-05-05 18:13:24 -0700 |
---|---|---|
committer | Jan Parcel <Jan.Parcel@Sun.COM> | 2009-05-05 18:13:24 -0700 |
commit | d0ca2f1b4d37144fd17320cb6e246d4a46aaac18 (patch) | |
tree | 10080d80caf378c40cf7ff18067447cf4311f5a4 /usr | |
parent | 9ba19c87647b6b9e8c1fc1f52288772ae3cc247c (diff) | |
download | illumos-gate-d0ca2f1b4d37144fd17320cb6e246d4a46aaac18.tar.gz |
6667054 devfsadm assumes loading of the audit module implies device allocation
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/cmd/devfsadm/devfsadm.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c index 1dabbb4233..2720576884 100644 --- a/usr/src/cmd/devfsadm/devfsadm.c +++ b/usr/src/cmd/devfsadm/devfsadm.c @@ -322,11 +322,18 @@ main(int argc, char *argv[]) devalloc_is_on = da_is_on(); } else if (auditon(A_GETCOND, (caddr_t)&cond, sizeof (cond)) == 0) { /* - * Device allocation (and auditing) is enabled if BSM is - * enabled. auditon returns -1 and sets errno to EINVAL if BSM - * is not enabled. + * auditon returns -1 and sets errno to EINVAL if BSM + * is not enabled, so devalloc_is_on must be 0 if no BSM. + * + * Device allocation (and auditing) is enabled by default + * if BSM is enabled, but by default DEVICE_ALLOCATE= + * string is absent from device_allocate, so da_is_on + * will return -1. To preserve the historical default + * behavior but allow disabling device allocation where needed, + * set devalloc_is_on to true for non-0, false only for 0. + * */ - devalloc_is_on = 1; + devalloc_is_on = (da_is_on() == 0) ? 0 : 1; } #ifdef DEBUG |