Mercurial > illumos > illumos-gate
changeset 11710:9f3aa405215b
6913278 auditconfig -setqbufsz 0 give an auditon(2) error
author | Jan Friedel <Jan.Friedel@Sun.COM> |
---|---|
date | Fri, 19 Feb 2010 16:37:47 +0100 |
parents | 23b9c3ed87a0 |
children | d0efae043e26 |
files | usr/src/cmd/auditconfig/auditconfig.c |
diffstat | 1 files changed, 29 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/auditconfig/auditconfig.c Fri Feb 19 16:37:45 2010 +0100 +++ b/usr/src/cmd/auditconfig/auditconfig.c Fri Feb 19 16:37:47 2010 +0100 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1791,6 +1791,9 @@ exit_error(gettext( "Could not store configuration value.")); } + if (qctrl.aq_bufsz == 0) { + return; + } } eauditon(A_GETQCTRL, (caddr_t)&qctrl, 0); @@ -1815,10 +1818,26 @@ qctrl.aq_delay = (clock_t)atol(delay); if (!temporary_set) { + struct au_qctrl qctrl_act; + if (!do_setqctrl_scf(&qctrl)) { exit_error(gettext( "Could not store configuration values.")); } + + eauditon(A_GETQCTRL, (caddr_t)&qctrl_act, 0); + if (qctrl.aq_hiwater == 0) { + qctrl.aq_hiwater = qctrl_act.aq_hiwater; + } + if (qctrl.aq_lowater == 0) { + qctrl.aq_lowater = qctrl_act.aq_lowater; + } + if (qctrl.aq_bufsz == 0) { + qctrl.aq_bufsz = qctrl_act.aq_bufsz; + } + if (qctrl.aq_delay == 0) { + qctrl.aq_delay = qctrl_act.aq_delay; + } } eauditon(A_SETQCTRL, (caddr_t)&qctrl, 0); @@ -1840,6 +1859,9 @@ exit_error(gettext( "Could not store configuration value.")); } + if (qctrl.aq_delay == 0) { + return; + } } eauditon(A_GETQCTRL, (caddr_t)&qctrl, 0); @@ -1864,6 +1886,9 @@ exit_error(gettext( "Could not store configuration value.")); } + if (qctrl.aq_hiwater == 0) { + return; + } } eauditon(A_GETQCTRL, (caddr_t)&qctrl, 0); @@ -1888,6 +1913,9 @@ exit_error(gettext( "Could not store configuration value.")); } + if (qctrl.aq_lowater == 0) { + return; + } } eauditon(A_GETQCTRL, (caddr_t)&qctrl, 0);