1 /* NO_AUTOMATED_TESTING */
2 #include <Security/Authorization.h>
3 #include <Security/AuthorizationTagsPriv.h>
9 * XXX/gh These should be in AuthorizationTagsPriv.h
11 #ifdef AUTHHOST_TYPE_AGENT
12 #warning AUTHHOST_TYPE_AGENT defined, clean up immediate-agent test
14 #define AUTHHOST_TYPE_AGENT 1 // SecurityAgent
17 #ifdef AUTHHOST_TYPE_PRIVILEGED
18 #warning AUTHHOST_TYPE_PRIVILEGED defined, clean up immediate-agent test
20 #define AUTHHOST_TYPE_PRIVILEGED 2 // authorizationhost
23 int main(__unused
int ac
, const char *av
[])
25 uint32_t hostType
= AUTHHOST_TYPE_AGENT
;
26 AuthorizationItem item
= { AGENT_HINT_IMMEDIATE_LAUNCH
, sizeof(hostType
), &hostType
, 0 };
27 AuthorizationEnvironment hints
= { 1, &item
};
28 const char *hostTypeStr
;
34 case AUTHHOST_TYPE_AGENT
: hostTypeStr
= "SecurityAgent"; break;
35 case AUTHHOST_TYPE_PRIVILEGED
: hostTypeStr
= "authorizationhost"; break;
36 default: hostTypeStr
= "unknown host type"; break;
38 ok_status(AuthorizationCreate(NULL
, &hints
, kAuthorizationFlagDefaults
, NULL
), "force immediate agent launch");