diff options
Diffstat (limited to 'package/mini_httpd/patches')
-rw-r--r-- | package/mini_httpd/patches/patch-Makefile | 78 | ||||
-rw-r--r-- | package/mini_httpd/patches/patch-mini_httpd_c | 96 |
2 files changed, 174 insertions, 0 deletions
diff --git a/package/mini_httpd/patches/patch-Makefile b/package/mini_httpd/patches/patch-Makefile new file mode 100644 index 000000000..5a574b21c --- /dev/null +++ b/package/mini_httpd/patches/patch-Makefile @@ -0,0 +1,78 @@ +$Id$ +--- mini_httpd-1.19.orig/Makefile 2002-11-01 23:02:57.000000000 +0000 ++++ mini_httpd-1.19/Makefile 2007-03-20 13:35:49.000000000 +0000 +@@ -14,30 +14,44 @@ CRYPT_LIB = -lcrypt + # http://www.openssl.org/ Make sure the SSL_TREE definition points to the + # tree with your OpenSSL installation - depending on how you installed it, + # it may be in /usr/local instead of /usr/local/ssl. ++ ++# OpenSSL + #SSL_TREE = /usr/local/ssl + #SSL_DEFS = -DUSE_SSL + #SSL_INC = -I${SSL_TREE}/include + #SSL_LIBS = -L${SSL_TREE}/lib -lssl -lcrypto ++#SSL_OBJS = + ++# MatrixSSL ++#SSL_TREE = ++#SSL_DEFS = -DUSE_SSL -DHAVE_MATRIXSSL ++#SSL_INC = ++#SSL_LIBS = -lmatrixssl ++#SSL_OBJS = matrixssl_helper.o + +-BINDIR = /usr/local/sbin +-MANDIR = /usr/local/man +-CC = gcc ++ ++DESTDIR = ++ ++BINDIR = $(DESTDIR)/usr/sbin ++MANDIR = $(DESTDIR)/usr/share/man ++CC ?= gcc + CDEFS = ${SSL_DEFS} ${SSL_INC} +-CFLAGS = -O ${CDEFS} +-#CFLAGS = -g ${CDEFS} +-LDFLAGS = -s ++CFLAGS += ${CDEFS} ++LDFLAGS ?= + #LDFLAGS = -g + LDLIBS = ${SSL_LIBS} ${SYSV_LIBS} ${CRYPT_LIB} + + all: mini_httpd htpasswd + +-mini_httpd: mini_httpd.o match.o tdate_parse.o +- ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${LDLIBS} -o mini_httpd ++mini_httpd: mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ++ ${CC} ${CFLAGS} ${LDFLAGS} mini_httpd.o match.o tdate_parse.o ${SSL_OBJS} ${LDLIBS} -o mini_httpd + + mini_httpd.o: mini_httpd.c version.h port.h match.h tdate_parse.h mime_encodings.h mime_types.h + ${CC} ${CFLAGS} -c mini_httpd.c + ++matrixssl_helper.o: matrixssl_helper.c ++ ${CC} ${CFLAGS} -c matrixssl_helper.c ++ + match.o: match.c match.h + ${CC} ${CFLAGS} -c match.c + +@@ -71,16 +85,18 @@ mini_httpd.pem: mini_httpd.cnf + chmod 600 mini_httpd.pem + + +-install: all +- rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd ++install: all uninstall + -mkdir -p ${BINDIR} + cp mini_httpd htpasswd ${BINDIR} +- rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1 + -mkdir -p ${MANDIR}/man8 + cp mini_httpd.8 ${MANDIR}/man8 + -mkdir -p ${MANDIR}/man1 + cp htpasswd.1 ${MANDIR}/man1 + ++uninstall: ++ rm -f ${BINDIR}/mini_httpd ${BINDIR}/htpasswd ++ rm -f ${MANDIR}/man8/mini_httpd.8 ${MANDIR}/man1/htpasswd.1 ++ + clean: + rm -f mini_httpd mime_encodings.h mime_types.h htpasswd mini_httpd.rnd *.o core core.* *.core + diff --git a/package/mini_httpd/patches/patch-mini_httpd_c b/package/mini_httpd/patches/patch-mini_httpd_c new file mode 100644 index 000000000..b1b3414d3 --- /dev/null +++ b/package/mini_httpd/patches/patch-mini_httpd_c @@ -0,0 +1,96 @@ +$Id$ +--- mini_httpd-1.19.orig/mini_httpd.c 2005-06-29 19:31:17.000000000 +0200 ++++ mini_httpd-1.19/mini_httpd.c 2007-01-20 19:48:49.000000000 +0100 +@@ -66,8 +66,14 @@ + #endif /* HAVE_SENDFILE */ + + #ifdef USE_SSL ++# ifdef HAVE_OPENSSL + #include <openssl/ssl.h> + #include <openssl/err.h> ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++# include "matrixssl_helper.h" ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + #endif /* USE_SSL */ + + extern char* crypt( const char* key, const char* setting ); +@@ -132,10 +138,10 @@ typedef long long int64_t; + #define CGI_NICE 10 + #endif /* CGI_NICE */ + #ifndef CGI_PATH +-#define CGI_PATH "/usr/local/bin:/usr/ucb:/bin:/usr/bin" ++#define CGI_PATH "/usr/bin:/bin:/usr/sbin:/sbin" + #endif /* CGI_PATH */ + #ifndef CGI_LD_LIBRARY_PATH +-#define CGI_LD_LIBRARY_PATH "/usr/local/lib:/usr/lib" ++#define CGI_LD_LIBRARY_PATH "/usr/lib:/lib" + #endif /* CGI_LD_LIBRARY_PATH */ + #ifndef AUTH_FILE + #define AUTH_FILE ".htpasswd" +@@ -193,7 +199,13 @@ static int listen4_fd, listen6_fd; + static int do_ssl; + static char* certfile; + static char* cipher; ++#ifdef HAVE_OPENSSL + static SSL_CTX* ssl_ctx; ++#else /* HAVE_OPENSSL */ ++ #ifdef HAVE_MATRIXSSL ++static sslKeys_t* keys; ++ #endif /* HAVE_MATRIXSSL */ ++#endif /* HAVE_OPENSSL */ + #endif /* USE_SSL */ + static char cwd[MAXPATHLEN]; + static int got_hup; +@@ -540,6 +552,7 @@ main( int argc, char** argv ) + #ifdef USE_SSL + if ( do_ssl ) + { ++# ifdef HAVE_OPENSSL + SSL_load_error_strings(); + SSLeay_add_ssl_algorithms(); + ssl_ctx = SSL_CTX_new( SSLv23_server_method() ); +@@ -559,6 +572,17 @@ main( int argc, char** argv ) + exit( 1 ); + } + } ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++ matrixSslOpen(); ++ if ( matrixSslReadKeys( &keys, certfile, certfile, NULL, NULL ) < 0 ) ++ { ++ syslog( LOG_CRIT, "can't load certificate and/or private key\n"); ++ (void) fprintf( stderr, "%s: can't load certificate and/or private key\n", argv0 ); ++ exit( 1 ); ++ } ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + } + #endif /* USE_SSL */ + +@@ -1174,6 +1198,7 @@ handle_request( void ) + #ifdef USE_SSL + if ( do_ssl ) + { ++# ifdef HAVE_OPENSSL + ssl = SSL_new( ssl_ctx ); + SSL_set_fd( ssl, conn_fd ); + if ( SSL_accept( ssl ) == 0 ) +@@ -1181,6 +1206,16 @@ handle_request( void ) + ERR_print_errors_fp( stderr ); + exit( 1 ); + } ++# else /* HAVE_OPENSSL */ ++# ifdef HAVE_MATRIXSSL ++ ssl = SSL_new(keys); ++ SSL_set_fd( ssl, conn_fd ); ++ if ( SSL_accept( ssl ) <= 0 ) ++ { ++ perror( "SSL_accept" ); ++ } ++# endif /* HAVE_MATRIXSSL */ ++# endif /* HAVE_OPENSSL */ + } + #endif /* USE_SSL */ + |