comparison cli-runopts.c @ 1214:61d3f56808a4

Merge pull request #18 from annulen/dbclient_syslog Support syslog logging in dbclient.
author Matt Johnston <matt@ucc.asn.au>
date Tue, 15 Dec 2015 21:55:51 +0800
parents 7fd1211a1f63
children d058e15ea213
comparison
equal deleted inserted replaced
1209:ab7d9c12caa7 1214:61d3f56808a4
171 #endif 171 #endif
172 #ifdef ENABLE_USER_ALGO_LIST 172 #ifdef ENABLE_USER_ALGO_LIST
173 opts.cipher_list = NULL; 173 opts.cipher_list = NULL;
174 opts.mac_list = NULL; 174 opts.mac_list = NULL;
175 #endif 175 #endif
176 #ifndef DISABLE_SYSLOG
177 opts.usingsyslog = 0;
178 #endif
176 /* not yet 179 /* not yet
177 opts.ipv4 = 1; 180 opts.ipv4 = 1;
178 opts.ipv6 = 1; 181 opts.ipv6 = 1;
179 */ 182 */
180 opts.recv_window = DEFAULT_RECV_WINDOW; 183 opts.recv_window = DEFAULT_RECV_WINDOW;
486 489
487 key = new_sign_key(); 490 key = new_sign_key();
488 keytype = DROPBEAR_SIGNKEY_ANY; 491 keytype = DROPBEAR_SIGNKEY_ANY;
489 if ( readhostkey(filename, key, &keytype) != DROPBEAR_SUCCESS ) { 492 if ( readhostkey(filename, key, &keytype) != DROPBEAR_SUCCESS ) {
490 if (warnfail) { 493 if (warnfail) {
491 fprintf(stderr, "Failed loading keyfile '%s'\n", filename); 494 dropbear_log(LOG_WARNING, "Failed loading keyfile '%s'\n", filename);
492 } 495 }
493 sign_key_free(key); 496 sign_key_free(key);
494 } else { 497 } else {
495 key->type = keytype; 498 key->type = keytype;
496 key->source = SIGNKEY_SOURCE_RAW_FILE; 499 key->source = SIGNKEY_SOURCE_RAW_FILE;
859 if (strcmp(origstr, "help") == 0) { 862 if (strcmp(origstr, "help") == 0) {
860 dropbear_log(LOG_INFO, "Available options:\n" 863 dropbear_log(LOG_INFO, "Available options:\n"
861 #ifdef ENABLE_CLI_ANYTCPFWD 864 #ifdef ENABLE_CLI_ANYTCPFWD
862 "\tExitOnForwardFailure\n" 865 "\tExitOnForwardFailure\n"
863 #endif 866 #endif
867 #ifndef DISABLE_SYSLOG
868 "\tUseSyslog\n"
869 #endif
864 ); 870 );
865 exit(EXIT_SUCCESS); 871 exit(EXIT_SUCCESS);
866 } 872 }
867 873
868 #ifdef ENABLE_CLI_ANYTCPFWD 874 #ifdef ENABLE_CLI_ANYTCPFWD
870 cli_opts.exit_on_fwd_failure = parse_flag_value(optstr); 876 cli_opts.exit_on_fwd_failure = parse_flag_value(optstr);
871 return; 877 return;
872 } 878 }
873 #endif 879 #endif
874 880
881 #ifndef DISABLE_SYSLOG
882 if (match_extendedopt(&optstr, "UseSyslog") == DROPBEAR_SUCCESS) {
883 opts.usingsyslog = parse_flag_value(optstr);
884 return;
885 }
886 #endif
887
875 dropbear_exit("Bad configuration option '%s'", origstr); 888 dropbear_exit("Bad configuration option '%s'", origstr);
876 } 889 }