PERFORCE change 90812 for review
Robert Watson
rwatson at FreeBSD.org
Tue Jan 31 09:56:05 PST 2006
http://perforce.freebsd.org/chv.cgi?CH=90812
Change 90812 by rwatson at 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;
More information about the p4-projects
mailing list