Skip to content

Instantly share code, notes, and snippets.

@czenzel
Created September 30, 2017 19:36
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 czenzel/4107e56e7649a68c7b69bcae813fa2f8 to your computer and use it in GitHub Desktop.
Save czenzel/4107e56e7649a68c7b69bcae813fa2f8 to your computer and use it in GitHub Desktop.
DisableSELinux from Debian-NoRoot
/*
Code from the Debian NoRoot Project
https://github.com/pelya/debian-noroot/blob/master/disableselinux/disableselinux.c
*/
#include <errno.h>
extern int audit_open (void);
int audit_open (void)
{
errno = EPROTONOSUPPORT;
return -1;
}
extern int is_selinux_enabled (void);
int is_selinux_enabled (void)
{
return 0;
}
extern int setexecfilecon (const char *filename, const char *fallback_type);
int setexecfilecon (const char *filename, const char *fallback_type)
{
return 0;
}
extern int setexeccon(const char * con);
int setexeccon(const char * con)
{
return 0;
}
extern int setfilecon(const char *path, const char * con);
int setfilecon(const char *path, const char * con)
{
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment