summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-11-20 12:37:37 +0000
committerMike Frysinger <vapier@gentoo.org>2005-11-20 12:37:37 +0000
commitabff45c67de22488b30a6e5ada106042408430e9 (patch)
tree38c33c9bcf9594677c2044aa72cc2720746d428c /sys-apps/sysvinit/files
parentold (diff)
downloadhistorical-abff45c67de22488b30a6e5ada106042408430e9.tar.gz
historical-abff45c67de22488b30a6e5ada106042408430e9.tar.bz2
historical-abff45c67de22488b30a6e5ada106042408430e9.zip
Fix some warnings and add support for POSIX capabilites #5818 by Sascha Silbe.
Package-Manager: portage-2.0.53_rc7
Diffstat (limited to 'sys-apps/sysvinit/files')
-rw-r--r--sys-apps/sysvinit/files/digest-sysvinit-2.86-r32
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.86-POSIX-1003.1e.patch67
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.86-execl.patch11
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.86-utmp-64bit.patch43
4 files changed, 123 insertions, 0 deletions
diff --git a/sys-apps/sysvinit/files/digest-sysvinit-2.86-r3 b/sys-apps/sysvinit/files/digest-sysvinit-2.86-r3
new file mode 100644
index 000000000000..36e59eb1e93b
--- /dev/null
+++ b/sys-apps/sysvinit/files/digest-sysvinit-2.86-r3
@@ -0,0 +1,2 @@
+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.86-POSIX-1003.1e.patch b/sys-apps/sysvinit/files/sysvinit-2.86-POSIX-1003.1e.patch
new file mode 100644
index 000000000000..01864ee59116
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.86-POSIX-1003.1e.patch
@@ -0,0 +1,67 @@
+add support for POSIX capabilites
+
+http://original.killa.net/infosec/caps/
+http://bugs.gentoo.org/5818
+
+--- sysvinit/src/init.c
++++ sysvinit/src/init.c
+@@ -21,6 +21,15 @@
+ */
+
+ #include <sys/types.h>
++
++#ifdef __linux__
++#include <linux/capability.h>
++#include <linux/unistd.h>
++
++_syscall2(int, capget, cap_user_header_t, header, cap_user_data_t, data)
++_syscall2(int, capset, cap_user_header_t, header, const cap_user_data_t, data)
++#endif
++
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+ #include <sys/wait.h>
+@@ -2348,6 +2357,11 @@ int init_main()
+ pid_t rc;
+ int f, st;
+
++#ifdef __linux__
++ cap_user_header_t head;
++ cap_user_data_t data;
++#endif
++
+ if (!reload) {
+
+ #if INITDEBUG
+@@ -2438,6 +2452,31 @@ int init_main()
+ SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART);
+ }
+
++#ifdef __linux__
++ /*
++ * This seems like the right place to do this, just before
++ * we read /etc/inittab...
++ */
++
++ head = malloc(sizeof(head));
++ if ((data = malloc(sizeof(data))) == NULL)
++ free(head);
++
++ if (head && data) {
++ head->pid = 0;
++ head->version = _LINUX_CAPABILITY_VERSION;
++
++ if (capget(head, data) == 0) {
++ /* Max out the inheritable capability set. */
++ data->inheritable = data->effective;
++ capset(head, data);
++ }
++
++ free(head);
++ free(data);
++ }
++#endif
++
+ /*
+ * Start normal boot procedure.
+ */
diff --git a/sys-apps/sysvinit/files/sysvinit-2.86-execl.patch b/sys-apps/sysvinit/files/sysvinit-2.86-execl.patch
new file mode 100644
index 000000000000..051472519be0
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.86-execl.patch
@@ -0,0 +1,11 @@
+--- sysvinit/src/init.c
++++ sysvinit/src/init.c
+@@ -1893,7 +1893,7 @@ void re_exec(void)
+ * The existing init process execs a new init binary.
+ */
+ env = init_buildenv(0);
+- execl(myname, myname, "--init", NULL, env);
++ execle(myname, myname, "--init", NULL, env);
+
+ /*
+ * We shouldn't be here, something failed.
diff --git a/sys-apps/sysvinit/files/sysvinit-2.86-utmp-64bit.patch b/sys-apps/sysvinit/files/sysvinit-2.86-utmp-64bit.patch
new file mode 100644
index 000000000000..26d1161b7936
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.86-utmp-64bit.patch
@@ -0,0 +1,43 @@
+On 64bit arches which have 32bit multilib support, the utmp struct is
+the same ... thus we cannot assume that utmp.ut_tv is of type time_t
+
+--- sysvinit/src/utmp.c
++++ sysvinit/src/utmp.c
+@@ -47,6 +47,7 @@ void write_wtmp
+ int fd;
+ struct utmp utmp;
+ struct utsname uname_buf;
++ struct timeval tv;
+
+ /*
+ * Try to open the wtmp file. Note that we even try
+@@ -76,7 +77,9 @@ void write_wtmp
+ */
+ memset(&utmp, 0, sizeof(utmp));
+ #if defined(__GLIBC__)
+- gettimeofday(&utmp.ut_tv, NULL);
++ gettimeofday(&tv, NULL);
++ utmp.ut_tv.tv_sec = tv.tv_sec;
++ utmp.ut_tv.tv_usec = tv.tv_usec;
+ #else
+ time(&utmp.ut_time);
+ #endif
+@@ -113,6 +116,7 @@ static void write_utmp
+ struct utmp utmp;
+ struct utmp tmp;
+ struct utmp *utmptr;
++ struct timeval tv;
+
+ /*
+ * Can't do much if UTMP_FILE is not present.
+@@ -144,7 +148,9 @@ static void write_utmp
+ utmp.ut_pid = pid;
+ strncpy(utmp.ut_id, id, sizeof(utmp.ut_id));
+ #if defined(__GLIBC__)
+- gettimeofday(&utmp.ut_tv, NULL);
++ gettimeofday(&tv, NULL);
++ utmp.ut_tv.tv_sec = tv.tv_sec;
++ utmp.ut_tv.tv_usec = tv.tv_usec;
+ #else
+ time(&utmp.ut_time);
+ #endif