From 85dafb9071747e19dc1b21137db99ae2d9c2fc93dc78aa8bab1eef77ed5546e7 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Mon, 17 May 2010 23:03:47 +0000 Subject: [PATCH] Updating link to change in openSUSE:Factory/sysvinit revision 70.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=324fe9ee307975ac55e1a49c96bf3199 --- powerd-2.0.2-getaddrinfo.patch | 67 ++++++++++++++++++++++++++++++++++ sysvinit-2.88dsf-selinux.patch | 35 ++++++++++++++++++ sysvinit-2.88dsf-utf8.dif | 12 ++---- sysvinit.changes | 7 ++++ sysvinit.spec | 8 +++- 5 files changed, 118 insertions(+), 11 deletions(-) create mode 100644 powerd-2.0.2-getaddrinfo.patch create mode 100644 sysvinit-2.88dsf-selinux.patch diff --git a/powerd-2.0.2-getaddrinfo.patch b/powerd-2.0.2-getaddrinfo.patch new file mode 100644 index 0000000..bc8f76e --- /dev/null +++ b/powerd-2.0.2-getaddrinfo.patch @@ -0,0 +1,67 @@ +--- 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 new file mode 100644 index 0000000..1c37664 --- /dev/null +++ b/sysvinit-2.88dsf-selinux.patch @@ -0,0 +1,35 @@ +--- 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 9cc0e94..799f73d 100644 --- a/sysvinit-2.88dsf-utf8.dif +++ b/sysvinit-2.88dsf-utf8.dif @@ -1,6 +1,4 @@ -Index: doc/Changelog -=================================================================== ---- doc/Changelog.orig 2010-04-11 11:30:27.000000000 +0200 +--- doc/Changelog +++ 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. @@ -11,9 +9,7 @@ Index: doc/Changelog * 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 -Index: src/init.c -=================================================================== ---- src/init.c.orig 2010-05-12 13:24:29.000000000 +0200 +--- src/init.c +++ src/init.c 2010-05-12 13:24:44.536090878 +0200 @@ -788,10 +788,11 @@ void console_stty(void) /* @@ -30,9 +26,7 @@ Index: src/init.c tty.c_oflag = OPOST|ONLCR; tty.c_lflag = ISIG|ICANON|ECHO|ECHOCTL|ECHOPRT|ECHOKE; -Index: src/sulogin.c -=================================================================== ---- src/sulogin.c.orig 2010-04-08 11:07:36.000000000 +0200 +--- src/sulogin.c +++ 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 7e09bbd..d9a7e1d 100644 --- a/sysvinit.changes +++ b/sysvinit.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +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 07d4f29..8c06e55 100644 --- a/sysvinit.spec +++ b/sysvinit.spec @@ -29,7 +29,7 @@ License: GPLv2+ Group: System/Base AutoReqProv: on Version: 2.88 -Release: 4 +Release: 5 Summary: SysV-Style init BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: audit-devel libselinux-devel libsepol-devel pam-devel @@ -51,7 +51,9 @@ 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 @@ -91,10 +93,12 @@ sysvinit package. %patch3 -p0 -b .no-kill %patch4 -p0 -b .pam %patch5 -p2 -b .ipv6 -%patch6 -b .utf8 +%patch6 -p0 -b .utf8 +%patch7 -p0 -b .selinux %patch pushd ../powerd-%{PDVER} %patch20 +%patch21 popd pushd ../killproc-%{KPVER} %patch30