1 #include <unistd.h> 2 #include <stdlib.h> 3 #include <stdio.h> 4 #include <getopt.h> 5 #include <errno.h> 6 #include <string.h> 7 #include <selinux/selinux.h> 8 #include "mcstrans.h" 9 usage(const char * progname)10void usage(const char *progname) 11 { 12 fprintf(stderr, "usage: %s context\n", progname); 13 exit(1); 14 } main(int argc,char ** argv)15int main(int argc, char **argv) { 16 security_context_t scon; 17 if ( argc != 2 ) usage(argv[0]); 18 if (init_translations()==0) { 19 if(untrans_context(argv[1],&scon) == 0) { 20 printf("%s\n", scon); 21 freecon(scon); 22 return 0; 23 } 24 } 25 return -1; 26 } 27 28 29