contrib/openbsm/libbsm/bsm_wrappers.c
/*
 * Same caveats as audit_write().  In addition, this function explicitly
 * assumes failure; use audit_write_success() otherwise.
 *
 * XXX  This should let the caller pass an error return value rather than
 * hard-coding -1.
 */
Same caveats as audit_write().  In addition, this function explicitly
assumes failure; use audit_write_success() otherwise.

XXX  This should let the caller pass an error return value rather than
hard-coding -1.
Same caveats as audit_write () . In addition this function explicitly assumes failure ; use audit_write_success () otherwise . XXX This should let the caller pass an error return value rather than hard - coding - 1 .
int
audit_write_failure(short event_code, char *errmsg, int errcode, au_id_t auid,
    uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid, au_asid_t sid,
    au_tid_t *tid)
{
	char *func = "audit_write_failure()";
	token_t *subject, *errtok;
	subject = au_to_subject32(auid, euid, egid, ruid, rgid, pid, sid, tid);
	if (subject == NULL) {
		syslog(LOG_ERR, "%s: au_to_subject32() failed", func);
		return (kAUMakeSubjectTokErr);
	}
	if ((errtok = au_to_text(errmsg)) == NULL) {
		au_free_token(subject);
		syslog(LOG_ERR, "%s: au_to_text() failed", func);
		return (kAUMakeTextTokErr);
	}
	return (audit_write(event_code, subject, errtok, -1, errcode));
}
int audit_write_failure ( short event_code , char * errmsg , int errcode , au_id_t auid , uid_t euid , gid_t egid , uid_t ruid , gid_t rgid , pid_t pid , au_asid_t sid , au_tid_t * tid ) { char * func = " " ; token_t * subject , * errtok ; subject = au_to_subject32 ( auid , euid , egid , ruid , rgid , pid , sid , tid ) ; if ( subject == NULL ) { syslog ( LOG_ERR , " " , func ) ; return ( kAUMakeSubjectTokErr ) ; } if ( ( errtok = au_to_text ( errmsg ) ) == NULL ) { au_free_token ( subject ) ; syslog ( LOG_ERR , " " , func ) ; return ( kAUMakeTextTokErr ) ; } return ( audit_write ( event_code , subject , errtok , -1 , errcode ) ) ; }
Same caveats as audit_write().
Same caveats as audit_write () .
/* tokenize and save the error message */