[BusyBox-cvs] busybox/networking inetd.c,NONE,1.1 Config.in,1.10,1.11 Makefile.in,1.14,1.15 httpd.c,1.1,1.2
Glenn McGrath
bug1 at busybox.net
Sun Feb 9 06:51:19 UTC 2003
Update of /var/cvs/busybox/networking
In directory winder:/tmp/cvs-serv22929/networking
Modified Files:
Config.in Makefile.in httpd.c
Added Files:
inetd.c
Log Message:
New applet, inetd, make httpd features more configurable, update authors, last_patch_80
from Vladimir N. Oleynik
--- NEW FILE: inetd.c ---
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* David A. Holland.
*
* Busybox port by Vladimir Oleynik (C) 2001-2003 <dzo at simtreas.ru>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
[...1241 lines suppressed...]
write(s, buffer, st);
}
/* Return human-readable time of day */
static void
daytime_dg(int s, struct servtab *sep)
{
char buffer[256];
struct sockaddr sa;
size_t size;
(void)sep;
size = sizeof(sa);
if (recvfrom(s, buffer, sizeof(buffer), 0, &sa, &size) < 0)
return;
size = human_readable_time_sprintf(buffer);
sendto(s, buffer, size, 0, &sa, sizeof(sa));
}
#endif /* CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME */
Index: Config.in
===================================================================
RCS file: /var/cvs/busybox/networking/Config.in,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Config.in 23 Jan 2003 05:59:32 -0000 1.10
+++ Config.in 9 Feb 2003 06:51:14 -0000 1.11
@@ -41,6 +41,15 @@
help
Serve web pages via an HTTP server.
+config CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
+ bool " Support call from inetd only"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ This option disabling uid and port options for httpd applet
+ and more others reducing size moments, but require
+ internet superserver daemon for usaging.
+
config CONFIG_FEATURE_HTTPD_BASIC_AUTH
bool " Enable Basic Authentication and IP address checking"
default n
@@ -49,6 +58,66 @@
Utilizes /etc/httpd.conf for security settings allowing
ip address filtering and basic authentication on a per url basis.
+config CONFIG_FEATURE_HTTPD_CGI
+ bool " Enable support Common Gateway Interface"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ Disable this for do very small module
+
+config CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
+ bool " Enable support reload global config file after hup signaled"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ Disable this for do very small module
+
+config CONFIG_FEATURE_HTTPD_SETUID
+ bool " Enable support -u user option"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ Require for drop privilegies after bind() to privilegies port
+
+config CONFIG_FEATURE_HTTPD_CONFIG_WITH_MIME_TYPES
+ bool " Enable support load from config file mime types"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ After set this you can adding or change mime types from file
+ suffixes in config files
+
+config CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV
+ bool " Enable support set eviroment REMOTE_PORT"
+ default n
+ depends on CONFIG_FEATURE_HTTPD_CGI
+ help
+ After set this your CGI script can know own remote port connecting
+
+config CONFIG_FEATURE_HTTPD_SET_CGI_VARS_TO_ENV
+ bool " Enable support nonstandart httpd feature set CGI_var=value"
+ default n
+ depends on CONFIG_FEATURE_HTTPD_CGI
+ help
+ After set this your CGI script can have trivial parse getted vars
+
+config CONFIG_FEATURE_HTTPD_DECODE_URL_STR
+ bool " Support nonstandart httpd feature decode URL to stdout"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ After set this your can decode URL from -d argument to stdout,
+ example -d "Hello%20World" as "Hello World"
+
+config CONFIG_FEATURE_HTTPD_ENCODE_URL_STR
+ bool " Support nonstandart httpd feature encode argument to URL"
+ default n
+ depends on CONFIG_HTTPD
+ help
+ After set this your can encode from -d argument to stdout as URL,
+ example -e "<Hello World>" as "%3CHello%20World%3E"
+
+
config CONFIG_IFCONFIG
bool "ifconfig"
default n
@@ -132,6 +201,48 @@
This enables support for the "mapping" stanza, unless you have
a weird network setup you dont need it.
+config CONFIG_INETD
+ bool "inetd"
+ default n
+ help
+ Internet superserver daemon
+
+config CONFIG_FEATURE_INETD_SUPPORT_BILTIN_ECHO
+ bool " Support echo service"
+ default y
+ depends on CONFIG_INETD
+ help
+ Echo received data internal inetd service
+
+config CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DISCARD
+ bool " Support discard service"
+ default y
+ depends on CONFIG_INETD
+ help
+ Internet /dev/null internal inetd service
+
+config CONFIG_FEATURE_INETD_SUPPORT_BILTIN_TIME
+ bool " Support time service"
+ default y
+ depends on CONFIG_INETD
+ help
+ Return 32 bit time since 1900 internal inetd service
+
+config CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME
+ bool " Support daytime service"
+ default y
+ depends on CONFIG_INETD
+ help
+ Return human-readable time internal inetd service
+
+config CONFIG_FEATURE_INETD_SUPPORT_BILTIN_CHARGEN
+ bool " Support chargen service"
+ default y
+ depends on CONFIG_INETD
+ help
+ Familiar character generator internal inetd service
+
+
config CONFIG_IP
bool "ip"
default n
@@ -316,7 +427,7 @@
Please submit a patch to add help text for this item.
config CONFIG_FEATURE_TELNETD_INETD
- bool " Use inetd"
+ bool " Support call from inetd only"
default n
depends on CONFIG_TELNETD
help
Index: Makefile.in
===================================================================
RCS file: /var/cvs/busybox/networking/Makefile.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Makefile.in 23 Jan 2003 05:59:32 -0000 1.14
+++ Makefile.in 9 Feb 2003 06:51:14 -0000 1.15
@@ -30,6 +30,7 @@
NETWORKING-$(CONFIG_HTTPD) += httpd.o
NETWORKING-$(CONFIG_IFCONFIG) += ifconfig.o
NETWORKING-$(CONFIG_IFUPDOWN) += ifupdown.o
+NETWORKING-$(CONFIG_INETD) += inetd.o
NETWORKING-$(CONFIG_IP) += ip.o
NETWORKING-$(CONFIG_IPCALC) += ipcalc.o
NETWORKING-$(CONFIG_IPADDR) += ipaddr.o
Index: httpd.c
===================================================================
RCS file: /var/cvs/busybox/networking/httpd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- httpd.c 5 Jan 2003 04:01:56 -0000 1.1
+++ httpd.c 9 Feb 2003 06:51:14 -0000 1.2
@@ -1,8 +1,10 @@
/*
* httpd implementation for busybox
*
- * Copyright (C) 2002 Glenn Engel <glenne at engel.org>
+ * Copyright (C) 2002,2003 Glenn Engel <glenne at engel.org>
+ * Copyright (C) 2003 Vladimir Oleynik <dzo at simtreas.ru>
*
+ * simplify patch stolen from libbb without using strdup
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
[...2436 lines suppressed...]
-int main(int argc, char *argv[])
-{
- return httpd_main(argc, argv);
-}
+#ifdef CONFIG_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
+ sighup_handler(0);
+#else
+ parse_conf(default_patch_httpd_conf, FIRST_PARSE);
+#endif
+#ifndef CONFIG_FEATURE_HTTPD_USAGE_FROM_INETD_ONLY
+ if (!config->debugHttpd) {
+ if (daemon(1, 0) < 0) /* don`t change curent directory */
+ perror_msg_and_die("daemon");
+ }
+ return miniHttpd(server);
+#else
+ return miniHttpd();
#endif
+}
More information about the busybox-cvs
mailing list