Changeset 538
- Timestamp:
- 01/24/10 19:55:24 (2 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
ChangeLog (modified) (1 diff)
-
configure (modified) (10 diffs)
-
src/Makefile.am (modified) (1 diff)
-
src/Makefile.in (modified) (9 diffs)
-
src/cygwin/Makefile.am (modified) (1 diff)
-
src/cygwin/Makefile.in (modified) (8 diffs)
-
src/ocat.c (modified) (11 diffs)
-
src/ocat.h (modified) (2 diffs)
-
src/ocat_netdesc.c (modified) (2 diffs)
-
src/ocat_netdesc.h (modified) (1 diff)
-
src/ocatctrl.c (modified) (8 diffs)
-
src/ocatsetup.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r536 r538 1 1 * version 0.2.2 2 - options are parsed sequentially (-f and -I first) 3 - config file is always read from SYSCONFDIR (usually /etc or /usr/local/etc) 4 - changed Makefile.am to not install header files 2 5 - separate name for connect log and pid file for OC/GC. 3 6 - mode detection (OC/GC) improved -
trunk/configure
r536 r538 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 # Generated by GNU Autoconf 2.62 for onioncat 0.2.2.r53 6.3 # Generated by GNU Autoconf 2.62 for onioncat 0.2.2.r538. 4 4 # 5 5 # Report bugs to <rahra@cypherpunk.at>. … … 597 597 PACKAGE_NAME='onioncat' 598 598 PACKAGE_TARNAME='onioncat' 599 PACKAGE_VERSION='0.2.2.r53 6'600 PACKAGE_STRING='onioncat 0.2.2.r53 6'599 PACKAGE_VERSION='0.2.2.r538' 600 PACKAGE_STRING='onioncat 0.2.2.r538' 601 601 PACKAGE_BUGREPORT='rahra@cypherpunk.at' 602 602 … … 1261 1261 # This message is too long to be a string in the A/UX 3.1 sh. 1262 1262 cat <<_ACEOF 1263 \`configure' configures onioncat 0.2.2.r53 6to adapt to many kinds of systems.1263 \`configure' configures onioncat 0.2.2.r538 to adapt to many kinds of systems. 1264 1264 1265 1265 Usage: $0 [OPTION]... [VAR=VALUE]... … … 1331 1331 if test -n "$ac_init_help"; then 1332 1332 case $ac_init_help in 1333 short | recursive ) echo "Configuration of onioncat 0.2.2.r53 6:";;1333 short | recursive ) echo "Configuration of onioncat 0.2.2.r538:";; 1334 1334 esac 1335 1335 cat <<\_ACEOF … … 1423 1423 if $ac_init_version; then 1424 1424 cat <<\_ACEOF 1425 onioncat configure 0.2.2.r53 61425 onioncat configure 0.2.2.r538 1426 1426 generated by GNU Autoconf 2.62 1427 1427 … … 1437 1437 running configure, to aid debugging if configure makes a mistake. 1438 1438 1439 It was created by onioncat $as_me 0.2.2.r53 6, which was1439 It was created by onioncat $as_me 0.2.2.r538, which was 1440 1440 generated by GNU Autoconf 2.62. Invocation command line was 1441 1441 … … 2086 2086 # Define the identity of the package. 2087 2087 PACKAGE='onioncat' 2088 VERSION='0.2.2.r53 6'2088 VERSION='0.2.2.r538' 2089 2089 2090 2090 … … 2237 2237 2238 2238 cat >>confdefs.h <<\_ACEOF 2239 #define SVN_REVISION "53 6"2239 #define SVN_REVISION "538" 2240 2240 _ACEOF 2241 2241 … … 5221 5221 # values after options handling. 5222 5222 ac_log=" 5223 This file was extended by onioncat $as_me 0.2.2.r53 6, which was5223 This file was extended by onioncat $as_me 0.2.2.r538, which was 5224 5224 generated by GNU Autoconf 2.62. Invocation command line was 5225 5225 … … 5274 5274 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 5275 5275 ac_cs_version="\\ 5276 onioncat config.status 0.2.2.r53 65276 onioncat config.status 0.2.2.r538 5277 5277 configured by $0, generated by GNU Autoconf 2.62, 5278 5278 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -
trunk/src/Makefile.am
r534 r538 1 1 bin_PROGRAMS = ocat 2 2 ocat_SOURCES = ocat.c ocatlog.c ocatroute.c ocatthread.c ocattun.c ocatv6conv.c ocatcompat.c ocatpeer.c ocatsetup.c ocatipv4route.c ocateth.c ocatsocks.c ocatlibe.c ocatctrl.c ocatipv6route.c ocaticmp.c ocat_wintuntap.c ocat_netdesc.c 3 include_HEADERS = ocat.h ocat_netdesc.h strlcpy.c strlcat.c 3 noinst_HEADERS = ocat.h ocat_netdesc.h strlcpy.c strlcat.c 4 AM_CFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" 4 5 5 6 install-exec-hook: -
trunk/src/Makefile.in
r534 r538 40 40 bin_PROGRAMS = ocat$(EXEEXT) 41 41 subdir = src 42 DIST_COMMON = $( include_HEADERS) $(srcdir)/Makefile.am \42 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ 43 43 $(srcdir)/Makefile.in 44 44 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 50 50 CONFIG_HEADER = $(top_builddir)/config.h 51 51 CONFIG_CLEAN_FILES = 52 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"52 am__installdirs = "$(DESTDIR)$(bindir)" 53 53 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) 54 54 PROGRAMS = $(bin_PROGRAMS) … … 71 71 SOURCES = $(ocat_SOURCES) 72 72 DIST_SOURCES = $(ocat_SOURCES) 73 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 74 am__vpath_adj = case $$p in \ 75 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 76 *) f=$$p;; \ 77 esac; 78 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; 79 includeHEADERS_INSTALL = $(INSTALL_HEADER) 80 HEADERS = $(include_HEADERS) 73 HEADERS = $(noinst_HEADERS) 81 74 ETAGS = etags 82 75 CTAGS = ctags … … 171 164 target_alias = @target_alias@ 172 165 ocat_SOURCES = ocat.c ocatlog.c ocatroute.c ocatthread.c ocattun.c ocatv6conv.c ocatcompat.c ocatpeer.c ocatsetup.c ocatipv4route.c ocateth.c ocatsocks.c ocatlibe.c ocatctrl.c ocatipv6route.c ocaticmp.c ocat_wintuntap.c ocat_netdesc.c 173 include_HEADERS = ocat.h ocat_netdesc.h strlcpy.c strlcat.c 166 noinst_HEADERS = ocat.h ocat_netdesc.h strlcpy.c strlcat.c 167 AM_CFLAGS = -DSYSCONFDIR=\"$(sysconfdir)\" 174 168 all: all-am 175 169 … … 271 265 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 272 266 uninstall-info-am: 273 install-includeHEADERS: $(include_HEADERS)274 @$(NORMAL_INSTALL)275 test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"276 @list='$(include_HEADERS)'; for p in $$list; do \277 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \278 f=$(am__strip_dir) \279 echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \280 $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \281 done282 283 uninstall-includeHEADERS:284 @$(NORMAL_UNINSTALL)285 @list='$(include_HEADERS)'; for p in $$list; do \286 f=$(am__strip_dir) \287 echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \288 rm -f "$(DESTDIR)$(includedir)/$$f"; \289 done290 267 291 268 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) … … 368 345 all-am: Makefile $(PROGRAMS) $(HEADERS) 369 346 installdirs: 370 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(includedir)"; do \347 for dir in "$(DESTDIR)$(bindir)"; do \ 371 348 test -z "$$dir" || $(mkdir_p) "$$dir"; \ 372 349 done … … 415 392 info-am: 416 393 417 install-data-am: install-includeHEADERS394 install-data-am: 418 395 419 396 install-exec-am: install-binPROGRAMS … … 444 421 ps-am: 445 422 446 uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ 447 uninstall-info-am 423 uninstall-am: uninstall-binPROGRAMS uninstall-info-am 448 424 449 425 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ … … 452 428 html-am info info-am install install-am install-binPROGRAMS \ 453 429 install-data install-data-am install-exec install-exec-am \ 454 install-exec-hook install-includeHEADERS install-info \ 455 install-info-am install-man install-strip installcheck \ 456 installcheck-am installdirs maintainer-clean \ 457 maintainer-clean-generic mostlyclean mostlyclean-compile \ 458 mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ 459 uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \ 430 install-exec-hook install-info install-info-am install-man \ 431 install-strip installcheck installcheck-am installdirs \ 432 maintainer-clean maintainer-clean-generic mostlyclean \ 433 mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ 434 tags uninstall uninstall-am uninstall-binPROGRAMS \ 460 435 uninstall-info-am 461 436 -
trunk/src/cygwin/Makefile.am
r486 r538 1 include_HEADERS = ocat_cygwin.h openbsd_netinet_icmp6.h openbsd_netinet_if_ether.h openbsd_netinet_ip6.h1 noinst_HEADERS = ocat_cygwin.h openbsd_netinet_icmp6.h openbsd_netinet_if_ether.h openbsd_netinet_ip6.h 2 2 -
trunk/src/cygwin/Makefile.in
r534 r538 38 38 host_triplet = @host@ 39 39 subdir = src/cygwin 40 DIST_COMMON = $( include_HEADERS) $(srcdir)/Makefile.am \40 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ 41 41 $(srcdir)/Makefile.in 42 42 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 50 50 SOURCES = 51 51 DIST_SOURCES = 52 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 53 am__vpath_adj = case $$p in \ 54 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 55 *) f=$$p;; \ 56 esac; 57 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; 58 am__installdirs = "$(DESTDIR)$(includedir)" 59 includeHEADERS_INSTALL = $(INSTALL_HEADER) 60 HEADERS = $(include_HEADERS) 52 HEADERS = $(noinst_HEADERS) 61 53 ETAGS = etags 62 54 CTAGS = ctags … … 150 142 sysconfdir = @sysconfdir@ 151 143 target_alias = @target_alias@ 152 include_HEADERS = ocat_cygwin.h openbsd_netinet_icmp6.h openbsd_netinet_if_ether.h openbsd_netinet_ip6.h144 noinst_HEADERS = ocat_cygwin.h openbsd_netinet_icmp6.h openbsd_netinet_if_ether.h openbsd_netinet_ip6.h 153 145 all: all-am 154 146 … … 184 176 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 185 177 uninstall-info-am: 186 install-includeHEADERS: $(include_HEADERS)187 @$(NORMAL_INSTALL)188 test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"189 @list='$(include_HEADERS)'; for p in $$list; do \190 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \191 f=$(am__strip_dir) \192 echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \193 $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \194 done195 196 uninstall-includeHEADERS:197 @$(NORMAL_UNINSTALL)198 @list='$(include_HEADERS)'; for p in $$list; do \199 f=$(am__strip_dir) \200 echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \201 rm -f "$(DESTDIR)$(includedir)/$$f"; \202 done203 178 204 179 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) … … 281 256 all-am: Makefile $(HEADERS) 282 257 installdirs: 283 for dir in "$(DESTDIR)$(includedir)"; do \284 test -z "$$dir" || $(mkdir_p) "$$dir"; \285 done286 258 install: install-am 287 259 install-exec: install-exec-am … … 326 298 info-am: 327 299 328 install-data-am: install-includeHEADERS300 install-data-am: 329 301 330 302 install-exec-am: … … 352 324 ps-am: 353 325 354 uninstall-am: uninstall-in cludeHEADERS uninstall-info-am326 uninstall-am: uninstall-info-am 355 327 356 328 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ … … 358 330 dvi-am html html-am info info-am install install-am \ 359 331 install-data install-data-am install-exec install-exec-am \ 360 install-includeHEADERS install-info install-info-am \ 361 install-man install-strip installcheck installcheck-am \ 362 installdirs maintainer-clean maintainer-clean-generic \ 363 mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ 364 uninstall uninstall-am uninstall-includeHEADERS \ 365 uninstall-info-am 332 install-info install-info-am install-man install-strip \ 333 installcheck installcheck-am installdirs maintainer-clean \ 334 maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ 335 pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am 366 336 367 337 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
trunk/src/ocat.c
r536 r538 32 32 " -C disable local controller interface\n" 33 33 " -d <n> set debug level to n, default = %d\n" 34 " -f <config_file> read config from config_file \n"34 " -f <config_file> read config from config_file (default = %s)\n" 35 35 " -i convert onion hostname to IPv6 and exit\n" 36 36 " -I GarliCat mode, use I2P instead of Tor\n" … … 53 53 OCAT_DIR, NDESC(clog_file), CNF(create_clog), 54 54 CNF(daemon), CNF(daemon) ^ 1, 55 CNF(debug_level), NDESC(listen_port),55 CNF(debug_level), CNF(config_file), NDESC(listen_port), 56 56 CNF(pid_file), 57 57 CNF(ocat_dest_port), ntohs(CNF(socks_dst)->sin_port), … … 271 271 272 272 273 int main(int argc, char *argv[]) 274 { 275 char *s, ip6addr[INET6_ADDRSTRLEN], hw[20], def[100], pwdbuf[SIZE_1K]; 276 int c, runasroot = 0; 277 struct passwd *pwd, pwdm; 278 int urlconv = 0, mode_detect = 0; 279 280 init_setup(); 281 // detect network type by command file name 282 // FIXME: this should be not hardcoded in that way 283 // FIXME: basename() should better be used instead of strstr() 284 if (strstr(argv[0], "gcat")) 285 { 286 CNF(net_type) = NTYPE_I2P; 287 snprintf(def, 100, "127.0.0.1:%d", NDESC(listen_port)); 288 post_init_setup(); 289 mode_detect = 1; 290 } 291 292 while ((c = getopt(argc, argv, "abBCd:f:hrRiIopl:t:T:s:u:4L:P:")) != -1) 273 void parse_opt_early(int argc, char *argv[]) 274 { 275 int c; 276 277 opterr = 0; 278 while ((c = getopt(argc, argv, "f:hI")) != -1) 293 279 switch (c) 294 280 { 281 case 'f': 282 free(CNF(config_file)); 283 CNF(config_file) = optarg; 284 CNF(config_read) = 0; 285 break; 286 287 case 'I': 288 CNF(net_type) = NTYPE_I2P; 289 break; 290 case 'h': 291 usage(argv[0]); 292 exit(1); 293 case '?': 294 break; 295 } 296 } 297 298 299 int parse_opt(int argc, char *argv[]) 300 { 301 int c, urlconv = 0; 302 303 opterr = 1; 304 optind = 1; 305 while ((c = getopt(argc, argv, "f:IabBCd:rRiopl:t:T:s:u:4L:P:")) != -1) 306 switch (c) 307 { 308 // those options are parsed in parse_opt_early() 309 case 'f': 310 case 'I': 311 break; 312 295 313 case 'a': 296 314 CNF(create_clog) = 1; … … 313 331 break; 314 332 315 case 'f':316 CNF(config_file) = optarg;317 CNF(config_read) = 0;318 break;319 320 333 case 'i': 321 334 urlconv = 1; 322 break;323 324 case 'I':325 CNF(net_type) = NTYPE_I2P;326 335 break; 327 336 … … 354 363 355 364 case 'r': 356 runasroot= 1;365 CNF(runasroot) = 1; 357 366 CNF(usrname) = "root"; 358 367 break; … … 385 394 break; 386 395 387 case 'h':388 396 default: 389 397 usage(argv[0]); … … 391 399 } 392 400 393 if (!mode_detect) 394 { 401 return urlconv; 402 } 403 404 405 int main(int argc, char *argv[]) 406 { 407 char *s, ip6addr[INET6_ADDRSTRLEN], hw[20], def[100], pwdbuf[SIZE_1K]; 408 int c; 409 struct passwd *pwd, pwdm; 410 int urlconv = 0, mode_detect = 0; 411 412 init_setup(); 413 // detect network type by command file name 414 // FIXME: this should be not hardcoded in that way 415 // FIXME: basename() should better be used instead of strstr() 416 if (strstr(argv[0], "gcat")) 417 { 418 CNF(net_type) = NTYPE_I2P; 395 419 snprintf(def, 100, "127.0.0.1:%d", NDESC(listen_port)); 396 420 post_init_setup(); 397 } 421 mode_detect = 1; 422 } 423 424 parse_opt_early(argc, argv); 425 426 if (!mode_detect) 427 { 428 snprintf(def, 100, "127.0.0.1:%d", NDESC(listen_port)); 429 post_init_setup(); 430 } 431 432 if ((c = open(CNF(config_file), O_RDONLY)) == -1) 433 CNF(config_failed) = errno; 434 else 435 ctrl_handler((void*) (long) c); 436 437 urlconv = parse_opt(argc, argv); 398 438 399 439 // usage output must be after mode detection (Tor/I2P) … … 417 457 (void) init_ocat_thread("main"); 418 458 detach_thread(); 459 460 if (CNF(config_failed)) 461 log_msg(LOG_NOTICE, "could not open config file %s: %s", CNF(config_file), strerror(CNF(config_failed))); 419 462 420 463 if (urlconv == 2) … … 461 504 462 505 log_msg(LOG_INFO, "%s", CNF(version)); 463 464 #if 0465 if (CNF(config_file))466 {467 log_msg(LOG_INFO, "reading config file %s", CNF(config_file));468 if ((c = open(CNF(config_file), O_RDONLY)) == -1)469 log_msg(LOG_ERR, "error opening file: %s", strerror(errno)), exit(1);470 ctrl_handler((void*) c);471 }472 #endif473 506 474 507 memcpy(&CNF(ocat_hwaddr[3]), &CNF(ocat_addr.s6_addr[13]), 3); … … 528 561 mk_pid_file(pwd->pw_uid); 529 562 530 if (! runasroot&& !getuid())563 if (!CNF(runasroot) && !getuid()) 531 564 { 532 565 log_msg(LOG_INFO, "running as root, changing uid/gid to %s (uid %d/gid %d)", CNF(usrname), pwd->pw_uid, pwd->pw_gid); … … 562 595 #endif 563 596 564 // reading config file565 if (CNF(config_file))566 {567 log_msg(LOG_INFO, "reading config file %s", CNF(config_file));568 if ((c = open(CNF(config_file), O_RDONLY)) == -1)569 log_msg(LOG_ERR, "error opening file: %s", strerror(errno)), exit(1);570 ctrl_handler((void*) (long) c);571 }572 573 597 // install signal handler 574 598 install_sig(); -
trunk/src/ocat.h
r536 r538 220 220 #define NTYPE_I2P 1 221 221 222 #ifndef SYSCONFDIR 223 #define SYSCONFDIR "/etc" 224 #endif 222 225 223 226 struct OcatSetup … … 257 260 char *config_file; 258 261 int config_read; 262 int config_failed; 259 263 int use_tap; 260 264 //! local OnionCat MAC address -
trunk/src/ocat_netdesc.c
r536 r538 33 33 TOR_OCAT_CONNECT_LOG, 34 34 TOR_PID_FILE, 35 "ocat.conf", 35 36 }, 36 37 { … … 45 46 I2P_OCAT_CONNECT_LOG, 46 47 I2P_PID_FILE, 48 "gcat.conf", 47 49 }, 48 50 }; -
trunk/src/ocat_netdesc.h
r536 r538 39 39 char *clog_file; 40 40 char *pid_file; 41 char *config_file; 41 42 }; 42 43 -
trunk/src/ocatctrl.c
r535 r538 38 38 int fd, c; 39 39 FILE *ff, *fo; 40 char buf[FRAME_SIZE], addrstr[INET6_ADDRSTRLEN], onionstr[NDESC(name_size)], timestr[32], *s, *tokbuf ;40 char buf[FRAME_SIZE], addrstr[INET6_ADDRSTRLEN], onionstr[NDESC(name_size)], timestr[32], *s, *tokbuf, *bufp; 41 41 int rlen, cfd; 42 42 struct tm *tm; … … 72 72 } 73 73 log_debug("fd %d fdopen'ed \"r\"", fd); 74 fo = CNF(logf) ;74 fo = CNF(logf) ? CNF(logf) : stderr; 75 75 //CNF(config_read) = 1; 76 76 } … … 133 133 continue; 134 134 135 if (! strtok_r(buf, " \t\r\n", &tokbuf))135 if (!(bufp = strtok_r(buf, " \t\r\n", &tokbuf))) 136 136 continue; 137 137 138 138 // "exit"/"quit" => terminate thread 139 if (!strncmp(buf , "exit", 4) || !strncmp(buf, "quit", 4))139 if (!strncmp(bufp, "exit", 4) || !strncmp(bufp, "quit", 4)) 140 140 break; 141 141 // "status" 142 else if (!strcmp(buf , "status"))142 else if (!strcmp(bufp, "status")) 143 143 { 144 144 lock_peers(); … … 159 159 unlock_peers(); 160 160 } 161 else if (!strcmp(buf , "close"))162 { 163 cfd = atoi( &buf[6]);161 else if (!strcmp(bufp, "close")) 162 { 163 cfd = atoi(bufp +6); 164 164 lock_peers(); 165 165 for (peer = get_first_peer(); peer; peer = peer->next) … … 178 178 unlock_peers(); 179 179 } 180 else if (!strcmp(buf , "threads"))180 else if (!strcmp(bufp, "threads")) 181 181 { 182 182 print_threads(ff); 183 183 } 184 else if (!strcmp(buf , "terminate"))184 else if (!strcmp(bufp, "terminate")) 185 185 { 186 186 log_msg(LOG_INFO, "terminate request from control port"); 187 187 kill(getpid(), SIGINT); 188 188 } 189 else if (!strcmp(buf , "route"))189 else if (!strcmp(bufp, "route")) 190 190 { 191 191 if (rlen > 6) 192 192 { 193 if ((c = parse_route( &buf[6])) == E_RT_SYNTAX)194 if ((c = ipv6_parse_route( &buf[6])) > 0)193 if ((c = parse_route(bufp + 6)) == E_RT_SYNTAX) 194 if ((c = ipv6_parse_route(bufp + 6)) > 0) 195 195 c = 0; 196 196 switch (c) … … 224 224 } 225 225 } 226 else if (!strcmp(buf , "connect"))226 else if (!strcmp(bufp, "connect")) 227 227 { 228 228 if ((s = strtok_r(NULL, " \t\r\n", &tokbuf))) 229 229 { 230 230 if ((strlen(s) != 16) || (oniontipv6(s, &in6) == -1)) 231 fprintf(ff, "ERR \"%s\" not valid .onion-URL\n", &buf[8]);231 fprintf(ff, "ERR \"%s\" not valid .onion-URL\n", bufp + 8); 232 232 else 233 233 { … … 243 243 fprintf(ff, "ERR missing args\n"); 244 244 } 245 else if (!strcmp(buf , "macs"))245 else if (!strcmp(bufp, "macs")) 246 246 { 247 247 print_mac_tbl(ff); 248 248 } 249 else if (!strcmp(buf , "queue"))249 else if (!strcmp(bufp, "queue")) 250 250 { 251 251 print_socks_queue((FILE*) (long) pfd[1]); … … 258 258 } 259 259 } 260 else if (!strcmp(buf , "setup"))260 else if (!strcmp(bufp, "setup")) 261 261 { 262 262 print_setup_struct(ff); 263 263 } 264 else if (!strcmp(buf , "version"))264 else if (!strcmp(bufp, "version")) 265 265 { 266 266 fprintf(ff, "%s\n", CNF(version)); 267 267 } 268 else if (!strcmp(buf , "help") || !strcmp(buf, "?"))268 else if (!strcmp(bufp, "help") || !strcmp(bufp, "?")) 269 269 { 270 270 fprintf(fo, -
trunk/src/ocatsetup.c
r536 r538 57 57 //ADDR4_PREFIX, ADDR4_MASK 58 58 {0}, 0, 59 NULL, 1, 59 // config_file, config_read, config_failed 60 NULL, 0, 0, 60 61 #ifdef __CYGWIN__ 61 62 1, … … 148 149 void post_init_setup(void) 149 150 { 151 size_t l; 150 152 setup_.ocat_addr4 = NDESC(prefix4); 151 153 setup_.ocat_addr4_mask = NDESC(addr4_mask); 152 154 setup_.ocat_dest_port = NDESC(vdest_port); 153 155 setup_.ocat_ctrl_port = NDESC(ctrl_port); 156 157 l = strlen(SYSCONFDIR) + strlen(NDESC(config_file)) + 2; 158 if ((setup_.config_file = malloc(l)) != NULL) 159 snprintf(setup_.config_file, l, "%s/%s", SYSCONFDIR, NDESC(config_file)); 160 else 161 log_msg(LOG_WARNING, "could not get memory for config file string: \"%s\"", strerror(errno)); 154 162 155 163 if (!setup_.socks_dst->sin_port)
Note: See TracChangeset
for help on using the changeset viewer.
