checked in (request 40113)

OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=50
This commit is contained in:
OBS User autobuild 2010-05-17 23:03:46 +00:00 committed by Git OBS Bridge
parent 58cd59d17e
commit 208c6f0f3f
5 changed files with 10 additions and 117 deletions

View File

@ -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);

View File

@ -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 <selinux/selinux.h>
-# include <sys/mount.h>
-# 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. */

View File

@ -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 +++ doc/Changelog 2010-05-12 13:26:34.679992111 +0200
@@ -35,6 +35,8 @@ sysvinit (2.88dsf) world; urgency=low @@ -35,6 +35,8 @@ sysvinit (2.88dsf) world; urgency=low
get binaries with debug information installed. get binaries with debug information installed.
@ -9,7 +11,9 @@
* Add the comment from Andrea Arcangeli about the correct * Add the comment from Andrea Arcangeli about the correct
place of setting the default childhandler within spawn(). place of setting the default childhandler within spawn().
* Make sure that newline is printed out for last(1) even * 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 +++ src/init.c 2010-05-12 13:24:44.536090878 +0200
@@ -788,10 +788,11 @@ void console_stty(void) @@ -788,10 +788,11 @@ void console_stty(void)
/* /*
@ -26,7 +30,9 @@
tty.c_oflag = OPOST|ONLCR; tty.c_oflag = OPOST|ONLCR;
tty.c_lflag = ISIG|ICANON|ECHO|ECHOCTL|ECHOPRT|ECHOKE; 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 +++ src/sulogin.c 2010-05-12 13:24:44.576090860 +0200
@@ -101,9 +101,6 @@ void fixtty(void) @@ -101,9 +101,6 @@ void fixtty(void)
* the same result as `stty sane cr0 pass8' * the same result as `stty sane cr0 pass8'

View File

@ -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 Wed May 12 11:28:31 UTC 2010 - pth@ssue.de

View File

@ -51,9 +51,7 @@ Patch3: sysvinit-2.88dsf-no-kill.patch
Patch4: notify-pam-dead.patch Patch4: notify-pam-dead.patch
Patch5: sysvinit-last-ipv6-heuristic.patch Patch5: sysvinit-last-ipv6-heuristic.patch
Patch6: sysvinit-2.88dsf-utf8.dif Patch6: sysvinit-2.88dsf-utf8.dif
Patch7: sysvinit-2.88dsf-selinux.patch
Patch20: powerd-2.0.2.dif Patch20: powerd-2.0.2.dif
Patch21: powerd-2.0.2-getaddrinfo.patch
Patch30: killproc-2.16.dif Patch30: killproc-2.16.dif
Patch40: showconsole-1.10.dif Patch40: showconsole-1.10.dif
Patch50: startpar-0.54.dif Patch50: startpar-0.54.dif
@ -93,12 +91,10 @@ sysvinit package.
%patch3 -p0 -b .no-kill %patch3 -p0 -b .no-kill
%patch4 -p0 -b .pam %patch4 -p0 -b .pam
%patch5 -p2 -b .ipv6 %patch5 -p2 -b .ipv6
%patch6 -p0 -b .utf8 %patch6 -b .utf8
%patch7 -p0 -b .selinux
%patch %patch
pushd ../powerd-%{PDVER} pushd ../powerd-%{PDVER}
%patch20 %patch20
%patch21
popd popd
pushd ../killproc-%{KPVER} pushd ../killproc-%{KPVER}
%patch30 %patch30