Date: Tue, 31 Jan 2006 17:56:03 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 90812 for review Message-ID: <200601311756.k0VHu3Su060614@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90812 Change 90812 by rwatson@rwatson_zoo on 2006/01/31 17:55:49 Restructure audit_class parsing to match other bsm database parsers. Remove inconsistent white space. Remove undesirable comment. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#11 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#13 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#11 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#11 (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_class.c#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#11 $ */ #include <bsm/libbsm.h> @@ -104,19 +104,21 @@ while (1) { if (fgets(linestr, AU_LINE_MAX, fp) == NULL) return (NULL); - if (linestr[0] != '#') - break; - } - /* Remove trailing new line character. */ - if ((nl = strrchr(linestr, '\n')) != NULL) - *nl = '\0'; + /* Skip comments. */ + if (linestr[0] == '#') + continue; - tokptr = linestr; + /* Remove trailing new line character. */ + if ((nl = strrchr(linestr, '\n')) != NULL) + *nl = '\0'; - /* Parse tokptr to au_class_ent components. */ - if (classfromstr(tokptr, c) == NULL) - return (NULL); + /* Parse tokptr to au_class_ent components. */ + tokptr = linestr; + if (classfromstr(tokptr, c) == NULL) + return (NULL); + break; + } return (c); } ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#13 (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_control.c#12 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_control.c#13 $ */ #include <bsm/libbsm.h> @@ -78,7 +78,6 @@ if (linestr[0] == '#') continue; - /* Remove trailing new line character. */ if ((nl = strrchr(linestr, '\n')) != NULL) *nl = '\0'; ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#11 (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#10 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_event.c#11 $ */ #include <bsm/libbsm.h> @@ -145,13 +145,7 @@ if (linestr[0] == '#') continue; - /* - * Get the next event structure. - * - * XXXRW: Perhaps we should keep reading lines until we find - * a valid one, rather than stopping when we hit an invalid - * one? - */ + /* Get the next event structure. */ if (eventfromstr(linestr, e) == NULL) return (NULL); break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601311756.k0VHu3Su060614>