From 208c6f0f3f2be6db491754881f70111514d292ef1273213b5aed96d57f4e0d1d Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 17 May 2010 23:03:46 +0000 Subject: [PATCH] checked in (request 40113) OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=50 --- powerd-2.0.2-getaddrinfo.patch | 67 ---------------------------------- sysvinit-2.88dsf-selinux.patch | 35 ------------------ sysvinit-2.88dsf-utf8.dif | 12 ++++-- sysvinit.changes | 7 ---- sysvinit.spec | 6 +-- 5 files changed, 10 insertions(+), 117 deletions(-) delete mode 100644 powerd-2.0.2-getaddrinfo.patch delete mode 100644 sysvinit-2.88dsf-selinux.patch diff --git a/powerd-2.0.2-getaddrinfo.patch b/powerd-2.0.2-getaddrinfo.patch deleted file mode 100644 index bc8f76e..0000000 --- a/powerd-2.0.2-getaddrinfo.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- powerd.c -+++ powerd.c 2010-05-12 16:12:45.167591612 +0200 -@@ -625,7 +625,8 @@ void openconfig(int *delay) { - int line=0; - char *host, *port; - int iport; -- struct hostent *hname; -+ struct addrinfo *hname; -+ struct addrinfo *hiter; - struct in_addr addr; - - // printf("Opening config\n"); -@@ -664,6 +665,8 @@ void openconfig(int *delay) { - device = strdup(parameter); - // printf("Monitoring %s\n", device); - } else if (!strcasecmp(command, "notify")) { -+ int ret; -+ - if (strlen(password) < 5) { - fprintf(stderr, "Password is too short/invalid. Line %d\n", line); - exit(-1); -@@ -674,27 +677,32 @@ void openconfig(int *delay) { - else - iport = PORT; - -- if ((hname = gethostbyname(host))) { -- while(*hname->h_addr_list != 0) { -+ if (!(ret = getaddrinfo(host, NULL, NULL, &hname))) { -+ for(hiter = hname; hiter != NULL; hiter = hiter->ai_next) { - memset(&addr.s_addr, 0, sizeof(addr.s_addr)); -- memcpy(&addr.s_addr, *hname->h_addr_list, hname->h_length); -+ memcpy(&addr.s_addr, hiter->ai_addr, hiter->ai_addrlen); - addclient(inet_ntoa(addr), password, iport); -- hname->h_addr_list++; - } -+ freeaddrinfo(hname); - } -- } -+ else -+ fprintf(stderr, "getaddrinfo : %s\n", gai_strerror(ret)); -+ } - } else if (!strcasecmp(command, "listen")) { -+ int ret; - if (strlen(password) < 5) { - fprintf(stderr, "Password is too short/invalid. Line %d\n", line); - exit(-1); -- } else if ((hname = gethostbyname(parameter))) { -- while(*hname->h_addr_list != 0) { -- memset(&addr.s_addr, 0, sizeof(addr.s_addr)); -- memcpy(&addr.s_addr, *hname->h_addr_list, hname->h_length); -- addlisten(inet_ntoa(addr), password); -- hname->h_addr_list++; -- } -- } -+ } else if (! (ret = getaddrinfo(parameter, NULL, NULL, &hname))) { -+ for(hiter = hname; hiter != NULL; hiter = hiter->ai_next) { -+ memset(&addr.s_addr, 0, sizeof(addr.s_addr)); -+ memcpy(&addr.s_addr, hiter->ai_addr, hiter->ai_addrlen); -+ addlisten(inet_ntoa(addr), password); -+ } -+ freeaddrinfo(hname); -+ } -+ else -+ fprintf(stderr, "getaddrinfo : %s\n", gai_strerror(ret)); - } else if (!strcasecmp(command, "listenport")) { - if ((listenport = atoi(parameter)) < 1) { - fprintf(stderr, "Listen port is invalid. Line %d\n", line); diff --git a/sysvinit-2.88dsf-selinux.patch b/sysvinit-2.88dsf-selinux.patch deleted file mode 100644 index 1c37664..0000000 --- a/sysvinit-2.88dsf-selinux.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- src/init.c -+++ src/init.c 2010-05-17 09:32:29.958932802 +0000 -@@ -54,10 +54,6 @@ - - #ifdef WITH_SELINUX - # include --# include --# ifndef MNT_DETACH /* present in glibc 2.10, missing in 2.7 */ --# define MNT_DETACH 2 --# endif - #endif - - #ifdef __i386__ -@@ -2886,11 +2882,9 @@ int main(int argc, char **argv) - - #ifdef WITH_SELINUX - if (getenv("SELINUX_INIT") == NULL) { -- const int rc = mount("proc", "/proc", "proc", 0, 0); -- if (is_selinux_enabled() > 0) { -- putenv("SELINUX_INIT=YES"); -- if (rc == 0) umount2("/proc", MNT_DETACH); -+ if (is_selinux_enabled() != 1) { - if (selinux_init_load_policy(&enforce) == 0) { -+ putenv("SELINUX_INIT=YES"); - execv(myname, argv); - } else { - if (enforce > 0) { -@@ -2901,7 +2895,6 @@ int main(int argc, char **argv) - } - } - } -- if (rc == 0) umount2("/proc", MNT_DETACH); - } - #endif - /* Start booting. */ diff --git a/sysvinit-2.88dsf-utf8.dif b/sysvinit-2.88dsf-utf8.dif index 799f73d..9cc0e94 100644 --- a/sysvinit-2.88dsf-utf8.dif +++ b/sysvinit-2.88dsf-utf8.dif @@ -1,4 +1,6 @@ ---- doc/Changelog +Index: doc/Changelog +=================================================================== +--- doc/Changelog.orig 2010-04-11 11:30:27.000000000 +0200 +++ doc/Changelog 2010-05-12 13:26:34.679992111 +0200 @@ -35,6 +35,8 @@ sysvinit (2.88dsf) world; urgency=low get binaries with debug information installed. @@ -9,7 +11,9 @@ * Add the comment from Andrea Arcangeli about the correct place of setting the default childhandler within spawn(). * Make sure that newline is printed out for last(1) even ---- src/init.c +Index: src/init.c +=================================================================== +--- src/init.c.orig 2010-05-12 13:24:29.000000000 +0200 +++ src/init.c 2010-05-12 13:24:44.536090878 +0200 @@ -788,10 +788,11 @@ void console_stty(void) /* @@ -26,7 +30,9 @@ tty.c_oflag = OPOST|ONLCR; tty.c_lflag = ISIG|ICANON|ECHO|ECHOCTL|ECHOPRT|ECHOKE; ---- src/sulogin.c +Index: src/sulogin.c +=================================================================== +--- src/sulogin.c.orig 2010-04-08 11:07:36.000000000 +0200 +++ src/sulogin.c 2010-05-12 13:24:44.576090860 +0200 @@ -101,9 +101,6 @@ void fixtty(void) * the same result as `stty sane cr0 pass8' diff --git a/sysvinit.changes b/sysvinit.changes index d9a7e1d..7e09bbd 100644 --- a/sysvinit.changes +++ b/sysvinit.changes @@ -1,10 +1,3 @@ -------------------------------------------------------------------- -Mon May 17 11:34:05 CEST 2010 - werner@suse.de - -- Add patch from Thomas for moving powerd from using gethostbyname() - to getaddrinfo() -- Add upstream patch for correct using SELinux API - ------------------------------------------------------------------- Wed May 12 11:28:31 UTC 2010 - pth@ssue.de diff --git a/sysvinit.spec b/sysvinit.spec index d9378ff..07d4f29 100644 --- a/sysvinit.spec +++ b/sysvinit.spec @@ -51,9 +51,7 @@ Patch3: sysvinit-2.88dsf-no-kill.patch Patch4: notify-pam-dead.patch Patch5: sysvinit-last-ipv6-heuristic.patch Patch6: sysvinit-2.88dsf-utf8.dif -Patch7: sysvinit-2.88dsf-selinux.patch Patch20: powerd-2.0.2.dif -Patch21: powerd-2.0.2-getaddrinfo.patch Patch30: killproc-2.16.dif Patch40: showconsole-1.10.dif Patch50: startpar-0.54.dif @@ -93,12 +91,10 @@ sysvinit package. %patch3 -p0 -b .no-kill %patch4 -p0 -b .pam %patch5 -p2 -b .ipv6 -%patch6 -p0 -b .utf8 -%patch7 -p0 -b .selinux +%patch6 -b .utf8 %patch pushd ../powerd-%{PDVER} %patch20 -%patch21 popd pushd ../killproc-%{KPVER} %patch30