Lines Matching full:if
73 if (sa->aad.iface.target) { in audit_cb()
78 if (sa->aad.iface.pos) in audit_cb()
84 * @new: profile if it has been allocated (MAYBE NULL)
108 /* test if read will be in packed data bounds */
125 if (!inbounds(e, sizeof(u16))) in unpack_u16_chunk()
129 if (!inbounds(e, size)) in unpack_u16_chunk()
139 if (!inbounds(e, 1)) in unpack_X()
141 if (*(u8 *) e->pos != code) in unpack_X()
154 * name @name. If @name is specified then there must be a matching
155 * name element in the stream. If @name is NULL any name element will be
161 * Returns: 0 if either match fails, the read head does not move
166 * May need to reset pos if name or type doesn't match in unpack_nameX()
170 * Check for presence of a tagname, and if present name size in unpack_nameX()
173 if (unpack_X(e, AA_NAME)) { in unpack_nameX()
176 /* if a name is specified it must match. otherwise skip tag */ in unpack_nameX()
177 if (name && (!size || strcmp(name, tag))) in unpack_nameX()
179 } else if (name) { in unpack_nameX()
180 /* if a name is specified and there is no name tag fail */ in unpack_nameX()
184 /* now check if type code matches */ in unpack_nameX()
185 if (unpack_X(e, code)) in unpack_nameX()
195 if (unpack_nameX(e, AA_U32, name)) { in unpack_u32()
196 if (!inbounds(e, sizeof(u32))) in unpack_u32()
198 if (data) in unpack_u32()
208 if (unpack_nameX(e, AA_U64, name)) { in unpack_u64()
209 if (!inbounds(e, sizeof(u64))) in unpack_u64()
211 if (data) in unpack_u64()
221 if (unpack_nameX(e, AA_ARRAY, name)) { in unpack_array()
223 if (!inbounds(e, sizeof(u16))) in unpack_array()
234 if (unpack_nameX(e, AA_BLOB, name)) { in unpack_blob()
236 if (!inbounds(e, sizeof(u32))) in unpack_blob()
240 if (inbounds(e, (size_t) size)) { in unpack_blob()
255 if (unpack_nameX(e, AA_STRING, name)) { in unpack_str()
257 if (size) { in unpack_str()
259 if (src_str[size - 1] != 0) in unpack_str()
278 if (!res) in unpack_strdup()
282 if (!*string) { in unpack_strdup()
295 * Returns: 1 if valid accept tables else 0 if error
305 if (mode & ~DFA_VALID_PERM_MASK) in verify_accept()
308 if (ACCEPT_TABLE2(dfa)[i] & ~DFA_VALID_PERM2_MASK) in verify_accept()
318 * returns dfa or ERR_PTR or NULL if no dfa
327 if (size) { in unpack_dfa()
338 if (aa_g_paranoid_load) in unpack_dfa()
343 if (IS_ERR(dfa)) in unpack_dfa()
346 if (!verify_accept(dfa, flags)) in unpack_dfa()
362 * Returns: 1 if table successfully unpacked
369 if (unpack_nameX(e, AA_STRUCT, "xtable")) { in unpack_trans_table()
374 if (size > 16 - 4) in unpack_trans_table()
378 if (!profile->file.trans.table) in unpack_trans_table()
388 if (!size2) in unpack_trans_table()
392 if (isspace(*str)) in unpack_trans_table()
397 if (!str[j]) in unpack_trans_table()
400 if (*str == ':') { in unpack_trans_table()
405 if (c != 1) in unpack_trans_table()
408 if (!str[1]) in unpack_trans_table()
410 } else if (c) in unpack_trans_table()
414 if (!unpack_nameX(e, AA_ARRAYEND, NULL)) in unpack_trans_table()
416 if (!unpack_nameX(e, AA_STRUCTEND, NULL)) in unpack_trans_table()
432 if (unpack_nameX(e, AA_STRUCT, "rlimits")) { in unpack_rlimits()
435 if (!unpack_u32(e, &tmp, NULL)) in unpack_rlimits()
440 if (size > RLIM_NLIMITS) in unpack_rlimits()
445 if (!unpack_u64(e, &tmp2, NULL)) in unpack_rlimits()
449 if (!unpack_nameX(e, AA_ARRAYEND, NULL)) in unpack_rlimits()
451 if (!unpack_nameX(e, AA_STRUCTEND, NULL)) in unpack_rlimits()
465 * NOTE: unpack profile sets audit struct if there is a failure
476 if (!unpack_nameX(e, AA_STRUCT, "profile")) in unpack_profile()
478 if (!unpack_str(e, &name, NULL)) in unpack_profile()
482 if (!profile) in unpack_profile()
490 if (IS_ERR(profile->xmatch)) { in unpack_profile()
495 /* xmatch_len is not optional if xmatch is set */ in unpack_profile()
496 if (profile->xmatch) { in unpack_profile()
497 if (!unpack_u32(e, &tmp, NULL)) in unpack_profile()
503 if (!unpack_nameX(e, AA_STRUCT, "flags")) in unpack_profile()
505 if (!unpack_u32(e, &tmp, NULL)) in unpack_profile()
507 if (tmp) in unpack_profile()
509 if (!unpack_u32(e, &tmp, NULL)) in unpack_profile()
511 if (tmp) in unpack_profile()
513 if (!unpack_u32(e, &tmp, NULL)) in unpack_profile()
515 if (tmp) in unpack_profile()
518 if (!unpack_nameX(e, AA_STRUCTEND, NULL)) in unpack_profile()
522 if (unpack_u32(e, &profile->path_flags, "path_flags")) in unpack_profile()
525 /* set a default value if path_flags field is not present */ in unpack_profile()
528 if (!unpack_u32(e, &(profile->caps.allow.cap[0]), NULL)) in unpack_profile()
530 if (!unpack_u32(e, &(profile->caps.audit.cap[0]), NULL)) in unpack_profile()
532 if (!unpack_u32(e, &(profile->caps.quiet.cap[0]), NULL)) in unpack_profile()
534 if (!unpack_u32(e, &tmpcap.cap[0], NULL)) in unpack_profile()
537 if (unpack_nameX(e, AA_STRUCT, "caps64")) { in unpack_profile()
539 if (!unpack_u32(e, &(profile->caps.allow.cap[1]), NULL)) in unpack_profile()
541 if (!unpack_u32(e, &(profile->caps.audit.cap[1]), NULL)) in unpack_profile()
543 if (!unpack_u32(e, &(profile->caps.quiet.cap[1]), NULL)) in unpack_profile()
545 if (!unpack_u32(e, &(tmpcap.cap[1]), NULL)) in unpack_profile()
547 if (!unpack_nameX(e, AA_STRUCTEND, NULL)) in unpack_profile()
551 if (unpack_nameX(e, AA_STRUCT, "capsx")) { in unpack_profile()
553 if (!unpack_u32(e, &(profile->caps.extended.cap[0]), NULL)) in unpack_profile()
555 if (!unpack_u32(e, &(profile->caps.extended.cap[1]), NULL)) in unpack_profile()
559 if (!unpack_rlimits(e, profile)) in unpack_profile()
564 if (IS_ERR(profile->file.dfa)) { in unpack_profile()
570 if (!unpack_u32(e, &profile->file.start, "dfa_start")) in unpack_profile()
574 if (!unpack_trans_table(e, profile)) in unpack_profile()
577 if (!unpack_nameX(e, AA_STRUCTEND, NULL)) in unpack_profile()
583 if (profile) in unpack_profile()
585 else if (!name) in unpack_profile()
596 * @ns: Returns - namespace if one is specified else NULL (NOT NULL)
598 * Returns: error or 0 if header is good
604 if (!unpack_u32(e, &e->version, "version")) { in verify_header()
610 if (e->version != 5) { in verify_header()
616 /* read the namespace if present */ in verify_header()
617 if (!unpack_str(e, ns, "namespace")) in verify_header()
628 if (xtype == AA_X_TABLE && index > table_size) in verify_xindex()
638 if (!verify_xindex(dfa_user_xindex(dfa, i), table_size)) in verify_dfa_xindex()
640 if (!verify_xindex(dfa_other_xindex(dfa, i), table_size)) in verify_dfa_xindex()
650 * Returns: 0 if passes verification else error
654 if (aa_g_paranoid_load) { in verify_profile()
655 if (profile->file.dfa && in verify_profile()
671 * @ns: Returns namespace profile is in if specified else NULL (NOT NULL)
675 * Returns: profile else error pointer if fails to unpack
688 if (error) in aa_unpack()
692 if (IS_ERR(profile)) in aa_unpack()
696 if (error) { in aa_unpack()