diff --git a/miniupnpd/Changelog.txt b/miniupnpd/Changelog.txt index cdc81e6..952a0de 100644 --- a/miniupnpd/Changelog.txt +++ b/miniupnpd/Changelog.txt @@ -1,4 +1,7 @@ -$Id: Changelog.txt,v 1.290 2012/06/23 23:34:41 nanard Exp $ +$Id: Changelog.txt,v 1.292 2012/06/29 19:26:07 nanard Exp $ + +2012/06/29: + added DISABLE_CONFIG_FILE in options.h to disable miniupnpd.conf parsing 2012/06/28: Only activate -L option for PF and IPF diff --git a/miniupnpd/genconfig.sh b/miniupnpd/genconfig.sh index 5c018d2..e0d4ee2 100755 --- a/miniupnpd/genconfig.sh +++ b/miniupnpd/genconfig.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $Id: genconfig.sh,v 1.56 2012/05/31 09:32:39 nanard Exp $ +# $Id: genconfig.sh,v 1.58 2012/06/29 19:29:55 nanard Exp $ # miniupnp daemon # http://miniupnp.free.fr or http://miniupnp.tuxfamily.org/ # (c) 2006-2012 Thomas Bernard @@ -399,6 +399,10 @@ else fi echo "" >> ${CONFIGFILE} +echo "/* disable reading and parsing of config file (miniupnpd.conf) */" >> ${CONFIGFILE} +echo "/*#define DISABLE_CONFIG_FILE*/" >> ${CONFIGFILE} +echo "" >> ${CONFIGFILE} + echo "#endif" >> ${CONFIGFILE} exit 0 diff --git a/miniupnpd/miniupnpd.c b/miniupnpd/miniupnpd.c index a005d7a..f41477b 100644 --- a/miniupnpd/miniupnpd.c +++ b/miniupnpd/miniupnpd.c @@ -1,4 +1,4 @@ -/* $Id: miniupnpd.c,v 1.161 2012/05/21 15:50:03 nanard Exp $ */ +/* $Id: miniupnpd.c,v 1.164 2012/06/29 19:33:37 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006-2012 Thomas Bernard @@ -651,12 +651,14 @@ init(int argc, char * * argv, struct runtime_vars * v) int i; int pid; int debug_flag = 0; - int options_flag = 0; int openlog_option; struct sigaction sa; /*const char * logfilename = 0;*/ const char * presurl = 0; +#ifndef DISABLE_CONFIG_FILE + int options_flag = 0; const char * optionsfile = DEFAULT_CONFIG; +#endif /* DISABLE_CONFIG_FILE */ struct lan_addr_s * lan_addr; struct lan_addr_s * lan_addr2; @@ -666,6 +668,7 @@ init(int argc, char * * argv, struct runtime_vars * v) if(0 == strcmp(argv[i], "-h")) goto print_usage; } +#ifndef DISABLE_CONFIG_FILE /* first check if "-f" option is used */ for(i=2; iport = -1; v->notify_interval = 30; /* seconds between SSDP announces */ v->clean_ruleset_threshold = 20; v->clean_ruleset_interval = 0; /* interval between ruleset check. 0=disabled */ - +#ifndef DISABLE_CONFIG_FILE /* read options file first since * command line arguments have final say */ if(readoptionsfile(optionsfile) < 0) @@ -825,6 +829,7 @@ init(int argc, char * * argv, struct runtime_vars * v) } } } +#endif /* DISABLE_CONFIG_FILE */ /* command line arguments processing */ for(i=1; i #include #include +#include "config.h" #include "options.h" #include "upnppermissions.h" #include "upnpglobalvars.h" +#ifndef DISABLE_CONFIG_FILE struct option * ary_options = NULL; static char * string_repo = NULL; unsigned int num_options = 0; @@ -248,3 +250,5 @@ freeoptions(void) } } +#endif /* DISABLE_CONFIG_FILE */ + diff --git a/miniupnpd/options.h b/miniupnpd/options.h index 016f7d0..528efb1 100644 --- a/miniupnpd/options.h +++ b/miniupnpd/options.h @@ -1,4 +1,4 @@ -/* $Id: options.h,v 1.20 2012/04/30 13:38:21 nanard Exp $ */ +/* $Id: options.h,v 1.21 2012/06/29 19:26:09 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * author: Ryan Wagoner @@ -11,6 +11,7 @@ #include "config.h" +#ifndef DISABLE_CONFIG_FILE /* enum of option available in the miniupnpd.conf */ enum upnpconfigoptions { UPNP_INVALID = 0, @@ -71,5 +72,7 @@ struct option extern struct option * ary_options; extern unsigned int num_options; -#endif +#endif /* DISABLE_CONFIG_FILE */ + +#endif /* __OPTIONS_H__ */