1 |
vapier 08/12/27 06:16:22 |
2 |
|
3 |
Added: busybox-1.13.1-ip.patch busybox-1.13.1-init.patch |
4 |
busybox-1.13.1-crond.patch |
5 |
busybox-1.13.1-printf.patch |
6 |
busybox-1.13.1-bindtodevice.patch |
7 |
Log: |
8 |
Version bump. |
9 |
(Portage version: 2.2_rc18/cvs/Linux 2.6.28 x86_64) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 sys-apps/busybox/files/busybox-1.13.1-ip.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-ip.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-ip.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: busybox-1.13.1-ip.patch |
18 |
=================================================================== |
19 |
--- busybox-1.13.1/networking/ip.c Sun Nov 9 18:27:59 2008 |
20 |
+++ busybox-1.13.1-ip/networking/ip.c Thu Dec 4 13:16:29 2008 |
21 |
@@ -31,7 +31,7 @@ |
22 |
|
23 |
static int ip_do(int (*ip_func)(char **argv), char **argv) |
24 |
{ |
25 |
- argv = ip_parse_common_args(argv); |
26 |
+ argv = ip_parse_common_args(argv + 1); |
27 |
return ip_func(argv); |
28 |
} |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
1.1 sys-apps/busybox/files/busybox-1.13.1-init.patch |
34 |
|
35 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-init.patch?rev=1.1&view=markup |
36 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-init.patch?rev=1.1&content-type=text/plain |
37 |
|
38 |
Index: busybox-1.13.1-init.patch |
39 |
=================================================================== |
40 |
--- busybox-1.13.1/init/init.c Sat Nov 29 07:48:56 2008 |
41 |
+++ busybox-1.13.1-init/init/init.c Tue Dec 9 22:17:43 2008 |
42 |
@@ -118,18 +118,18 @@ |
43 |
|
44 |
msg[0] = '\r'; |
45 |
va_start(arguments, fmt); |
46 |
- l = vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments); |
47 |
- if (l > sizeof(msg) - 2) |
48 |
- l = sizeof(msg) - 2; |
49 |
+ l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments); |
50 |
+ if (l > sizeof(msg) - 1) |
51 |
+ l = sizeof(msg) - 1; |
52 |
msg[l] = '\0'; |
53 |
va_end(arguments); |
54 |
|
55 |
if (ENABLE_FEATURE_INIT_SYSLOG) { |
56 |
- /* Log the message to syslogd */ |
57 |
if (where & L_LOG) { |
58 |
- /* don't print out "\r" */ |
59 |
- openlog(applet_name, 0, LOG_DAEMON); |
60 |
- syslog(LOG_INFO, "init: %s", msg + 1); |
61 |
+ /* Log the message to syslogd */ |
62 |
+ openlog("init", 0, LOG_DAEMON); |
63 |
+ /* don't print "\r" */ |
64 |
+ syslog(LOG_INFO, "%s", msg + 1); |
65 |
closelog(); |
66 |
} |
67 |
msg[l++] = '\n'; |
68 |
|
69 |
|
70 |
|
71 |
1.1 sys-apps/busybox/files/busybox-1.13.1-crond.patch |
72 |
|
73 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-crond.patch?rev=1.1&view=markup |
74 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-crond.patch?rev=1.1&content-type=text/plain |
75 |
|
76 |
Index: busybox-1.13.1-crond.patch |
77 |
=================================================================== |
78 |
--- busybox-1.13.1/miscutils/crond.c Sun Nov 9 18:28:17 2008 |
79 |
+++ busybox-1.13.1-crond/miscutils/crond.c Thu Dec 4 14:56:10 2008 |
80 |
@@ -779,6 +779,8 @@ |
81 |
xmove_fd(mailFd, mail_filename ? 1 : 0); |
82 |
dup2(1, 2); |
83 |
} |
84 |
+ /* crond 3.0pl1-100 puts tasks in separate process groups */ |
85 |
+ bb_setpgrp(); |
86 |
execlp(prog, prog, cmd, arg, NULL); |
87 |
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg); |
88 |
if (mail_filename) { |
89 |
@@ -914,6 +916,8 @@ |
90 |
if (DebugOpt) { |
91 |
crondlog(LVL5 "child running %s", DEFAULT_SHELL); |
92 |
} |
93 |
+ /* crond 3.0pl1-100 puts tasks in separate process groups */ |
94 |
+ bb_setpgrp(); |
95 |
execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL); |
96 |
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, |
97 |
DEFAULT_SHELL, "-c", line->cl_Shell); |
98 |
|
99 |
|
100 |
|
101 |
1.1 sys-apps/busybox/files/busybox-1.13.1-printf.patch |
102 |
|
103 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-printf.patch?rev=1.1&view=markup |
104 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-printf.patch?rev=1.1&content-type=text/plain |
105 |
|
106 |
Index: busybox-1.13.1-printf.patch |
107 |
=================================================================== |
108 |
--- busybox-1.13.1/coreutils/printf.c Sun Nov 9 18:28:07 2008 |
109 |
+++ busybox-1.13.1-printf/coreutils/printf.c Wed Dec 10 12:50:55 2008 |
110 |
@@ -359,8 +359,15 @@ |
111 |
* We will mimic coreutils. */ |
112 |
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2]) |
113 |
argv++; |
114 |
- if (!argv[1]) |
115 |
+ if (!argv[1]) { |
116 |
+ if (ENABLE_ASH_BUILTIN_PRINTF |
117 |
+ && applet_name[0] != 'p' |
118 |
+ ) { |
119 |
+ bb_error_msg("usage: printf FORMAT [ARGUMENT...]"); |
120 |
+ return 2; /* bash compat */ |
121 |
+ } |
122 |
bb_show_usage(); |
123 |
+ } |
124 |
|
125 |
format = argv[1]; |
126 |
argv2 = argv + 2; |
127 |
|
128 |
|
129 |
|
130 |
1.1 sys-apps/busybox/files/busybox-1.13.1-bindtodevice.patch |
131 |
|
132 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-bindtodevice.patch?rev=1.1&view=markup |
133 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/busybox/files/busybox-1.13.1-bindtodevice.patch?rev=1.1&content-type=text/plain |
134 |
|
135 |
Index: busybox-1.13.1-bindtodevice.patch |
136 |
=================================================================== |
137 |
--- busybox-1.13.1/include/libbb.h Sun Nov 9 18:28:17 2008 |
138 |
+++ busybox-1.13.1-bindtodevice/include/libbb.h Wed Dec 10 12:10:30 2008 |
139 |
@@ -437,6 +437,7 @@ |
140 |
* Turn it on before you call bind(). */ |
141 |
void setsockopt_reuseaddr(int fd) FAST_FUNC; /* On Linux this never fails. */ |
142 |
int setsockopt_broadcast(int fd) FAST_FUNC; |
143 |
+int setsockopt_bindtodevice(int fd, const char *iface) FAST_FUNC; |
144 |
/* NB: returns port in host byte order */ |
145 |
unsigned bb_lookup_port(const char *port, const char *protocol, unsigned default_port) FAST_FUNC; |
146 |
typedef struct len_and_sockaddr { |
147 |
--- busybox-1.13.1/libbb/xconnect.c Sun Nov 9 18:28:09 2008 |
148 |
+++ busybox-1.13.1-bindtodevice/libbb/xconnect.c Wed Dec 10 23:20:29 2008 |
149 |
@@ -7,6 +7,7 @@ |
150 |
*/ |
151 |
|
152 |
#include <netinet/in.h> |
153 |
+#include <net/if.h> |
154 |
#include "libbb.h" |
155 |
|
156 |
void FAST_FUNC setsockopt_reuseaddr(int fd) |
157 |
@@ -17,6 +18,20 @@ |
158 |
{ |
159 |
return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &const_int_1, sizeof(const_int_1)); |
160 |
} |
161 |
+int FAST_FUNC setsockopt_bindtodevice(int fd, const char *iface) |
162 |
+{ |
163 |
+ int r; |
164 |
+ struct ifreq ifr; |
165 |
+ strncpy(ifr.ifr_name, iface, IFNAMSIZ); |
166 |
+ /* Actually, ifr_name is at offset 0, and in practice |
167 |
+ * just giving char[IFNAMSIZ] instead of struct ifreq works too. |
168 |
+ * But just in case it's not true on some obscure arch... */ |
169 |
+ r = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)); |
170 |
+ if (r) |
171 |
+ bb_perror_msg("can't bind to interface %s", iface); |
172 |
+ return r; |
173 |
+} |
174 |
+ |
175 |
|
176 |
void FAST_FUNC xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) |
177 |
{ |
178 |
--- busybox-1.13.1/networking/arping.c Sun Nov 9 18:27:59 2008 |
179 |
+++ busybox-1.13.1-bindtodevice/networking/arping.c Wed Dec 10 12:10:30 2008 |
180 |
@@ -322,8 +322,7 @@ |
181 |
struct sockaddr_in saddr; |
182 |
int probe_fd = xsocket(AF_INET, SOCK_DGRAM, 0); |
183 |
|
184 |
- if (setsockopt(probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device) + 1) == -1) |
185 |
- bb_perror_msg("cannot bind to device %s", device); |
186 |
+ setsockopt_bindtodevice(probe_fd, device); |
187 |
memset(&saddr, 0, sizeof(saddr)); |
188 |
saddr.sin_family = AF_INET; |
189 |
if (src.s_addr) { |
190 |
--- busybox-1.13.1/networking/ping.c Sun Nov 9 18:27:59 2008 |
191 |
+++ busybox-1.13.1-bindtodevice/networking/ping.c Wed Dec 10 12:10:30 2008 |
192 |
@@ -572,7 +572,7 @@ |
193 |
xbind(pingsock, &source_lsa->u.sa, source_lsa->len); |
194 |
} |
195 |
if (str_I) |
196 |
- setsockopt(pingsock, SOL_SOCKET, SO_BINDTODEVICE, str_I, strlen(str_I) + 1); |
197 |
+ setsockopt_bindtodevice(pingsock, str_I); |
198 |
|
199 |
/* enable broadcast pings */ |
200 |
setsockopt_broadcast(pingsock); |
201 |
@@ -622,7 +622,7 @@ |
202 |
if (source_lsa) |
203 |
xbind(pingsock, &source_lsa->u.sa, source_lsa->len); |
204 |
if (str_I) |
205 |
- setsockopt(pingsock, SOL_SOCKET, SO_BINDTODEVICE, str_I, strlen(str_I) + 1); |
206 |
+ setsockopt_bindtodevice(pingsock, str_I); |
207 |
|
208 |
#ifdef ICMP6_FILTER |
209 |
{ |
210 |
--- busybox-1.13.1/networking/udhcp/socket.c Sun Nov 9 18:27:58 2008 |
211 |
+++ busybox-1.13.1-bindtodevice/networking/udhcp/socket.c Wed Dec 10 12:10:30 2008 |
212 |
@@ -98,8 +98,8 @@ |
213 |
bb_perror_msg_and_die("SO_BROADCAST"); |
214 |
|
215 |
/* NB: bug 1032 says this doesn't work on ethernet aliases (ethN:M) */ |
216 |
- if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &inf, strlen(inf) + 1) == -1) |
217 |
- bb_perror_msg_and_die("SO_BINDTODEVICE"); |
218 |
+ if (setsockopt_bindtodevice(fd, inf)) |
219 |
+ xfunc_die(); /* warning is already printed */ |
220 |
|
221 |
memset(&addr, 0, sizeof(addr)); |
222 |
addr.sin_family = AF_INET; |