SVN-Revision: 5941master
parent
c8fea8d380
commit
a64b16df64
@ -1,22 +0,0 @@ |
||||
Index: busybox-CURRENT/networking/wget.c
|
||||
===================================================================
|
||||
--- busybox-CURRENT/networking/wget.c (revision 15806)
|
||||
+++ busybox-CURRENT/networking/wget.c (working copy)
|
||||
@@ -133,7 +133,7 @@
|
||||
#define WGET_OPT_PREFIX 32
|
||||
#define WGET_OPT_PROXY 64
|
||||
|
||||
-#if ENABLE_WGET_LONG_OPTIONS
|
||||
+#if CONFIG_FEATURE_WGET_LONG_OPTIONS
|
||||
static const struct option wget_long_options[] = {
|
||||
{ "continue", 0, NULL, 'c' },
|
||||
{ "quiet", 0, NULL, 'q' },
|
||||
@@ -177,7 +177,7 @@
|
||||
* Crack command line.
|
||||
*/
|
||||
bb_opt_complementally = "-1:\203::";
|
||||
-#if ENABLE_WGET_LONG_OPTIONS
|
||||
+#if CONFIG_FEATURE_WGET_LONG_OPTIONS
|
||||
bb_applet_long_options = wget_long_options;
|
||||
#endif
|
||||
opt = bb_getopt_ulflags(argc, argv, "cq\213O:\203:P:Y:",
|
@ -1,85 +0,0 @@ |
||||
diff -ruN busybox-1.2.0-old/include/applets.h busybox-1.2.0-new/include/applets.h
|
||||
--- busybox-1.2.0-old/include/applets.h 2006-07-01 00:42:10.000000000 +0200
|
||||
+++ busybox-1.2.0-new/include/applets.h 2006-07-31 00:29:34.000000000 +0200
|
||||
@@ -157,6 +157,7 @@
|
||||
USE_IPTUNNEL(APPLET(iptunnel, _BB_DIR_BIN, _BB_SUID_NEVER))
|
||||
USE_KILL(APPLET(kill, _BB_DIR_BIN, _BB_SUID_NEVER))
|
||||
USE_KILLALL(APPLET_ODDNAME(killall, kill, _BB_DIR_USR_BIN, _BB_SUID_NEVER, killall))
|
||||
+USE_KILLALL5(APPLET_ODDNAME(killall5, kill, _BB_DIR_USR_BIN, _BB_SUID_NEVER, killall5))
|
||||
USE_KLOGD(APPLET(klogd, _BB_DIR_SBIN, _BB_SUID_NEVER))
|
||||
USE_LASH(APPLET(lash, _BB_DIR_BIN, _BB_SUID_NEVER))
|
||||
USE_LAST(APPLET(last, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
|
||||
diff -ruN busybox-1.2.0-old/include/usage.h busybox-1.2.0-new/include/usage.h
|
||||
--- busybox-1.2.0-old/include/usage.h 2006-07-01 00:42:10.000000000 +0200
|
||||
+++ busybox-1.2.0-new/include/usage.h 2006-07-31 00:25:57.000000000 +0200
|
||||
@@ -1503,6 +1503,13 @@
|
||||
#define killall_example_usage \
|
||||
"$ killall apache\n"
|
||||
|
||||
+#define killall5_trivial_usage \
|
||||
+ ""
|
||||
+#define killall5_full_usage \
|
||||
+ ""
|
||||
+#define killall5_example_usage \
|
||||
+ ""
|
||||
+
|
||||
#define klogd_trivial_usage \
|
||||
"[-c n] [-n]"
|
||||
#define klogd_full_usage \
|
||||
diff -ruN busybox-1.2.0-old/procps/Config.in busybox-1.2.0-new/procps/Config.in
|
||||
--- busybox-1.2.0-old/procps/Config.in 2006-07-01 00:42:12.000000000 +0200
|
||||
+++ busybox-1.2.0-new/procps/Config.in 2006-07-31 00:25:57.000000000 +0200
|
||||
@@ -38,6 +38,11 @@
|
||||
specified commands. If no signal name is specified, SIGTERM is
|
||||
sent.
|
||||
|
||||
+config CONFIG_KILLALL5
|
||||
+ bool "killall5"
|
||||
+ default n
|
||||
+ depends on CONFIG_KILL
|
||||
+
|
||||
config CONFIG_PIDOF
|
||||
bool "pidof"
|
||||
default n
|
||||
diff -ruN busybox-1.2.0-old/procps/kill.c busybox-1.2.0-new/procps/kill.c
|
||||
--- busybox-1.2.0-old/procps/kill.c 2006-07-01 00:42:12.000000000 +0200
|
||||
+++ busybox-1.2.0-new/procps/kill.c 2006-07-31 00:25:57.000000000 +0200
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#define KILL 0
|
||||
#define KILLALL 1
|
||||
+#define KILLALL5 2
|
||||
|
||||
int kill_main(int argc, char **argv)
|
||||
{
|
||||
@@ -34,6 +35,9 @@
|
||||
#else
|
||||
whichApp = KILL;
|
||||
#endif
|
||||
+#ifdef CONFIG_KILLALL5
|
||||
+ whichApp = (strcmp(bb_applet_name, "killall5") == 0)? KILLALL5 : whichApp;
|
||||
+#endif
|
||||
|
||||
/* Parse any options */
|
||||
if (argc < 2)
|
||||
@@ -112,6 +116,20 @@
|
||||
}
|
||||
|
||||
}
|
||||
+#ifdef CONFIG_KILLALL5
|
||||
+ else if (whichApp == KILLALL5) {
|
||||
+ procps_status_t * p;
|
||||
+ pid_t myPid=getpid();
|
||||
+ while ((p = procps_scan(0)) != 0) {
|
||||
+ if (p->pid != 1 && p->pid != myPid && p->pid != p->ppid) {
|
||||
+ if (kill(p->pid, signo) != 0) {
|
||||
+ bb_perror_msg( "Could not kill pid '%d'", p->pid);
|
||||
+ errors++;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
#ifdef CONFIG_KILLALL
|
||||
else {
|
||||
pid_t myPid=getpid();
|
@ -0,0 +1,12 @@ |
||||
--- busybox-1.3.1-old/include/libbb.h 2006-12-27 05:56:18.000000000 +0100
|
||||
+++ busybox-1.3.1/include/libbb.h 2006-12-28 07:08:09.000000000 +0100
|
||||
@@ -51,9 +51,7 @@
|
||||
|
||||
#include "pwd_.h"
|
||||
#include "grp_.h"
|
||||
-#if ENABLE_FEATURE_SHADOWPASSWDS
|
||||
#include "shadow_.h"
|
||||
-#endif
|
||||
|
||||
/* Try to pull in PATH_MAX */
|
||||
#include <limits.h>
|
@ -1,51 +0,0 @@ |
||||
diff -ruN busybox-1.2.0-old/networking/telnetd.c busybox-1.2.0-new/networking/telnetd.c
|
||||
--- busybox-1.2.0-old/networking/telnetd.c 2006-07-01 00:42:02.000000000 +0200
|
||||
+++ busybox-1.2.0-new/networking/telnetd.c 2006-07-31 10:52:30.000000000 +0200
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <arpa/telnet.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/syslog.h>
|
||||
+#include <net/if.h>
|
||||
|
||||
#include "busybox.h"
|
||||
|
||||
@@ -391,11 +392,13 @@
|
||||
struct in_addr bind_addr = { .s_addr = 0x0 };
|
||||
#endif /* CONFIG_FEATURE_TELNETD_INETD */
|
||||
int c;
|
||||
+ char *interface_name = NULL;
|
||||
+ struct ifreq interface;
|
||||
static const char options[] =
|
||||
#ifdef CONFIG_FEATURE_TELNETD_INETD
|
||||
- "f:l:";
|
||||
+ "i:f:l:";
|
||||
#else /* CONFIG_EATURE_TELNETD_INETD */
|
||||
- "f:l:p:b:";
|
||||
+ "i:f:l:p:b:";
|
||||
#endif /* CONFIG_FEATURE_TELNETD_INETD */
|
||||
int maxlen, w, r;
|
||||
|
||||
@@ -410,6 +413,9 @@
|
||||
case 'f':
|
||||
issuefile = optarg;
|
||||
break;
|
||||
+ case 'i':
|
||||
+ interface_name = strdup(optarg);
|
||||
+ break;
|
||||
case 'l':
|
||||
loginpath = optarg;
|
||||
break;
|
||||
@@ -459,6 +465,13 @@
|
||||
sa.sin_addr = bind_addr;
|
||||
#endif
|
||||
|
||||
+ /* Set it to listen on the specified interface */
|
||||
+ if (interface_name) {
|
||||
+ strncpy(interface.ifr_ifrn.ifrn_name, interface_name, IFNAMSIZ);
|
||||
+ (void)setsockopt(master_fd, SOL_SOCKET,
|
||||
+ SO_BINDTODEVICE, &interface, sizeof(interface));
|
||||
+ }
|
||||
+
|
||||
bb_xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
|
||||
bb_xlisten(master_fd, 1);
|
||||
bb_xdaemon(0, 0);
|
@ -0,0 +1,24 @@ |
||||
--- busybox-1.3.1/networking/ping.c 2006-12-27 05:52:39.000000000 +0100
|
||||
+++ busybox-1.3.1-new/networking/ping.c 2006-12-29 18:42:36.000000000 +0100
|
||||
@@ -217,7 +217,8 @@
|
||||
pkt->icmp_type = ICMP_ECHO;
|
||||
pkt->icmp_code = 0;
|
||||
pkt->icmp_cksum = 0;
|
||||
- pkt->icmp_seq = htons(ntransmitted++);
|
||||
+ pkt->icmp_seq = htons(ntransmitted);
|
||||
+ ntransmitted++;
|
||||
pkt->icmp_id = myid;
|
||||
CLR(ntohs(pkt->icmp_seq) % MAX_DUP_CHK);
|
||||
|
||||
--- busybox-1.3.1/networking/ping6.c 2006-12-27 05:52:39.000000000 +0100
|
||||
+++ busybox-1.3.1-new/networking/ping6.c 2006-12-29 18:44:02.000000000 +0100
|
||||
@@ -205,7 +205,8 @@
|
||||
pkt->icmp6_type = ICMP6_ECHO_REQUEST;
|
||||
pkt->icmp6_code = 0;
|
||||
pkt->icmp6_cksum = 0;
|
||||
- pkt->icmp6_seq = htons(ntransmitted++);
|
||||
+ pkt->icmp6_seq = htons(ntransmitted);
|
||||
+ ntransmitted++;
|
||||
pkt->icmp6_id = myid;
|
||||
CLR(pkt->icmp6_seq % MAX_DUP_CHK);
|
||||
|
@ -1,32 +0,0 @@ |
||||
--- busybox-1.00.old/loginutils/passwd.c 2004-09-15 04:39:09.000000000 +0200
|
||||
+++ busybox-1.00/loginutils/passwd.c 2005-03-23 15:31:07.000000000 +0100
|
||||
@@ -54,11 +54,12 @@
|
||||
snprintf(filename, sizeof filename, "%s", bb_path_passwd_file);
|
||||
}
|
||||
|
||||
- if (((fp = fopen(filename, "r+")) == 0) || (fstat(fileno(fp), &sb))) {
|
||||
+ if (((fp = fopen(filename, "r")) == 0) || (fstat(fileno(fp), &sb))) {
|
||||
/* return 0; */
|
||||
return 1;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
/* Lock the password file before updating */
|
||||
lock.l_type = F_WRLCK;
|
||||
lock.l_whence = SEEK_SET;
|
||||
@@ -69,6 +70,7 @@
|
||||
return 1;
|
||||
}
|
||||
lock.l_type = F_UNLCK;
|
||||
+#endif
|
||||
|
||||
snprintf(buf, sizeof buf, "%s-", filename);
|
||||
if (create_backup(buf, fp)) {
|
||||
@@ -119,6 +121,7 @@
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
+ unlink(filename);
|
||||
if (rename(buf, filename) < 0) {
|
||||
fcntl(fileno(fp), F_SETLK, &lock);
|
||||
fclose(fp);
|
@ -1,90 +0,0 @@ |
||||
diff -ruN busybox-1.2.0-old/include/usage.h busybox-1.2.0-new/include/usage.h
|
||||
--- busybox-1.2.0-old/include/usage.h 2006-07-31 10:47:56.000000000 +0200
|
||||
+++ busybox-1.2.0-new/include/usage.h 2006-07-31 11:08:49.000000000 +0200
|
||||
@@ -3190,6 +3190,7 @@
|
||||
"\t-n,\t--now\tExit with failure if lease cannot be immediately negotiated\n" \
|
||||
"\t-p,\t--pidfile=file\tStore process ID of daemon in file\n" \
|
||||
"\t-q,\t--quit\tQuit after obtaining lease\n" \
|
||||
+ "\t-R,\t--release\tRelease IP on quit\n" \
|
||||
"\t-r,\t--request=IP\tIP address to request (default: none)\n" \
|
||||
"\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
|
||||
"\t-t,\t--retries=NUM\tSend up to NUM request packets\n"\
|
||||
diff -ruN busybox-1.2.0-old/networking/udhcp/dhcpc.c busybox-1.2.0-new/networking/udhcp/dhcpc.c
|
||||
--- busybox-1.2.0-old/networking/udhcp/dhcpc.c 2006-07-01 00:42:02.000000000 +0200
|
||||
+++ busybox-1.2.0-new/networking/udhcp/dhcpc.c 2006-07-31 11:08:49.000000000 +0200
|
||||
@@ -47,6 +47,7 @@
|
||||
.abort_if_no_lease = 0,
|
||||
.foreground = 0,
|
||||
.quit_after_lease = 0,
|
||||
+ .release_on_quit = 0,
|
||||
.background_if_no_lease = 0,
|
||||
.interface = "eth0",
|
||||
.pidfile = NULL,
|
||||
@@ -163,6 +164,7 @@
|
||||
{"now", no_argument, 0, 'n'},
|
||||
{"pidfile", required_argument, 0, 'p'},
|
||||
{"quit", no_argument, 0, 'q'},
|
||||
+ {"release", no_argument, 0, 'R'},
|
||||
{"request", required_argument, 0, 'r'},
|
||||
{"script", required_argument, 0, 's'},
|
||||
{"timeout", required_argument, 0, 'T'},
|
||||
@@ -174,7 +176,7 @@
|
||||
/* get options */
|
||||
while (1) {
|
||||
int option_index = 0;
|
||||
- c = getopt_long(argc, argv, "c:CV:fbH:h:F:i:np:qr:s:T:t:v", arg_options, &option_index);
|
||||
+ c = getopt_long(argc, argv, "c:CV:fbH:h:F:i:np:qRr:s:T:t:v", arg_options, &option_index);
|
||||
if (c == -1) break;
|
||||
|
||||
switch (c) {
|
||||
@@ -244,6 +246,9 @@
|
||||
case 'q':
|
||||
client_config.quit_after_lease = 1;
|
||||
break;
|
||||
+ case 'R':
|
||||
+ client_config.release_on_quit = 1;
|
||||
+ break;
|
||||
case 'r':
|
||||
requested_ip = inet_addr(optarg);
|
||||
break;
|
||||
@@ -488,8 +493,11 @@
|
||||
|
||||
state = BOUND;
|
||||
change_mode(LISTEN_NONE);
|
||||
- if (client_config.quit_after_lease)
|
||||
+ if (client_config.quit_after_lease) {
|
||||
+ if (client_config.release_on_quit)
|
||||
+ perform_release();
|
||||
return 0;
|
||||
+ }
|
||||
if (!client_config.foreground)
|
||||
client_background();
|
||||
|
||||
@@ -514,12 +522,13 @@
|
||||
case SIGUSR1:
|
||||
perform_renew();
|
||||
break;
|
||||
- case SIGUSR2:
|
||||
- perform_release();
|
||||
- break;
|
||||
case SIGTERM:
|
||||
LOG(LOG_INFO, "Received SIGTERM");
|
||||
+ if (!client_config.release_on_quit)
|
||||
return 0;
|
||||
+ case SIGUSR2:
|
||||
+ perform_release();
|
||||
+ break;
|
||||
}
|
||||
} else if (retval == -1 && errno == EINTR) {
|
||||
/* a signal was caught */
|
||||
diff -ruN busybox-1.2.0-old/networking/udhcp/dhcpc.h busybox-1.2.0-new/networking/udhcp/dhcpc.h
|
||||
--- busybox-1.2.0-old/networking/udhcp/dhcpc.h 2006-07-01 00:42:02.000000000 +0200
|
||||
+++ busybox-1.2.0-new/networking/udhcp/dhcpc.h 2006-07-31 11:08:49.000000000 +0200
|
||||
@@ -18,6 +18,7 @@
|
||||
struct client_config_t {
|
||||
char foreground; /* Do not fork */
|
||||
char quit_after_lease; /* Quit after obtaining lease */
|
||||
+ char release_on_quit; /* perform release on quit */
|
||||
char abort_if_no_lease; /* Abort if no lease */
|
||||
char background_if_no_lease; /* Fork to background if no lease */
|
||||
char *interface; /* The name of the interface to use */
|
@ -1,15 +0,0 @@ |
||||
diff -Nur busybox-1.00.orig/networking/udhcp/options.c busybox-1.00/networking/udhcp/options.c
|
||||
--- busybox-1.00.orig/networking/udhcp/options.c 2004-03-15 09:29:01.000000000 +0100
|
||||
+++ busybox-1.00/networking/udhcp/options.c 2005-09-14 13:27:23.792609800 +0200
|
||||
@@ -39,8 +39,11 @@
|
||||
{"dhcptype", OPTION_U8, 0x35},
|
||||
{"serverid", OPTION_IP, 0x36},
|
||||
{"message", OPTION_STRING, 0x38},
|
||||
+ {"vendorclass", OPTION_STRING, 0x3C},
|
||||
+ {"clientid", OPTION_STRING, 0x3D},
|
||||
{"tftp", OPTION_STRING, 0x42},
|
||||
{"bootfile", OPTION_STRING, 0x43},
|
||||
+ {"userclass", OPTION_STRING, 0x4D},
|
||||
{"", 0x00, 0x00}
|
||||
};
|
||||
|
@ -1,12 +0,0 @@ |
||||
diff -urN busybox.old/networking/telnetd.c busybox.dev/networking/telnetd.c
|
||||
--- busybox.old/networking/telnetd.c 2005-08-17 03:29:10.000000000 +0200
|
||||
+++ busybox.dev/networking/telnetd.c 2005-10-22 19:37:49.976396000 +0200
|
||||
@@ -49,6 +49,8 @@
|
||||
|
||||
#define BUFSIZE 4000
|
||||
|
||||
+#undef CONFIG_FEATURE_IPV6
|
||||
+
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
#define SOCKET_TYPE AF_INET6
|
||||
typedef struct sockaddr_in6 sockaddr_type;
|
@ -1,80 +0,0 @@ |
||||
|
||||
Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
diff -urN busybox.old/shell/ash.c busybox.dev/shell/ash.c
|
||||
--- busybox.old/shell/ash.c 2005-11-12 22:39:19.853826250 +0100
|
||||
+++ busybox.dev/shell/ash.c 2005-11-12 22:39:42.771258500 +0100
|
||||
@@ -1414,6 +1414,13 @@
|
||||
|
||||
#define NUMBUILTINS (sizeof (builtincmd) / sizeof (struct builtincmd) )
|
||||
|
||||
+static const char *safe_applets[] = {
|
||||
+ "[", "test", "echo", "cat",
|
||||
+ "ln", "cp", "touch", "mkdir", "rm",
|
||||
+ "cut", "hexdump", "awk", "sort",
|
||||
+ "find", "xargs", "ls", "dd",
|
||||
+ "chown", "chmod"
|
||||
+};
|
||||
|
||||
|
||||
struct cmdentry {
|
||||
@@ -2050,6 +2057,19 @@
|
||||
static void exitshell(void) __attribute__((__noreturn__));
|
||||
static int decode_signal(const char *, int);
|
||||
|
||||
+
|
||||
+static int is_safe_applet(char *name)
|
||||
+{
|
||||
+ int n = sizeof(safe_applets) / sizeof(char *);
|
||||
+ int i;
|
||||
+ for (i = 0; i < n; i++)
|
||||
+ if (strcmp(safe_applets[i], name) == 0)
|
||||
+ return 1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/*
|
||||
* This routine is called when an error or an interrupt occurs in an
|
||||
* interactive shell and control is returned to the main command loop.
|
||||
@@ -3680,6 +3700,7 @@
|
||||
clearredir(1);
|
||||
envp = environment();
|
||||
if (strchr(argv[0], '/') != NULL
|
||||
+ || is_safe_applet(argv[0])
|
||||
#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
|| find_applet_by_name(argv[0])
|
||||
#endif
|
||||
@@ -3721,6 +3742,18 @@
|
||||
tryexec(char *cmd, char **argv, char **envp)
|
||||
{
|
||||
int repeated = 0;
|
||||
+ struct BB_applet *a;
|
||||
+ int argc = 0;
|
||||
+ char **c;
|
||||
+
|
||||
+ if(strchr(cmd, '/') == NULL && is_safe_applet(cmd) && (a = find_applet_by_name(cmd)) != NULL) {
|
||||
+ c = argv;
|
||||
+ while (*c != NULL) {
|
||||
+ c++; argc++;
|
||||
+ }
|
||||
+ bb_applet_name = cmd;
|
||||
+ exit(a->main(argc, argv));
|
||||
+ }
|
||||
#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
|
||||
int flg_bb = 0;
|
||||
char *name = cmd;
|
||||
@@ -3919,6 +3952,12 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
+ if (is_safe_applet(name)) {
|
||||
+ entry->cmdtype = CMDNORMAL;
|
||||
+ entry->u.index = -1;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
updatetbl = (path == pathval());
|
||||
if (!updatetbl) {
|
||||
act |= DO_ALTPATH;
|
@ -1,15 +0,0 @@ |
||||
|
||||
Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
diff -urN busybox.old/loginutils/passwd.c busybox.dev/loginutils/passwd.c
|
||||
--- busybox.old/loginutils/passwd.c 2005-12-11 22:52:46.185150000 +0100
|
||||
+++ busybox.dev/loginutils/passwd.c 2005-12-11 23:19:15.276596500 +0100
|
||||
@@ -353,7 +353,7 @@
|
||||
} else {
|
||||
orig[0] = '\0';
|
||||
}
|
||||
- if (! (cp=bb_askpass(0, "Enter the new password (minimum of 5, maximum of 8 characters)\n"
|
||||
+ if (! (cp=bb_askpass(0, "Enter the new password (minimum of 5 characters)\n"
|
||||
"Please use a combination of upper and lower case letters and numbers.\n"
|
||||
"Enter new password: ")))
|
||||
{
|
@ -1,64 +0,0 @@ |
||||
|
||||
Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
--- busybox-1.00/editors/awk.c.orig 2004-09-24 05:24:27 -04:00
|
||||
+++ busybox-1.00/editors/awk.c 2006-03-08 02:16:52 -05:00
|
||||
@@ -271,7 +271,8 @@
|
||||
/* builtins */
|
||||
enum {
|
||||
B_a2=0, B_ix, B_ma, B_sp, B_ss, B_ti, B_lo, B_up,
|
||||
- B_ge, B_gs, B_su
|
||||
+ B_ge, B_gs, B_su,
|
||||
+ B_an, B_co, B_ls, B_or, B_rs, B_xo,
|
||||
};
|
||||
|
||||
/* tokens and their corresponding info values */
|
||||
@@ -311,6 +312,8 @@
|
||||
"\5while" NTC
|
||||
"\4else" NTC
|
||||
|
||||
+ "\3and" "\5compl" "\6lshift" "\2or"
|
||||
+ "\6rshift" "\3xor"
|
||||
"\5close" "\6system" "\6fflush" "\5atan2" /* BUILTIN */
|
||||
"\3cos" "\3exp" "\3int" "\3log"
|
||||
"\4rand" "\3sin" "\4sqrt" "\5srand"
|
||||
@@ -364,6 +367,8 @@
|
||||
ST_WHILE,
|
||||
0,
|
||||
|
||||
+ OC_B|B_an|P(0x83), OC_B|B_co|P(0x41), OC_B|B_ls|P(0x83), OC_B|B_or|P(0x83),
|
||||
+ OC_B|B_rs|P(0x83), OC_B|B_xo|P(0x83),
|
||||
OC_FBLTIN|Sx|F_cl, OC_FBLTIN|Sx|F_sy, OC_FBLTIN|Sx|F_ff, OC_B|B_a2|P(0x83),
|
||||
OC_FBLTIN|Nx|F_co, OC_FBLTIN|Nx|F_ex, OC_FBLTIN|Nx|F_in, OC_FBLTIN|Nx|F_lg,
|
||||
OC_FBLTIN|F_rn, OC_FBLTIN|Nx|F_si, OC_FBLTIN|Nx|F_sq, OC_FBLTIN|Nx|F_sr,
|
||||
@@ -1942,6 +1947,30 @@
|
||||
strncpy(s, as[0]+i, n);
|
||||
s[n] = '\0';
|
||||
setvar_p(res, s);
|
||||
+ break;
|
||||
+
|
||||
+ case B_an:
|
||||
+ setvar_i(res, (long)getvar_i(av[0]) & (long)getvar_i(av[1]));
|
||||
+ break;
|
||||
+
|
||||
+ case B_co:
|
||||
+ setvar_i(res, ~(long)getvar_i(av[0]));
|
||||
+ break;
|
||||
+
|
||||
+ case B_ls:
|
||||
+ setvar_i(res, (long)getvar_i(av[0]) << (long)getvar_i(av[1]));
|
||||
+ break;
|
||||
+
|
||||
+ case B_or:
|
||||
+ setvar_i(res, (long)getvar_i(av[0]) | (long)getvar_i(av[1]));
|
||||
+ break;
|
||||
+
|
||||
+ case B_rs:
|
||||
+ setvar_i(res, (long)((unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1])));
|
||||
+ break;
|
||||
+
|
||||
+ case B_xo:
|
||||
+ setvar_i(res, (long)getvar_i(av[0]) ^ (long)getvar_i(av[1]));
|
||||
break;
|
||||
|
||||
case B_lo:
|
@ -1,12 +0,0 @@ |
||||
diff -Nur busybox-1.2.1/findutils/grep.c busybox-1.2.1/findutils/grep.c
|
||||
--- busybox-1.2.1/findutils/grep.c 2006-09-25 14:47:51.000000000 -0700
|
||||
+++ busybox-1.2.1/findutils/grep.c 2006-09-25 14:39:39.000000000 -0700
|
||||
@@ -51,7 +51,7 @@
|
||||
#define GREP_OPT_L (1<<12)
|
||||
#define PRINT_FILES_WITHOUT_MATCHES ((opt & GREP_OPT_L) != 0)
|
||||
#if ENABLE_FEATURE_GREP_CONTEXT
|
||||
-#define GREP_OPT_CONTEXT "A:B:C"
|
||||
+#define GREP_OPT_CONTEXT "A:B:C:"
|
||||
#define GREP_OPT_A (1<<13)
|
||||
#define GREP_OPT_B (1<<14)
|
||||
#define GREP_OPT_C (1<<15)
|
@ -1,44 +1,44 @@ |
||||
|
||||
Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
diff -urN busybox.old/networking/httpd.c busybox.dev/networking/httpd.c
|
||||
--- busybox.old/networking/httpd.c 2004-10-08 10:03:29.000000000 +0200
|
||||
+++ busybox.dev/networking/httpd.c 2006-02-04 01:54:19.688016250 +0100
|
||||
@@ -1467,12 +1467,26 @@
|
||||
{
|
||||
char *cipher;
|
||||
char *pp;
|
||||
+ char *ppnew = NULL;
|
||||
+ struct passwd *pwd = NULL;
|
||||
diff -ruN busybox-1.3.1-old/networking/httpd.c busybox-1.3.1/networking/httpd.c
|
||||
--- busybox-1.3.1-old/networking/httpd.c 2006-12-28 18:17:23.000000000 +0100
|
||||
+++ busybox-1.3.1/networking/httpd.c 2006-12-28 19:56:34.000000000 +0100
|
||||
@@ -1381,12 +1381,26 @@
|
||||
if (ENABLE_FEATURE_HTTPD_AUTH_MD5) {
|
||||
char *cipher;
|
||||
char *pp;
|
||||
+ char *ppnew = NULL;
|
||||
+ struct passwd *pwd = NULL;
|
||||
|
||||
if(strncmp(p, request, u-request) != 0) {
|
||||
/* user uncompared */
|
||||
continue;
|
||||
}
|
||||
pp = strchr(p, ':');
|
||||
+ if(pp && pp[1] == '$' && pp[2] == 'p' &&
|
||||
if (strncmp(p, request, u-request) != 0) {
|
||||
/* user uncompared */
|
||||
continue;
|
||||
}
|
||||
pp = strchr(p, ':');
|
||||
+ if(pp && pp[1] == '$' && pp[2] == 'p' &&
|
||||
+ pp[3] == '$' && pp[4] &&
|
||||
+ (pwd = getpwnam(&pp[4])) != NULL) {
|
||||
+ if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') {
|
||||
+ prev = NULL;
|
||||
+ continue;
|
||||
+ (pwd = getpwnam(&pp[4])) != NULL) {
|
||||
+ if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') {
|
||||
+ prev = NULL;
|
||||
+ continue;
|
||||
+ }
|
||||
+ ppnew = xrealloc(ppnew, 5 + strlen(pwd->pw_passwd));
|
||||
+ ppnew[0] = ':';
|
||||
+ strcpy(ppnew + 1, pwd->pw_passwd);
|
||||
+ pp = ppnew;
|
||||
+ }
|
||||
if (pp && pp[1] == '$' && pp[2] == '1' &&
|
||||
pp[3] == '$' && pp[4]) {
|
||||
pp++;
|
||||
@@ -1396,6 +1410,10 @@
|
||||
/* unauthorized */
|
||||
continue;
|
||||
}
|
||||
+ if (ppnew) {
|
||||
+ free(ppnew);
|
||||
+ ppnew = NULL;
|
||||
+ }
|
||||
+ ppnew = malloc(5 + strlen(pwd->pw_passwd));
|
||||
+ ppnew[0] = ':';
|
||||
+ strcpy(ppnew + 1, pwd->pw_passwd);
|
||||
+ pp = ppnew;
|
||||
+ }
|
||||
if(pp && pp[1] == '$' && pp[2] == '1' &&
|
||||
pp[3] == '$' && pp[4]) {
|
||||
pp++;
|
||||
@@ -1482,6 +1492,10 @@
|
||||
/* unauthorized */
|
||||
continue;
|
||||
}
|
||||
+ if (ppnew) {
|
||||
+ free(ppnew);
|
||||
+ ppnew = NULL;
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
if (strcmp(p, request) == 0) {
|
||||
|
||||
if (strcmp(p, request) == 0) {
|
||||
|
@ -1,95 +0,0 @@ |
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
diff -ruN busybox-1.2.0-old/networking/httpd.c busybox-1.2.0-new/networking/httpd.c
|
||||
--- busybox-1.2.0-old/networking/httpd.c 2006-07-01 00:42:02.000000000 +0200
|
||||
+++ busybox-1.2.0-new/networking/httpd.c 2006-08-01 10:06:58.000000000 +0200
|
||||
@@ -99,6 +99,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> /* for connect and socket*/
|
||||
#include <netinet/in.h> /* for sockaddr_in */
|
||||
+#include <arpa/inet.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <fcntl.h> /* for open modes */
|
||||
@@ -165,6 +166,7 @@
|
||||
#endif
|
||||
unsigned port; /* server initial port and for
|
||||
set env REMOTE_PORT */
|
||||
+ char *address;
|
||||
union HTTPD_FOUND {
|
||||
const char *found_mime_type;
|
||||
const char *found_moved_temporarily;
|
||||
@@ -868,7 +870,10 @@
|
||||
/* inet_addr() returns a value that is already in network order */
|
||||
memset(&lsocket, 0, sizeof(lsocket));
|
||||
lsocket.sin_family = AF_INET;
|
||||
- lsocket.sin_addr.s_addr = INADDR_ANY;
|
||||
+ if (inet_aton(config->address, &(lsocket.sin_addr)) == 1) {
|
||||
+ if (config->address != NULL) lsocket.sin_addr.s_addr = ((struct in_addr *) ((gethostbyname(config->address))->h_addr))->s_addr;
|
||||
+ else lsocket.sin_addr.s_addr = htons(INADDR_ANY);
|
||||
+ }
|
||||
lsocket.sin_port = htons(config->port);
|
||||
fd = bb_xsocket(AF_INET, SOCK_STREAM, 0);
|
||||
/* tell the OS it's OK to reuse a previous address even though */
|
||||
@@ -1899,6 +1904,7 @@
|
||||
USE_FEATURE_HTTPD_AUTH_MD5(m_opt_md5,)
|
||||
USE_FEATURE_HTTPD_SETUID(u_opt_setuid,)
|
||||
USE_FEATURE_HTTPD_WITHOUT_INETD(p_opt_port,)
|
||||
+ USE_FEATURE_HTTPD_WITHOUT_INETD(l_opt_addr,)
|
||||
};
|
||||
|
||||
static const char httpd_opts[]="c:d:h:"
|
||||
@@ -1906,7 +1912,7 @@
|
||||
USE_FEATURE_HTTPD_BASIC_AUTH("r:")
|
||||
USE_FEATURE_HTTPD_AUTH_MD5("m:")
|
||||
USE_FEATURE_HTTPD_SETUID("u:")
|
||||
- USE_FEATURE_HTTPD_WITHOUT_INETD("p:");
|
||||
+ USE_FEATURE_HTTPD_WITHOUT_INETD("p:l:");
|
||||
|
||||
#define OPT_CONFIG_FILE (1<<c_opt_config_file)
|
||||
#define OPT_DECODE_URL (1<<d_opt_decode_url)
|
||||
@@ -1927,6 +1933,8 @@
|
||||
#define OPT_PORT USE_FEATURE_HTTPD_WITHOUT_INETD((1<<p_opt_port)) \
|
||||
SKIP_FEATURE_HTTPD_WITHOUT_INETD(0)
|
||||
|
||||
+#define OPT_ADDRESS USE_FEATURE_HTTPD_WITHOUT_INETD((1<<l_opt_addr)) \
|
||||
+ SKIP_FEATURE_HTTPD_WITHOUT_INETD(0)
|
||||
|
||||
int httpd_main(int argc, char *argv[])
|
||||
{
|
||||
@@ -1935,6 +1943,7 @@
|
||||
char *url_for_decode;
|
||||
USE_FEATURE_HTTPD_ENCODE_URL_STR(const char *url_for_encode;)
|
||||
USE_FEATURE_HTTPD_WITHOUT_INETD(const char *s_port;)
|
||||
+ USE_FEATURE_HTTPD_WITHOUT_INETD(const char *s_addr;)
|
||||
USE_FEATURE_HTTPD_WITHOUT_INETD(int server;)
|
||||
|
||||
USE_FEATURE_HTTPD_SETUID(const char *s_uid;)
|
||||
@@ -1949,6 +1958,7 @@
|
||||
|
||||
#ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD
|
||||
config->port = 80;
|
||||
+ config->address = "";
|
||||
#endif
|
||||
|
||||
config->ContentLength = -1;
|
||||
@@ -1960,6 +1970,7 @@
|
||||
USE_FEATURE_HTTPD_AUTH_MD5(, &pass)
|
||||
USE_FEATURE_HTTPD_SETUID(, &s_uid)
|
||||
USE_FEATURE_HTTPD_WITHOUT_INETD(, &s_port)
|
||||
+ USE_FEATURE_HTTPD_WITHOUT_INETD(, &s_addr)
|
||||
);
|
||||
|
||||
if(opt & OPT_DECODE_URL) {
|
||||
@@ -1981,6 +1992,8 @@
|
||||
#ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD
|
||||
if(opt & OPT_PORT)
|
||||
config->port = bb_xgetlarg(s_port, 10, 1, 0xffff);
|
||||
+ if (opt & OPT_ADDRESS)
|
||||
+ if (s_addr) config->address = (char *) s_addr;
|
||||
#ifdef CONFIG_FEATURE_HTTPD_SETUID
|
||||
if(opt & OPT_SETUID) {
|
||||
char *e;
|
@ -1,30 +1,28 @@ |
||||
diff -Nur busybox-1.1.1/networking/httpd.c busybox-1.1.1-owrt/networking/httpd.c
|
||||
--- busybox-1.1.1/networking/httpd.c 2006-04-01 19:42:36.000000000 +0200
|
||||
+++ busybox-1.1.1-owrt/networking/httpd.c 2006-04-01 19:43:59.000000000 +0200
|
||||
@@ -247,6 +247,7 @@
|
||||
const char *query;
|
||||
diff -ruN busybox-1.3.1-old/networking/httpd.c busybox-1.3.1/networking/httpd.c
|
||||
--- busybox-1.3.1-old/networking/httpd.c 2006-12-27 05:52:39.000000000 +0100
|
||||
+++ busybox-1.3.1/networking/httpd.c 2006-12-28 18:04:53.000000000 +0100
|
||||
@@ -137,6 +137,7 @@
|
||||
const char *query;
|
||||
|
||||
USE_FEATURE_HTTPD_CGI(char *referer;)
|
||||
+ USE_FEATURE_HTTPD_CGI(char *user_agent;)
|
||||
USE_FEATURE_HTTPD_CGI(char *referer;)
|
||||
+ USE_FEATURE_HTTPD_CGI(char *user_agent;)
|
||||
|
||||
const char *configFile;
|
||||
const char *configFile;
|
||||
|
||||
@@ -1208,6 +1209,7 @@
|
||||
addEnv("SERVER", "PROTOCOL", "HTTP/1.0");
|
||||
addEnv("GATEWAY_INTERFACE", "", "CGI/1.1");
|
||||
addEnv("REMOTE", "ADDR", config->rmt_ip_str);
|
||||
+ addEnv("HTTP","USER_AGENT", config->user_agent);
|
||||
#ifdef CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
|
||||
addEnvPort("REMOTE");
|
||||
@@ -1062,6 +1063,7 @@
|
||||
putenv("SERVER_PROTOCOL=HTTP/1.0");
|
||||
putenv("GATEWAY_INTERFACE=CGI/1.1");
|
||||
setenv1("REMOTE_ADDR", config->rmt_ip_str);
|
||||
+ setenv1("HTTP_USER_AGENT", config->user_agent);
|
||||
#if ENABLE_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
|
||||
setenv_long("REMOTE_PORT", config->port);
|
||||
#endif
|
||||
@@ -1771,6 +1773,10 @@
|
||||
for(test = buf + 8; isspace(*test); test++)
|
||||
;
|
||||
config->referer = strdup(test);
|
||||
+ } else if ((strncasecmp(buf, "User-Agent:",11) ==0)) {
|
||||
+ for(test = buf + 11; isspace(*test); test++)
|
||||
+ ;
|
||||
+ config->user_agent = strdup(test);
|
||||
}
|
||||
@@ -1605,6 +1607,8 @@
|
||||
content_type = strdup(skip_whitespace(buf + sizeof("Content-Type:")-1));
|
||||
} else if ((STRNCASECMP(buf, "Referer:") == 0)) {
|
||||
config->referer = strdup(skip_whitespace(buf + sizeof("Referer:")-1));
|
||||
+ } else if ((STRNCASECMP(buf, "User-Agent:") == 0)) {
|
||||
+ config->user_agent = strdup(skip_whitespace(buf + sizeof("User-Agent:")-1));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue