summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-22 00:04:04 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-22 00:04:04 +0000
commit5fb99b0848b06e304ded0aac6cc36f2918c4f665 (patch)
treeadc7da3959ab7a0df11922e2b3d56dd360d9f865 /sys-apps/sysvinit
parentMark 0.8.1-r1 ~ia64 (diff)
downloadhistorical-5fb99b0848b06e304ded0aac6cc36f2918c4f665.tar.gz
historical-5fb99b0848b06e304ded0aac6cc36f2918c4f665.tar.bz2
historical-5fb99b0848b06e304ded0aac6cc36f2918c4f665.zip
old
Diffstat (limited to 'sys-apps/sysvinit')
-rw-r--r--sys-apps/sysvinit/files/digest-sysvinit-2.85-r11
-rw-r--r--sys-apps/sysvinit/files/digest-sysvinit-2.862
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.85-selinux.patch242
-rw-r--r--sys-apps/sysvinit/sysvinit-2.85-r1.ebuild83
-rw-r--r--sys-apps/sysvinit/sysvinit-2.86.ebuild78
5 files changed, 0 insertions, 406 deletions
diff --git a/sys-apps/sysvinit/files/digest-sysvinit-2.85-r1 b/sys-apps/sysvinit/files/digest-sysvinit-2.85-r1
deleted file mode 100644
index e60573a3c576..000000000000
--- a/sys-apps/sysvinit/files/digest-sysvinit-2.85-r1
+++ /dev/null
@@ -1 +0,0 @@
-MD5 8a2d8f1ed5a2909da04132fefa44905e sysvinit-2.85.tar.gz 92758
diff --git a/sys-apps/sysvinit/files/digest-sysvinit-2.86 b/sys-apps/sysvinit/files/digest-sysvinit-2.86
deleted file mode 100644
index 36e59eb1e93b..000000000000
--- a/sys-apps/sysvinit/files/digest-sysvinit-2.86
+++ /dev/null
@@ -1,2 +0,0 @@
-MD5 7d5d61c026122ab791ac04c8a84db967 sysvinit-2.86.tar.gz 99009
-MD5 650af823f937d386e81520b1741d4d45 sysvinit-2.86-kexec.patch 4139
diff --git a/sys-apps/sysvinit/files/sysvinit-2.85-selinux.patch b/sys-apps/sysvinit/files/sysvinit-2.85-selinux.patch
deleted file mode 100644
index 4ba08b635071..000000000000
--- a/sys-apps/sysvinit/files/sysvinit-2.85-selinux.patch
+++ /dev/null
@@ -1,242 +0,0 @@
---- sysvinit-2.85/src/Makefile.selinux 2004-06-09 15:28:47.439412648 -0400
-+++ sysvinit-2.85/src/Makefile 2004-06-09 15:28:47.517400792 -0400
-@@ -35,7 +35,7 @@
- all: $(PROGS)
-
- init: init.o init_utmp.o
-- $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o
-+ $(CC) $(LDFLAGS) $(STATIC) -o $@ init.o init_utmp.o -lselinux
-
- halt: halt.o ifdown.o hddown.o utmp.o reboot.h
- $(CC) $(LDFLAGS) -o $@ halt.o ifdown.o hddown.o utmp.o
-@@ -53,7 +53,7 @@
- $(CC) $(LDFLAGS) -o $@ runlevel.o
-
- sulogin: sulogin.o
-- $(CC) $(LDFLAGS) $(STATIC) -o $@ sulogin.o $(LCRYPT)
-+ $(CC) $(LDFLAGS) $(STATIC) -DWITH_SELINUX -o $@ sulogin.o $(LCRYPT) -lselinux
-
- wall: dowall.o wall.o
- $(CC) $(LDFLAGS) -o $@ dowall.o wall.o
-@@ -64,7 +64,7 @@
- bootlogd: bootlogd.o
- $(CC) $(LDFLAGS) -o $@ bootlogd.o
-
- init.o: init.c init.h set.h reboot.h
-- $(CC) -c $(CFLAGS) init.c
-+ $(CC) -c $(CFLAGS) -DWITH_SELINUX init.c
-
- utmp.o: utmp.c init.h
- $(CC) -c $(CFLAGS) utmp.c
---- sysvinit-2.85/src/init.c.selinux 2004-06-09 15:28:47.478406720 -0400
-+++ sysvinit-2.85/src/init.c 2004-06-09 15:29:03.208015456 -0400
-@@ -48,6 +48,10 @@
- #include <stdarg.h>
- #include <sys/syslog.h>
- #include <sys/time.h>
-+#include <sys/mman.h>
-+#include <selinux/selinux.h>
-+#include <sys/mount.h>
-+
-
- #ifdef __i386__
- # if (__GLIBC__ >= 2)
-@@ -103,6 +107,7 @@
- int dfl_level = 0; /* Default runlevel */
- sig_atomic_t got_cont = 0; /* Set if we received the SIGCONT signal */
- sig_atomic_t got_signals; /* Set if we received a signal. */
-+int enforcing = -1; /* SELinux enforcing mode */
- int emerg_shell = 0; /* Start emergency shell? */
- int wrote_wtmp_reboot = 1; /* Set when we wrote the reboot record */
- int wrote_utmp_reboot = 1; /* Set when we wrote the reboot record */
-@@ -187,6 +192,130 @@
- {NULL,0}
- };
-
-+/* Mount point for selinuxfs. */
-+#define SELINUXMNT "/selinux/"
-+
-+static int load_policy(int *enforce)
-+{
-+ int fd=-1,ret=-1;
-+ int rc=0;
-+ struct stat sb;
-+ void *map;
-+ char policy_file[PATH_MAX];
-+ int policy_version=0;
-+ extern char *selinux_mnt;
-+ FILE *cfg;
-+ char buf[4096];
-+ int seconfig = -2;
-+
-+ selinux_getenforcemode(&seconfig);
-+
-+ mount("none", "/proc", "proc", 0, 0);
-+ cfg = fopen("/proc/cmdline","r");
-+ if (cfg) {
-+ char *tmp;
-+ if (fgets(buf,4096,cfg) && (tmp = strstr(buf,"enforcing="))) {
-+ if (tmp == buf || isspace(*(tmp-1))) {
-+ enforcing=atoi(tmp+10);
-+ }
-+ }
-+ fclose(cfg);
-+ }
-+#define MNT_DETACH 2
-+ umount2("/proc",MNT_DETACH);
-+
-+ if (enforcing >=0)
-+ *enforce = enforcing;
-+ else if (seconfig == 1)
-+ *enforce = 1;
-+
-+ if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0) {
-+ if (errno == ENODEV) {
-+ log(L_VB, "SELinux not supported by kernel: %s\n",SELINUXMNT,strerror(errno));
-+ *enforce = 0;
-+ } else {
-+ log(L_VB, "Failed to mount %s: %s\n",SELINUXMNT,strerror(errno));
-+ }
-+ return ret;
-+ }
-+
-+ selinux_mnt = SELINUXMNT; /* set manually since we mounted it */
-+
-+ policy_version=security_policyvers();
-+ if (policy_version < 0) {
-+ log(L_VB, "Can't get policy version: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ rc = security_getenforce();
-+ if (rc < 0) {
-+ log(L_VB, "Can't get SELinux enforcement flag: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+ if (enforcing >= 0) {
-+ *enforce = enforcing;
-+ } else if (seconfig == -1) {
-+ *enforce = 0;
-+ rc = security_disable();
-+ if (rc == 0) umount(SELINUXMNT);
-+ if (rc < 0) {
-+ rc = security_setenforce(0);
-+ if (rc < 0) {
-+ log(L_VB, "Can't disable SELinux: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+ }
-+ ret = 0;
-+ goto UMOUNT;
-+ } else if (seconfig >= 0) {
-+ *enforce = seconfig;
-+ rc = security_setenforce(seconfig);
-+ if (rc < 0) {
-+ log(L_VB, "Can't set SELinux enforcement flag: %s\n", strerror(errno));
-+ goto UMOUNT;
-+ }
-+ }
-+
-+ snprintf(policy_file,sizeof(policy_file),"%s.%d",selinux_binary_policy_path(),policy_version);
-+ fd = open(policy_file, O_RDONLY);
-+ if (fd < 0) {
-+ /* Check previous version to see if old policy is available
-+ */
-+ snprintf(policy_file,sizeof(policy_file),"%s.%d",selinux_binary_policy_path(),policy_version-1);
-+ fd = open(policy_file, O_RDONLY);
-+ if (fd < 0) {
-+ log(L_VB, "Can't open '%s.%d': %s\n",
-+ selinux_binary_policy_path(),policy_version,strerror(errno));
-+ goto UMOUNT;
-+ }
-+ }
-+
-+ if (fstat(fd, &sb) < 0) {
-+ log(L_VB, "Can't stat '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+
-+ map = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
-+ if (map == MAP_FAILED) {
-+ log(L_VB, "Can't map '%s': %s\n",
-+ policy_file, strerror(errno));
-+ goto UMOUNT;
-+ }
-+ log(L_VB, "Loading security policy\n");
-+ ret=security_load_policy(map, sb.st_size);
-+ if (ret < 0) {
-+ log(L_VB, "security_load_policy failed\n");
-+ }
-+
-+UMOUNT:
-+ /*umount(SELINUXMNT); */
-+ if ( fd >= 0) {
-+ close(fd);
-+ }
-+ return(ret);
-+}
-+
- /*
- * Sleep a number of seconds.
- *
-@@ -2513,6 +2642,7 @@
- char *p;
- int f;
- int isinit;
-+ int enforce = 0;
-
- /* Get my own name */
- if ((p = strrchr(argv[0], '/')) != NULL)
-@@ -2576,6 +2706,20 @@
- maxproclen += strlen(argv[f]) + 1;
- }
-
-+ if (getenv("SELINUX_INIT") == NULL) {
-+ putenv("SELINUX_INIT=YES");
-+ if (load_policy(&enforce) == 0 ) {
-+ execv(myname, argv);
-+ } else {
-+ if (enforce > 0) {
-+ /* SELinux in enforcing mode but load_policy failed */
-+ /* At this point, we probably can't open /dev/console, so log() won't work */
-+ printf("Enforcing mode requested but no policy loaded. Halting now.\n");
-+ exit(1);
-+ }
-+ }
-+ }
-+
- /* Start booting. */
- argv0 = argv[0];
- argv[1] = NULL;
---- sysvinit-2.85/src/sulogin.c.selinux 2004-06-09 15:28:47.321430584 -0400
-+++ sysvinit-2.85/src/sulogin.c 2004-06-09 15:28:47.523399880 -0400
-@@ -28,7 +28,10 @@
- #if defined(__GLIBC__)
- # include <crypt.h>
- #endif
--
-+#ifdef WITH_SELINUX
-+#include <selinux/selinux.h>
-+#include <selinux/get_context_list.h>
-+#endif
- #define CHECK_DES 1
- #define CHECK_MD5 1
-
-@@ -332,6 +335,16 @@
- signal(SIGINT, SIG_DFL);
- signal(SIGTSTP, SIG_DFL);
- signal(SIGQUIT, SIG_DFL);
-+#ifdef WITH_SELINUX
-+ if (is_selinux_enabled > 0) {
-+ security_context_t* contextlist=NULL;
-+ if (get_ordered_context_list("root", 0, &contextlist) > 0) {
-+ if (setexeccon(contextlist[0]) != 0)
-+ fprintf(stderr, "setexeccon faile\n");
-+ freeconary(contextlist);
-+ }
-+ }
-+#endif
- execl(sushell, shell, NULL);
- perror(sushell);
-
diff --git a/sys-apps/sysvinit/sysvinit-2.85-r1.ebuild b/sys-apps/sysvinit/sysvinit-2.85-r1.ebuild
deleted file mode 100644
index 27fcf1c9be68..000000000000
--- a/sys-apps/sysvinit/sysvinit-2.85-r1.ebuild
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/sysvinit-2.85-r1.ebuild,v 1.8 2004/11/12 14:37:23 vapier Exp $
-
-inherit eutils toolchain-funcs
-
-DESCRIPTION="/sbin/init - parent of all processes"
-HOMEPAGE="http://freshmeat.net/projects/sysvinit/"
-SRC_URI="ftp://ftp.cistron.nl/pub/people/miquels/software/${P}.tar.gz
- ftp://sunsite.unc.edu/pub/Linux/system/daemons/init/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
-IUSE="selinux bootstrap build"
-
-RDEPEND="selinux? ( >=sys-libs/libselinux-1.14 )"
-DEPEND="${RDEPEND}
- virtual/os-headers"
-
-src_unpack() {
- unpack ${A}
- cd ${S}/src || die
-
- # SELinux patch
- use selinux && epatch ${FILESDIR}/sysvinit-${PV}-selinux.patch
-}
-
-src_compile() {
- # Note: The LCRYPT define below overrides the test in
- # sysvinit's Makefile. This is because sulogin must be linked
- # to libcrypt in any case, but when building stage2 in
- # catalyst, /usr/lib/libcrypt.a isn't available. In truth
- # this doesn't change how sulogin is built since ld would use
- # the shared obj by default anyway! The other option is to
- # refrain from building sulogin, but that isn't a good option.
- # (09 Jul 2004 agriffis)
- emake -C ${S}/src CC="$(tc-getCC)" LD="$(tc-getCC)" \
- LDFLAGS="${LDFLAGS}" CFLAGS="${CFLAGS} -D_GNU_SOURCE" \
- LCRYPT="-lcrypt" || die
-}
-
-src_install() {
- cd ${S}/src
- into /
- dosbin init halt killall5 runlevel shutdown sulogin || die "dosbin"
- dosym init /sbin/telinit
- dobin last mesg utmpdump wall || die "dobin"
- dosym killall5 /sbin/pidof
- dosym halt /sbin/reboot
- dosym halt /sbin/poweroff
- dosym last /bin/lastb
- insinto /usr/include
- doins initreq.h
-
- # sysvinit docs
- cd ${S}
- doman man/*.[1-9]
- dodoc README doc/*
-
- # install our inittab
- insinto /etc
- doins ${FILESDIR}/inittab || die
-
- # Add serial console for arches that typically have it
- case ${ARCH} in
- sparc|mips|hppa|alpha|ia64|arm)
- sed -i -e \
- 's"# TERMINALS"# SERIAL CONSOLE\nc0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100\n\n&"' \
- ${D}/etc/inittab || die
- ;;
- esac
-}
-
-pkg_postinst() {
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Do not return an error if this fails
- /sbin/init U &>/dev/null
- fi
-}
diff --git a/sys-apps/sysvinit/sysvinit-2.86.ebuild b/sys-apps/sysvinit/sysvinit-2.86.ebuild
deleted file mode 100644
index f5db14f6cfaa..000000000000
--- a/sys-apps/sysvinit/sysvinit-2.86.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/sysvinit-2.86.ebuild,v 1.13 2005/12/07 04:57:48 vapier Exp $
-
-inherit eutils toolchain-funcs flag-o-matic
-
-DESCRIPTION="/sbin/init - parent of all processes"
-HOMEPAGE="http://freshmeat.net/projects/sysvinit/"
-SRC_URI="ftp://ftp.cistron.nl/pub/people/miquels/software/${P}.tar.gz
- ftp://sunsite.unc.edu/pub/Linux/system/daemons/init/${P}.tar.gz
- http://www.gc-linux.org/down/isobel/kexec/sysvinit/sysvinit-2.86-kexec.patch"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
-IUSE="selinux bootstrap build ibm static"
-
-RDEPEND="selinux? ( >=sys-libs/libselinux-1.18 sys-libs/libsepol )"
-DEPEND="${RDEPEND}
- virtual/os-headers"
-
-src_unpack() {
- unpack ${P}.tar.gz
- cd "${S}"
- epatch "${FILESDIR}"/${P}-docs.patch
- epatch "${FILESDIR}"/${P}-shutdown-usage.patch
- epatch "${DISTDIR}"/sysvinit-2.86-kexec.patch
- cd src
- epatch "${FILESDIR}"/${PV}-gentoo.patch
- use selinux && epatch "${FILESDIR}"/${PV}-selinux.patch
- cp "${FILESDIR}"/inittab "${WORKDIR}"/ || die "cp inittab"
-
- if use ibm ; then
- cat <<-EOF >> "${WORKDIR}"/inittab
- #HVC / HVSI CONSOLE
- #hvc0:12345:respawn:/sbin/agetty -L 9600 hvc0
- #hvsi:12345:respawn:/sbin/agetty -L 19200 hvsi0
- EOF
- fi
-}
-
-src_compile() {
- use static && append-ldflags -static
-
- # Note: The LCRYPT define below overrides the test in
- # sysvinit's Makefile. This is because sulogin must be linked
- # to libcrypt in any case, but when building stage2 in
- # catalyst, /usr/lib/libcrypt.a isn't available. In truth
- # this doesn't change how sulogin is built since ld would use
- # the shared obj by default anyway! The other option is to
- # refrain from building sulogin, but that isn't a good option.
- # (09 Jul 2004 agriffis)
- emake -C src \
- CC="$(tc-getCC)" \
- DISTRO="Gentoo" \
- LCRYPT="-lcrypt" \
- || die
-}
-
-src_install() {
- dodoc README doc/*
-
- cd src
- make install DISTRO="Gentoo" ROOT="${D}" || die "make install"
-
- insinto /etc
- doins "${WORKDIR}"/inittab || die "inittab"
-}
-
-pkg_postinst() {
- # Reload init to fix unmounting problems of / on next reboot.
- # This is really needed, as without the new version of init cause init
- # not to quit properly on reboot, and causes a fsck of / on next reboot.
- if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then
- # Do not return an error if this fails
- /sbin/telinit U &>/dev/null
- fi
-}