Changeset View
Changeset View
Standalone View
Standalone View
head/tests/sys/audit/file-attribute-modify.c
Show First 20 Lines • Show All 695 Lines • ▼ Show 20 Lines | |||||
ATF_TC_HEAD(chflagsat_success, tc) | ATF_TC_HEAD(chflagsat_success, tc) | ||||
{ | { | ||||
atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " | atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " | ||||
"chflagsat(2) call"); | "chflagsat(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(chflagsat_success, tc) | ATF_TC_BODY(chflagsat_success, tc) | ||||
{ | { | ||||
/* BSM conversion requested for unknown event 43209 */ | |||||
atf_tc_expect_fail("PR 228374: chflagsat(2) does not get audited in success mode"); | |||||
/* File needs to exist to call chflagsat(2) */ | /* File needs to exist to call chflagsat(2) */ | ||||
ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); | ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); | ||||
FILE *pipefd = setup(fds, auclass); | FILE *pipefd = setup(fds, auclass); | ||||
ATF_REQUIRE_EQ(0, chflagsat(AT_FDCWD, path, SF_IMMUTABLE, 0)); | ATF_REQUIRE_EQ(0, chflagsat(AT_FDCWD, path, SF_IMMUTABLE, 0)); | ||||
check_audit(fds, successreg, pipefd); | check_audit(fds, successreg, pipefd); | ||||
close(filedesc); | close(filedesc); | ||||
} | } | ||||
ATF_TC_CLEANUP(chflagsat_success, tc) | ATF_TC_CLEANUP(chflagsat_success, tc) | ||||
{ | { | ||||
cleanup(); | cleanup(); | ||||
} | } | ||||
ATF_TC_WITH_CLEANUP(chflagsat_failure); | ATF_TC_WITH_CLEANUP(chflagsat_failure); | ||||
ATF_TC_HEAD(chflagsat_failure, tc) | ATF_TC_HEAD(chflagsat_failure, tc) | ||||
{ | { | ||||
atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " | atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " | ||||
"chflagsat(2) call"); | "chflagsat(2) call"); | ||||
} | } | ||||
ATF_TC_BODY(chflagsat_failure, tc) | ATF_TC_BODY(chflagsat_failure, tc) | ||||
{ | { | ||||
/* BSM conversion requested for unknown event 43209 */ | |||||
atf_tc_expect_fail("PR 228374: chflagsat(2) does not get audited in failure mode"); | |||||
FILE *pipefd = setup(fds, auclass); | FILE *pipefd = setup(fds, auclass); | ||||
/* Failure reason: file does not exist */ | /* Failure reason: file does not exist */ | ||||
ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, SF_IMMUTABLE, 0)); | ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, SF_IMMUTABLE, 0)); | ||||
check_audit(fds, failurereg, pipefd); | check_audit(fds, failurereg, pipefd); | ||||
} | } | ||||
ATF_TC_CLEANUP(chflagsat_failure, tc) | ATF_TC_CLEANUP(chflagsat_failure, tc) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 647 Lines • Show Last 20 Lines |