add force netstring overwrite commandline option
This commit is contained in:
		@@ -141,7 +141,7 @@ count_t thread_counter;
 | 
			
		||||
cfg_t *cfg;
 | 
			
		||||
 | 
			
		||||
int netstring_disabled = 0;
 | 
			
		||||
 | 
			
		||||
int force_netstring_disabled = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void * statser(void * arg) {
 | 
			
		||||
@@ -320,7 +320,7 @@ int server() {
 | 
			
		||||
  char *cfg_address, *cfg_port;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  netstring_disabled = atoi(findcfgx(cfg, CFG_SECTION_GLOBAL, CFG_NETSTRING_DISABLED, "0"));
 | 
			
		||||
  netstring_disabled = atoi(findcfgx(cfg, CFG_SECTION_GLOBAL, CFG_NETSTRING_DISABLED, "0")) || force_netstring_disabled;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  serverSock = socket(AF_INET, SOCK_STREAM, 0);
 | 
			
		||||
@@ -439,6 +439,7 @@ int server() {
 | 
			
		||||
void usage() {
 | 
			
		||||
  printf("smmapd [-F] [-p pidfile] [-f cfgfile] [-h]\n");
 | 
			
		||||
  printf("  -F   run in foreground, overwrite smmapd.ini setting\n");
 | 
			
		||||
  printf("  -n   force netstring disable, overwrite smmapd.ini setting\n");
 | 
			
		||||
  printf("  -p   pidfile, overwrite smmapd.ini setting\n");
 | 
			
		||||
  printf("  -f   cfgfile\n");
 | 
			
		||||
  printf("  -v   version and release info\n");
 | 
			
		||||
@@ -451,7 +452,7 @@ int main(int argc, char **argv) {
 | 
			
		||||
  
 | 
			
		||||
  FILE *f;
 | 
			
		||||
 | 
			
		||||
  while ((c = getopt(argc, argv,"Fp:f:hv")) != -1)
 | 
			
		||||
  while ((c = getopt(argc, argv,"Fp:f:hvn")) != -1)
 | 
			
		||||
     switch (c) {
 | 
			
		||||
     case 'F': 
 | 
			
		||||
       foreground = 1;
 | 
			
		||||
@@ -462,6 +463,9 @@ int main(int argc, char **argv) {
 | 
			
		||||
     case 'p': 
 | 
			
		||||
       pid_file = htstrdup(optarg);
 | 
			
		||||
       break;
 | 
			
		||||
     case 'n':
 | 
			
		||||
       force_netstring_disabled = 1;
 | 
			
		||||
       break;
 | 
			
		||||
     case 'v': 
 | 
			
		||||
       printf("\nsmmapd - Wolfgang Hottgenroth <woho@hottis.de>\n");
 | 
			
		||||
       printf("  cvs_id: %s\n", CVS_ID);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user