Checks to see if a user has security equivalence to the specified object.
#include <ascauth.h>
int ASC_SECEQUAL(ASCENV *asce, char *user, char *object);
Returns one of the following integer values defined in ascauth.h:
#include <stdio.h>
#include <stdlib.h>
#include <ascauth.h>
main(int argc, char *argv[])
{
ASCENV *asce;
char *user, *object;
int rc;
if (argc != 3) {
fprintf(stderr, "usage: %s <user> <object>\n", argv[0]);
exit(EXIT_FAILURE);
}
user = argv[1];
object = argv[2];
/* initialize the authentication environment */
asce = ASC_INIT(NULL);
if (asce == NULL) {
fprintf(stderr, "Error: cannot initialize authentication environment\n");
exit(EXIT_FAILURE);
}
/* check for security equivalence */
rc = ASC_SECEQUAL(asce, user, object);
if (rc == AS_OK)
printf("User has security equivalence\n");
else
printf("RC=%d, %s", rc, ASC_STRERROR(rc));
/* now terminate the authentication environment */
ASC_TERM(asce);
return 0;
}