Date: Tue, 8 Aug 2006 10:39:04 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 103433 for review Message-ID: <200608081039.k78Ad4hm075370@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=103433 Change 103433 by rwatson@rwatson_peppercorn on 2006/08/08 10:38:07 Allow NULL event descriptions and class lists. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#12 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#12 (text+ko) ==== @@ -27,7 +27,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_event.c#11 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#12 $ */ #include <bsm/libbsm.h> @@ -62,27 +62,32 @@ evdesc = strtok_r(NULL, eventdelim, &last); evclass = strtok_r(NULL, eventdelim, &last); - if ((evno == NULL) || (evname == NULL) || (evdesc == NULL) || - (evclass == NULL)) + if ((evno == NULL) || (evname == NULL)) return (NULL); if (strlen(evname) >= AU_EVENT_NAME_MAX) return (NULL); strcpy(e->ae_name, evname); - if (strlen(evdesc) >= AU_EVENT_DESC_MAX) - return (NULL); - strcpy(e->ae_desc, evdesc); + if (evdesc != NULL) { + if (strlen(evdesc) >= AU_EVENT_DESC_MAX) + return (NULL); + strcpy(e->ae_desc, evdesc); + } else + strcpy(e->ae_desc, ""); e->ae_number = atoi(evno); /* * Find out the mask that corresponds to the given list of classes. */ - if (getauditflagsbin(evclass, &evmask) != 0) + if (evclass != NULL) { + if (getauditflagsbin(evclass, &evmask) != 0) + e->ae_class = AU_NULL; + else + e->ae_class = evmask.am_success; + } else e->ae_class = AU_NULL; - else - e->ae_class = evmask.am_success; return (e); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608081039.k78Ad4hm075370>