Date: Sun, 5 Mar 2006 02:12:28 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92757 for review Message-ID: <200603050212.k252CSjB007197@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92757 Change 92757 by rwatson@rwatson_peppercorn on 2006/03/05 02:12:12 Switch to using Solaris-style AU_TO_WRITE and AU_NO_WRITE for 'keep' argument to au_close(). This appeared already to work due to numeric constants aligning (a bit like the stars), but using the actual constant names is better. Add a man page for au_open(), au_write(), au_close(), and au_close_buffer(). Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#3 edit .. //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#4 edit .. //depot/projects/trustedbsd/openbsm/libbsm/au_open.3#1 add .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#23 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#19 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#3 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#2 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.am#3 $ # INCLUDES = -I$(top_srcdir) @@ -30,6 +30,7 @@ au_free_token.3 \ au_io.3 \ au_mask.3 \ + au_open.3 \ au_token.3 \ au_user.3 \ libbsm.3 ==== //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#4 (text+ko) ==== @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#3 $ +# $P4: //depot/projects/trustedbsd/openbsm/libbsm/Makefile.in#4 $ # srcdir = @srcdir@ @@ -204,6 +204,7 @@ au_free_token.3 \ au_io.3 \ au_mask.3 \ + au_open.3 \ au_token.3 \ au_user.3 \ libbsm.3 ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#23 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#22 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_audit.c#23 $ */ #include <sys/types.h> @@ -280,12 +280,11 @@ return (-1); /* Invalid descriptor */ } - if (!keep) { + if (keep == AU_NO_WRITE) { retval = 0; goto cleanup; } - tot_rec_size = rec->len + BSM_HEADER_SIZE + BSM_TRAILER_SIZE; if (tot_rec_size > MAX_AUDIT_RECORD_SIZE) { ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#19 (text+ko) ==== @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#18 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#19 $ */ #ifdef __APPLE__ @@ -130,7 +130,7 @@ * tok = au_to_random_token_2(...); * au_write(aufd, tok); * ... - * au_close(aufd, 1, AUE_your_event_type); + * au_close(aufd, AU_TO_WRITE, AUE_your_event_type); * * Assumes, like all wrapper calls, that the caller has previously checked * that auditing is enabled via the audit_get_state() call. @@ -156,7 +156,7 @@ if (subject && au_write(aufd, subject) == -1) { au_free_token(subject); au_free_token(misctok); - (void)au_close(aufd, 0, event_code); + (void)au_close(aufd, AU_TO_WRITE, event_code); syslog(LOG_ERR, "%s: write of subject failed", func); return (kAUWriteSubjectTokErr); } @@ -164,31 +164,30 @@ /* Save the event-specific token. */ if (misctok && au_write(aufd, misctok) == -1) { au_free_token(misctok); - (void)au_close(aufd, 0, event_code); + (void)au_close(aufd, AU_NO_WRITE, event_code); syslog(LOG_ERR, "%s: write of caller token failed", func); return (kAUWriteCallerTokErr); } /* Tokenize and save the return value. */ if ((rettok = au_to_return32(retval, errcode)) == NULL) { - (void)au_close(aufd, 0, event_code); + (void)au_close(aufd, AU_NO_WRITE, event_code); syslog(LOG_ERR, "%s: au_to_return32() failed", func); return (kAUMakeReturnTokErr); } if (au_write(aufd, rettok) == -1) { au_free_token(rettok); - (void)au_close(aufd, 0, event_code); + (void)au_close(aufd, AU_NO_WRITE, event_code); syslog(LOG_ERR, "%s: write of return code failed", func); return (kAUWriteReturnTokErr); } /* - * au_close()'s second argument is "keep": if keep == 0, the record is - * discarded. We assume the caller wouldn't have bothered with this + * We assume the caller wouldn't have bothered with this * function if it hadn't already decided to keep the record. */ - if (au_close(aufd, 1, event_code) < 0) { + if (au_close(aufd, AU_TO_WRITE, event_code) < 0) { syslog(LOG_ERR, "%s: au_close() failed", func); return (kAUCloseErr); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603050212.k252CSjB007197>