1 --- src/main.h.orig 2008-02-02 04:02:47.000000000 +0200
2 +++ src/main.h 2009-05-21 12:34:54.861111456 +0300
5 //DB// lang.c variables for DB Hub 0.4
11 int new_human_user(int sock);
12 --- src/main.c.orig 2008-02-02 20:47:46.000000000 +0200
13 +++ src/main.c 2009-05-21 12:44:12.277722034 +0300
15 { "version", no_argument, 0, 'v'},
16 { "workdir", required_argument, 0, 'w'},
17 { "logfile", required_argument, 0, 'l'},
18 + { "bind", required_argument, 0, 'b'},
19 { "debug", optional_argument, 0, 'd'},
21 { "uid", required_argument, 0, 'u'},
22 @@ -4028,17 +4029,17 @@
23 snprintf(pmspammer, 50, "noone");
27 /* Switch to option processing routines to handle arguments */
30 - while ( (optres=getopt_long(argc, argv, "shvu:g:w:l:d::", long_options, &optindex))!=-1){
31 + while ( (optres=getopt_long(argc, argv, "shvb:u:g:w:l:d::", long_options, &optindex))!=-1){
33 - while ( (optres=getopt_long(argc, argv, "shvw:l:d::", long_options, &optindex))!=-1){
34 + while ( (optres=getopt_long(argc, argv, "shvb:w:l:d::", long_options, &optindex))!=-1){
38 printf("DB Hub, version %s\n", VERSION);
39 + printf(" -b, --bind ip : Bind to ip.\n");
40 printf(" -d, --debug [level] : Debug mode. Prevents DB Hub from making itself a\n background daemon. Optional level ist verbosity.\n");
41 printf(" -h, --help : Print this help and exit.\n");+ printf(" -v, --version : Print version.\n");
42 printf(" -l, --logfile <logfile> : Set logfile.\n");
48 + strncpy(bindaddr, optarg, (sizeof(bindaddr)-1));
52 if (optarg) verbosity=atoi(optarg);
53 --- src/network.c.orig 2008-02-01 01:41:36.000000000 +0200
54 +++ src/network.c 2009-05-21 12:46:01.171044985 +0300
56 if (set_to_localhost) {
57 inet_pton(AF_INET, "127.0.0.1", &hub_addr.sin_addr);
59 - hub_addr.sin_addr.s_addr = INADDR_ANY;
61 + inet_pton(AF_INET, bindaddr, &hub_addr.sin_addr);
63 + hub_addr.sin_addr.s_addr = INADDR_ANY;
65 hub_addr.sin_port = htons(port);
70 hub_addr.sin_family = AF_INET;
71 - hub_addr.sin_addr.s_addr = INADDR_ANY;
73 + inet_pton(AF_INET, bindaddr, &hub_addr.sin_addr);
75 + hub_addr.sin_addr.s_addr = INADDR_ANY;
76 hub_addr.sin_port = htons(port);
77 memset(hub_addr.sin_zero, 0, 8);