* Fix some minor problems
* init - enable is_selinux_enabled() to detect selinuxfs
This commit is contained in:
parent
2950c304a1
commit
210e6a26a6
@ -18,6 +18,8 @@
|
|||||||
* init - add the possiblity to ignore further interrupts from keyboard
|
* init - add the possiblity to ignore further interrupts from keyboard
|
||||||
* init - add the possiblity to set sane terminal line settings
|
* init - add the possiblity to set sane terminal line settings
|
||||||
* sulogin - add the possibility to reset the terminal io
|
* sulogin - add the possibility to reset the terminal io
|
||||||
|
* Fix some minor problems
|
||||||
|
* init - enable is_selinux_enabled() to detect selinuxfs
|
||||||
|
|
||||||
sysvinit (2.88dsf) UNRELEASED; urgency=low
|
sysvinit (2.88dsf) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
@ -51,7 +51,11 @@ static sigjmp_buf jbuf;
|
|||||||
* Alarm handler
|
* Alarm handler
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
|
# ifdef __GNUC__
|
||||||
|
static void handler(int arg __attribute__((unused)))
|
||||||
|
# else
|
||||||
static void handler(int arg)
|
static void handler(int arg)
|
||||||
|
# endif
|
||||||
{
|
{
|
||||||
siglongjmp(jbuf, 1);
|
siglongjmp(jbuf, 1);
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
#include <selinux/selinux.h>
|
#include <selinux/selinux.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -2839,8 +2840,11 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
if (getenv("SELINUX_INIT") == NULL && !is_selinux_enabled()) {
|
if (getenv("SELINUX_INIT") == NULL) {
|
||||||
|
const int rc = mount("proc", "/proc", "proc", 0, 0);
|
||||||
|
if (is_selinux_enabled() > 0) {
|
||||||
putenv("SELINUX_INIT=YES");
|
putenv("SELINUX_INIT=YES");
|
||||||
|
if (rc == 0) umount2("/proc", MNT_DETACH);
|
||||||
if (selinux_init_load_policy(&enforce) == 0) {
|
if (selinux_init_load_policy(&enforce) == 0) {
|
||||||
execv(myname, argv);
|
execv(myname, argv);
|
||||||
} else {
|
} else {
|
||||||
@ -2852,6 +2856,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rc == 0) umount2("/proc", MNT_DETACH);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Start booting. */
|
/* Start booting. */
|
||||||
argv0 = argv[0];
|
argv0 = argv[0];
|
||||||
|
@ -95,7 +95,12 @@ void hardsleep(int secs)
|
|||||||
/*
|
/*
|
||||||
* Break off an already running shutdown.
|
* Break off an already running shutdown.
|
||||||
*/
|
*/
|
||||||
|
# ifdef __GNUC__
|
||||||
|
void stopit(int sig __attribute__((unused)))
|
||||||
|
# else
|
||||||
void stopit(int sig)
|
void stopit(int sig)
|
||||||
|
# endif
|
||||||
|
|
||||||
{
|
{
|
||||||
unlink(NOLOGIN);
|
unlink(NOLOGIN);
|
||||||
unlink(FASTBOOT);
|
unlink(FASTBOOT);
|
||||||
|
@ -403,7 +403,7 @@ void sushell(struct passwd *pwd)
|
|||||||
signal(SIGTSTP, saved_sigtstp);
|
signal(SIGTSTP, saved_sigtstp);
|
||||||
signal(SIGQUIT, saved_sigquit);
|
signal(SIGQUIT, saved_sigquit);
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
if (is_selinux_enabled > 0) {
|
if (is_selinux_enabled() > 0) {
|
||||||
security_context_t scon=NULL;
|
security_context_t scon=NULL;
|
||||||
char *seuser=NULL;
|
char *seuser=NULL;
|
||||||
char *level=NULL;
|
char *level=NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user