]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/regressions/auth/auth-SessionCreate-01-basic.c
1 /* NO_AUTOMATED_TESTING */
4 #include <stdlib.h> /* getenv(3) */
5 #include <Security/AuthSession.h>
8 #define SSID_ENV_STR "SECURITYSESSIONID" /* hard-coded in Authorization.cpp */
11 * Not automated because SessionCreate() implicitly invokes task_for_pid(),
12 * which in turn can trigger an Authorization call (and thus UI) via
15 int main(__unused
int ac
, __unused
const char *av
[])
21 if ((ssid
= getenv(SSID_ENV_STR
)) != NULL
)
22 printf("Current SecuritySessionID: %s\n", ssid
);
24 * @@@ SessionCreate() is documented to return "noErr" on success, but
25 * errSessionSuccess is part of the SessionStatus enum
27 is(SessionCreate(0/*SessionCreationFlags*/,
28 sessionHasGraphicAccess
|sessionHasTTY
/*SessionAttributeFlags*/),
29 errSessionSuccess
, "SessionCreate()");
30 if ((ssid
= getenv(SSID_ENV_STR
)) == NULL
)
31 fprintf(stderr
, "Missing %s in environment!\n", SSID_ENV_STR
);
32 printf("New SecuritySessionID: %s\n", ssid
);