FreeBSD/contrib/openbsm/libbsm/bsm_class.c
/*
 * Parse a single line from the audit_class file passed in str to the struct
 * au_class_ent elements; store the result in c.
 */
Parse a single line from the audit_class file passed in str to the struct
au_class_ent elements; store the result in c.
Parse a single line from the audit_class file passed in str to the struct au_class_ent elements ; store the result in c .
static struct au_class_ent *
classfromstr(char *str, struct au_class_ent *c)
{
	char *classname, *classdesc, *classflag;
	char *last;
	classflag = strtok_r(str, classdelim, &last);
	classname = strtok_r(NULL, classdelim, &last);
	classdesc = strtok_r(NULL, classdelim, &last);
	if ((classflag == NULL) || (classname == NULL) || (classdesc == NULL))
		return (NULL);
	if (strlen(classname) >= AU_CLASS_NAME_MAX)
		return (NULL);
	strlcpy(c->ac_name, classname, AU_CLASS_NAME_MAX);
	if (strlen(classdesc) >= AU_CLASS_DESC_MAX)
		return (NULL);
	strlcpy(c->ac_desc, classdesc, AU_CLASS_DESC_MAX);
	c->ac_class = strtoul(classflag, (char **) NULL, 0);
	return (c);
}
static struct au_class_ent * classfromstr ( char * str , struct au_class_ent * c ) { char * classname , * classdesc , * classflag ; char * last ; classflag = strtok_r ( str , classdelim , & last ) ; classname = strtok_r ( NULL , classdelim , & last ) ; classdesc = strtok_r ( NULL , classdelim , & last ) ; if ( ( classflag == NULL ) || ( classname == NULL ) || ( classdesc == NULL ) ) return ( NULL ) ; if ( strlen ( classname ) >= AU_CLASS_NAME_MAX ) return ( NULL ) ; strlcpy ( c -> ac_name , classname , AU_CLASS_NAME_MAX ) ; if ( strlen ( classdesc ) >= AU_CLASS_DESC_MAX ) return ( NULL ) ; strlcpy ( c -> ac_desc , classdesc , AU_CLASS_DESC_MAX ) ; c -> ac_class = strtoul ( classflag , ( char * * ) NULL , 0 ) ; return ( c ) ; }
Parse a single line from the audit_class file passed in str to the struct
 au_class_ent elements; store the result in c.
Parse a single line from the audit_class file passed in str to the struct au_class_ent elements ; store the result in c .
/* Each line contains flag:name:desc. */ /*
	 * Check for very large classnames.
	 */ /*
	 * Check for very large class description.
	 */