49fa036b9d
The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/libsemanage#83ed0d4737094f7f23111cd1b02c44bc44a25b8b
33 lines
673 B
C
33 lines
673 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
#include <semanage/semanage.h>
|
|
|
|
#include "functions.c"
|
|
|
|
int main (int argc, char **argv) {
|
|
semanage_handle_t *sh;
|
|
semanage_seuser_t *seuser;
|
|
|
|
if (argc < 4)
|
|
exit(2);
|
|
|
|
sh = get_handle(argv[1]);
|
|
|
|
seuser = test_get_seuser(sh, argv[2]);
|
|
|
|
const char *name = semanage_seuser_get_name(seuser);
|
|
printf("semanage_seuser_get_name(%p): %s\n",
|
|
(void *) seuser, name);
|
|
|
|
if (strcmp_null(argv[3], name) != 0) {
|
|
fprintf(stderr, "Expected %s but got %s\n", argv[2], name);
|
|
exit(1);
|
|
}
|
|
|
|
destroy_handle(sh, argv[1]);
|
|
|
|
exit(0);
|
|
}
|