Skip to content

Instantly share code, notes, and snippets.

@bboozzoo
Created December 11, 2020 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bboozzoo/840cdbd066ab81ca438fab6b0b75ea1b to your computer and use it in GitHub Desktop.
Save bboozzoo/840cdbd066ab81ca438fab6b0b75ea1b to your computer and use it in GitHub Desktop.
// gcc -lapparmor
#include <sys/apparmor.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char *label, *mode = NULL;
if (aa_getcon(&label, &mode) == -1) {
perror("aa_getcon");
exit(EXIT_FAILURE);
}
printf("label: %s\nmode: %s\n", label, mode);
free(label);
free(mode);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment