X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/regressions/auth/auth-02-aewp-basic.c diff --git a/SecurityTests/regressions/auth/auth-02-aewp-basic.c b/SecurityTests/regressions/auth/auth-02-aewp-basic.c deleted file mode 100644 index c3c38b9e..00000000 --- a/SecurityTests/regressions/auth/auth-02-aewp-basic.c +++ /dev/null @@ -1,40 +0,0 @@ -/* NO_AUTOMATED_TESTING */ -#include -#include -#include -#include -#include "testmore.h" - -#define EXECUTABLE "/bin/ls" -#define LSTARGET "/private/var/db/shadow" - -/* XXX/gh interactive, so inappropriate for auto-regressions */ -int main(__unused int ac, const char *av[]) -{ - AuthorizationRef authRef = NULL; - char *lsargs[2] = { "-l", LSTARGET }; - FILE *commPipe = NULL; - DIR *dir = NULL; - char lsbuf[6]; /* "total" */ - /* uint32_t total; */ - - plan_tests(5); - - /* make sure LSTARGET isn't readable by mere mortals */ - dir = opendir(LSTARGET); - is(errno, EACCES, "AEWP-basic: opendir()"); - ok_status(AuthorizationCreate(NULL, NULL, kAuthorizationFlagDefaults, &authRef), - "AEWP-basic: AuthCreate()"); - ok(authRef != NULL, "AEWP-basic: NULL authRef"); - ok_status(AuthorizationExecuteWithPrivileges(authRef, - EXECUTABLE, - kAuthorizationFlagDefaults, - lsargs, - &commPipe), - "AEWP-basic: AEWP()"); - - /* stops at first white space */ - is_status(fscanf(commPipe, "%s", lsbuf), 1, "AEWP-basic: fscanf()"); - printf("ls output: %s\n", lsbuf); - return 0; -}