Obtains a user's Security Equals attribute list and places it in the buffer supplied by the caller.
#include <ascauth.h>
int ASC_LISTSEQV(ASCENV *asce, char *user, char *buf, u_int size);
Returns one of the following integer values defined in ascauth.h:
The list is truncated, and the call returns AS_TOOSMALL if the buffer size cannot hold the entire list. You can retry with a larger buffer.
#include <stdio.h>
#include <stdlib.h>
#include <ascauth.h>
main(int argc, char *argv[])
{
ASCENV *asce;
char *object, buffer[2000];
int rc;
if (argc != 2) {
fprintf(stderr, "usage: %s <object>\n", argv[0]);
exit(EXIT_FAILURE);
}
object = argv[1];
/* initialize the authentication environment */
asce = ASC_INIT(NULL);
if (asce == NULL) {
fprintf(stderr, "Error: cannot initialize authentication environment\n");
exit(EXIT_FAILURE);
}
/* Get security equivalence info */
rc = ASC_LISTSEQV(asce, object, buffer, sizeof(buffer));
if (rc == AS_OK)
printf("Security equivalences of object %s:\n%s\n", object, buffer);
else if (rc == AS_TOOSMALL) {
printf("Security equivalences of object %s:\n%s\n", object, buffer);
printf("** list was truncated because of lack of buffer space **\n");
}
else
printf("RC=%d, %s", rc, ASC_STRERROR(rc));
/* now terminate the authentication environment */
ASC_TERM(asce);
return 0;
}