source:
freewrt/package/ez-ipupdate/patches/debian-subset.patch@
428f140
| Last change on this file since 428f140 was 475ad56, checked in by , 20 years ago | |
|---|---|
|
|
| File size: 18.5 KB | |
-
ez-ipupdate-3.0.11b8
old new 139 139 #if HAVE_SIGNAL_H 140 140 # include <signal.h> 141 141 #endif 142 #if HAVE_TIME_H 143 # include <time.h> 144 #endif 142 145 #if HAVE_SYS_TIME_H 143 146 # include <sys/time.h> 144 147 #endif … … 165 168 #endif 166 169 167 170 168 #if __ linux__ || __SVR4 || __OpenBSD__ || __FreeBSD__ || __NetBSD__171 #if __GLIBC__ || __SVR4 || __OpenBSD__ || __FreeBSD__ || __NetBSD__ 169 172 # define IF_LOOKUP 1 170 173 # include <sys/ioctl.h> 171 174 # include <net/if.h> … … 640 643 fprintf(stdout, " -q, --quiet \t\t\tbe quiet\n"); 641 644 fprintf(stdout, " -r, --retrys <num>\t\tnumber of trys (default: 1)\n"); 642 645 fprintf(stdout, " -R, --run-as-user <user>\tchange to <user> for running, be ware\n\t\t\t\tthat this can cause problems with handeling\n\t\t\t\tSIGHUP properly if that user can't read the\n\t\t\t\tconfig file. also it can't write it's pid file \n\t\t\t\tto a root directory\n"); 643 fprintf(stdout, " -Q, --run-as-euser <user>\tchange to effective <user> for running, \n\t\t\t\tthis is NOT secure but it does solve the \n\t\t\t\tproblems with run-as-user and config files and \n\t\t\t\tpid files .\n");646 fprintf(stdout, " -Q, --run-as-euser <user>\tchange to effective <user> for running, \n\t\t\t\tthis is NOT secure but it does solve the \n\t\t\t\tproblems with run-as-user and config files and \n\t\t\t\tpid files\n"); 644 647 fprintf(stdout, " -s, --server <server[:port]>\tthe server to connect to\n"); 645 648 fprintf(stdout, " -S, --service-type <server>\tthe type of service that you are using\n"); 646 649 width = fprintf(stdout, "\t\t\t\ttry one of: ") + 4*7; … … 682 685 683 686 void print_signalhelp( void ) 684 687 { 685 fprintf(stdout, "\nsignals are only really used when in daemon mode .\n\n");688 fprintf(stdout, "\nsignals are only really used when in daemon mode\n\n"); 686 689 fprintf(stdout, "signals: \n"); 687 690 fprintf(stdout, " HUP\t\tcauses it to re-read its config file\n"); 688 691 fprintf(stdout, " TERM\t\twake up and possibly perform an update\n"); … … 693 696 #if HAVE_SIGNAL_H 694 697 RETSIGTYPE sigint_handler(int sig) 695 698 { 696 char message[] = "inter upted.\n";699 char message[] = "interrupted\n"; 697 700 close(client_sockfd); 698 701 write(2, message, sizeof(message)-1); 699 702 … … 704 707 } 705 708 #endif 706 709 710 #if HAVE_SYSLOG_H 711 closelog(); 712 #endif 713 707 714 exit(1); 708 715 } 709 716 RETSIGTYPE generic_sig_handler(int sig) … … 798 805 sprintf(buf, "message incomplete because your OS sucks: %s\n", fmt); 799 806 #endif 800 807 801 syslog(LOG_NOTICE, buf);808 syslog(LOG_NOTICE, "%s", buf); 802 809 } 803 810 else 804 811 { … … 1439 1446 if(!(options & OPT_QUIET)) 1440 1447 { 1441 1448 fprintf(stderr, 1442 "connected to %s (%s) on port %d .\n",1449 "connected to %s (%s) on port %d\n", 1443 1450 host, 1444 1451 inet_ntoa(address.sin_addr), 1445 1452 ntohs(address.sin_port)); … … 1683 1690 close(client_sockfd); 1684 1691 return(-1); 1685 1692 } 1686 if(strstr(buf, "\ r\n") > 0)1693 if(strstr(buf, "\n") != NULL) 1687 1694 { 1688 1695 break; 1689 1696 } … … 1702 1709 1703 1710 if(options & OPT_DAEMON) 1704 1711 { 1705 fprintf(stderr, "no compile time default service was set thereforyou must "1706 "specify a service type .\n");1712 fprintf(stderr, "no compile time default service was set, you must " 1713 "specify a service type\n"); 1707 1714 1708 1715 return(-1); 1709 1716 } … … 2039 2046 } 2040 2047 else if(strstr(buf, "\nnumhost") != NULL) 2041 2048 { 2042 show_message(" Too many or too few hosts found\n");2049 show_message("too many or too few hosts found\n"); 2043 2050 retval = UPDATERES_SHUTDOWN; 2044 2051 } 2045 2052 else if(strstr(buf, "\ndnserr") != NULL) … … 2051 2058 } 2052 2059 else if(strstr(buf, "\n911") != NULL) 2053 2060 { 2054 show_message(" Ahhhh! call 911!\n");2061 show_message("ahhhh! call 911!\n"); 2055 2062 retval = UPDATERES_SHUTDOWN; 2056 2063 } 2057 2064 else if(strstr(buf, "\n999") != NULL) 2058 2065 { 2059 show_message(" Ahhhh! call 999!\n");2066 show_message("ahhhh! call 999!\n"); 2060 2067 retval = UPDATERES_SHUTDOWN; 2061 2068 } 2062 2069 else if(strstr(buf, "\n!donator") != NULL) 2063 2070 { 2064 show_message("a feature requested is only available to donators, please donate .\n", host);2071 show_message("a feature requested is only available to donators, please donate\n", host); 2065 2072 retval = UPDATERES_OK; 2066 2073 } 2067 2074 // this one should be last as it is a stupid string to signify waits … … 2095 2102 sprintf(reason, "problem parsing reason for wait response"); 2096 2103 } 2097 2104 2098 show_message(" Wait response received, waiting for %s before next update.\n",2105 show_message("wait response received, waiting for %s before next update\n", 2099 2106 format_time(howlong)); 2100 show_message(" Wait response reason: %d\n", N_STR(reason));2107 show_message("wait response reason: %d\n", N_STR(reason)); 2101 2108 sleep(howlong); 2102 2109 retval = UPDATERES_ERROR; 2103 2110 } … … 3370 3377 { 3371 3378 if(!(options & OPT_QUIET)) 3372 3379 { 3373 fprintf(stderr, "warning: for GNUDIP the \"address\" par pameter is only used if set to \"0.0.0.0\" thus making an offline request.\n");3380 fprintf(stderr, "warning: for GNUDIP the \"address\" parameter is only used if set to \"0.0.0.0\" thus making an offline request\n"); 3374 3381 } 3375 3382 } 3376 3383 … … 3392 3399 3393 3400 // send an offline request if address 0.0.0.0 is used 3394 3401 // otherwise, we ignore the address and send an update request 3395 gnudip_request[0] = strcmp(address, "0.0.0.0") == 0 ? '1' : '0';3402 gnudip_request[0] = address && strcmp(address, "0.0.0.0") == 0 ? '1' : '0'; 3396 3403 gnudip_request[1] = '\0'; 3397 3404 3398 3405 // find domainname … … 3943 3950 break; 3944 3951 3945 3952 case 201: 3946 show_message(" Last update was less than %d seconds ago.\n", 300);3953 show_message("last update was less than %d seconds ago\n", 300); 3947 3954 return(UPDATERES_ERROR); 3948 3955 break; 3949 3956 3950 3957 case 202: 3951 show_message(" Server error.\n");3958 show_message("server error\n"); 3952 3959 return(UPDATERES_ERROR); 3953 3960 break; 3954 3961 3955 3962 case 203: 3956 show_message(" Failure because account is frozen (by admin).\n");3963 show_message("failure because account is frozen (by admin)\n"); 3957 3964 return(UPDATERES_SHUTDOWN); 3958 3965 break; 3959 3966 3960 3967 case 204: 3961 show_message(" Failure because account is locked (by user).\n");3968 show_message("failure because account is locked (by user)\n"); 3962 3969 return(UPDATERES_SHUTDOWN); 3963 3970 break; 3964 3971 … … 4215 4222 4216 4223 switch(ret) 4217 4224 { 4218 char *p;4219 4220 4225 case -1: 4221 4226 if(!(options & OPT_QUIET)) 4222 4227 { … … 4349 4354 case SIGHUP: 4350 4355 if(config_file) 4351 4356 { 4352 show_message("SIGHUP rec ieved, re-reading config file\n");4357 show_message("SIGHUP received, re-reading config file\n"); 4353 4358 if(parse_conf_file(config_file, conf_commands) != 0) 4354 4359 { 4355 4360 show_message("error parsing config file \"%s\"\n", config_file); … … 4384 4389 4385 4390 int main(int argc, char **argv) 4386 4391 { 4392 char *tmp; 4387 4393 int ifresolve_warned = 0; 4388 4394 int i; 4389 4395 int retval = 1; … … 4395 4401 mcheck(NULL); 4396 4402 #endif 4397 4403 4398 dprintf((stderr, "star ing...\n"));4404 dprintf((stderr, "starting...\n")); 4399 4405 4400 program_name = argv[0]; 4406 tmp = strrchr(argv[0], '/'); 4407 program_name = tmp ? tmp + 1 : argv[0]; 4401 4408 options = 0; 4402 4409 *user = '\0'; 4403 4410 timeout.tv_sec = DEFAULT_TIMEOUT; … … 4417 4424 4418 4425 if(!(options & OPT_QUIET) && !(options & OPT_DAEMON)) 4419 4426 { 4420 fprintf(stderr, " ez-ipupdate Version %s\nCopyright (C) 1998-2001 Angus Mackay.\n", VERSION);4427 fprintf(stderr, "%s Version %s\nCopyright (C) 1998-2001 Angus Mackay\n", program_name, VERSION); 4421 4428 } 4422 4429 4423 4430 dprintf((stderr, "options: 0x%04X\n", options)); … … 4434 4441 { 4435 4442 if(service->check_info() != 0) 4436 4443 { 4437 fprintf(stderr, "invalid data to perform requested action .\n");4444 fprintf(stderr, "invalid data to perform requested action\n"); 4438 4445 exit(1); 4439 4446 } 4440 4447 } … … 4456 4463 dprintf((stderr, "user_name: %s\n", user_name)); 4457 4464 dprintf((stderr, "password: %s\n", password)); 4458 4465 } 4459 if(*user_name == '\0' )4466 if(*user_name == '\0' && !(options & OPT_DAEMON)) 4460 4467 { 4461 4468 printf("user name: "); 4462 4469 fgets(user_name, sizeof(user_name), stdin); 4463 4470 chomp(user_name); 4464 4471 } 4465 if(*password == '\0' )4472 if(*password == '\0' && !(options & OPT_DAEMON)) 4466 4473 { 4467 4474 strncpy(password, getpass("password: "), sizeof(password)); 4468 4475 } … … 4480 4487 4481 4488 if(service->check_info() != 0) 4482 4489 { 4483 fprintf(stderr, "invalid data to perform requested action .\n");4490 fprintf(stderr, "invalid data to perform requested action\n"); 4484 4491 exit(1); 4485 4492 } 4486 4493 … … 4503 4510 4504 4511 if(interface == NULL) 4505 4512 { 4506 fprintf(stderr, "invalid data to perform requested action .\n");4513 fprintf(stderr, "invalid data to perform requested action\n"); 4507 4514 fprintf(stderr, "you must provide an interface for daemon mode"); 4508 4515 exit(1); 4509 4516 } … … 4519 4526 if(fork() > 0) { exit(0); } /* parent */ 4520 4527 } 4521 4528 4529 # if HAVE_SYSLOG_H 4530 openlog(program_name, LOG_PID, LOG_DAEMON ); 4531 //options |= OPT_QUIET; 4532 # endif 4533 show_message("version %s, interface %s, host %s, server %s, service %s\n", 4534 VERSION, N_STR(interface), N_STR(host), server, service->title); 4535 4522 4536 #if HAVE_GETPID 4523 4537 if(pid_file && pid_file_create(pid_file) != 0) 4524 4538 { 4525 fprintf(stderr, "exiting...\n"); 4539 show_message("could not create pid file %s (%s), exiting\n", 4540 pid_file, strerror(errno)); 4541 #if HAVE_SYSLOG_H 4542 closelog(); 4543 #endif 4526 4544 exit(1); 4527 4545 } 4528 4546 #endif 4529 4547 4530 # if HAVE_SYSLOG_H4531 openlog(program_name, LOG_PID, LOG_USER );4532 options |= OPT_QUIET;4533 # endif4534 show_message("ez-ipupdate Version %s, Copyright (C) 1998-2001 Angus Mackay.\n",4535 VERSION);4536 show_message("%s started for interface %s host %s using server %s and service %s\n",4537 program_name, N_STR(interface), N_STR(host), server, service->title);4538 4539 4548 memset(&sin, 0, sizeof(sin)); 4540 4549 4541 4550 if(cache_file) … … 4560 4569 strftime(timebuf, sizeof(timebuf), "%Y/%m/%d %H:%M", ts); 4561 4570 show_message("got last update %s on %s from cache file\n", ipstr, timebuf); 4562 4571 } 4563 else 4572 else if(ipstr||ipdate) 4564 4573 { 4565 4574 show_message("malformed cache file: %s\n", cache_file); 4566 4575 } … … 4647 4656 } 4648 4657 else 4649 4658 { 4650 show_message("fail ureto update %s->%s (%s)\n",4659 show_message("failed to update %s->%s (%s)\n", 4651 4660 interface, inet_ntoa(sin.sin_addr), N_STR(host)); 4652 4661 memset(&sin, 0, sizeof(sin)); 4653 4662 … … 4671 4680 dprintf((stderr, "updateres: %d\n", updateres)); 4672 4681 if(updateres == UPDATERES_SHUTDOWN) 4673 4682 { 4674 show_message("shut ing down updater for %s due to fatal error\n",4683 show_message("shutting down updater for %s due to fatal error\n", 4675 4684 N_STR(host)); 4676 4685 4677 4686 if(notify_email && *notify_email != '\0') … … 4711 4720 #endif 4712 4721 4713 4722 #else 4714 fprintf(stderr, "sorry, this mode is only available on platforms thatthe ");4723 fprintf(stderr, "sorry, this mode is only available on platforms where the "); 4715 4724 fprintf(stderr, "IP address \ncan be determined. feel free to hack the code"); 4716 4725 fprintf(stderr, " though.\n"); 4717 4726 exit(1); … … 4799 4808 } 4800 4809 else 4801 4810 { 4802 show_message("could not resolve ip address for %s .\n", interface);4811 show_message("could not resolve ip address for %s\n", interface); 4803 4812 exit(1); 4804 4813 } 4805 4814 close(sock); -
ez-ipupdate-3.0.11b8
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # -
ez-ipupdate-3.0.11b8
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 10 10 host=mydomain.penguinpowered.com 11 11 interface=eth1 12 12 13 # if you use run-as ensure the user has permission to write this file 14 cache-file=/ tmp/ez-ipupdate.cache13 run-as-user=ez-ipupd 14 cache-file=/var/cache/ez-ipupdate/default-cache 15 15 16 16 # uncomment this once you have everything working how you want and you are 17 17 # ready to have ez-ipupdate running in the background all the time. to stop it -
ez-ipupdate-3.0.11b8
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 10 10 host=mydomain.whatever.com 11 11 interface=eth1 12 12 13 # if you use run-as ensure the user has permission to write this file 14 cache-file=/ tmp/ez-ipupdate.cache13 run-as-user=ez-ipupd 14 cache-file=/var/cache/ez-ipupdate/default-cache 15 15 16 16 # uncomment this once you have everything working how you want and you are 17 17 # ready to have ez-ipupdate running in the background all the time. to stop it -
example-dyndns.conf
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 12 12 interface=eth1 13 13 max-interval=2073600 14 14 15 # please create this file and ensure that the user that ez-ipupdate is running 16 # as has write permissions to it then uncomment this line, if you don't your 17 # dyndns account will probably get banned. if you run ez-ipupdate as root (bad 18 # idea, use "run-as-user") then you can just uncomment this line. 19 #cache-file=/etc/ez-ipupdate.cache.eth1 20 21 # for the mean time we'll just use a cache file in the temp directory 22 cache-file=/tmp/ez-ipupdate.cache 15 # if you don't use a cache file your dyndns account will probably get banned. 16 run-as-user=ez-ipupd 17 cache-file=/var/cache/ez-ipupdate/default-cache 23 18 24 19 # uncomment this once you have everything working how you want and you are 25 20 # ready to have ez-ipupdate running in the background all the time. to stop it -
ez-ipupdate-3.0.11b8
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 10 10 host=mydomain.ods.org 11 11 interface=eth1 12 12 13 # if you use run-as ensure the user has permission to write this file 14 cache-file=/ tmp/ez-ipupdate.cache13 run-as-user=ez-ipupd 14 cache-file=/var/cache/ez-ipupdate/default-cache 15 15 16 16 # uncomment this once you have everything working how you want and you are 17 17 # ready to have ez-ipupdate running in the background all the time. to stop it -
ez-ipupdate-3.0.11b8
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 14 14 max-interval=2073600 15 15 interface=eth1 16 16 17 # if you use run-as ensure the user has permission to write this file 18 cache-file=/ tmp/ez-ipupdate.cache17 run-as-user=ez-ipupd 18 cache-file=/var/cache/ez-ipupdate/default-cache 19 19 20 20 # uncomment this once you have everything working how you want and you are 21 21 # ready to have ez-ipupdate running in the background all the time. to stop it -
example-gnudip.conf
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 14 14 # any other value is ignored 15 15 #address=0.0.0.0 16 16 17 # if you use run-as ensure the user has permission to write this file 18 cache-file=/ tmp/ez-ipupdate.cache17 run-as-user=ez-ipupd 18 cache-file=/var/cache/ez-ipupdate/default-cache 19 19 20 20 # uncomment this once you have everything working how you want and you are 21 21 # ready to have ez-ipupdate running in the background all the time. to stop it -
example-easydns.conf
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 10 10 host=mydomain.whatever.com 11 11 interface=eth1 12 12 13 # if you use run-as ensure the user has permission to write this file 14 cache-file=/ tmp/ez-ipupdate.cache13 run-as-user=ez-ipupd 14 cache-file=/var/cache/ez-ipupdate/default-cache 15 15 16 16 # uncomment this once you have everything working how you want and you are 17 17 # ready to have ez-ipupdate running in the background all the time. to stop it -
example-justlinux.conf
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 10 10 host=mydomain.penguinpowered.com 11 11 interface=eth1 12 12 13 # if you use run-as ensure the user has permission to write this file 14 cache-file=/ tmp/ez-ipupdate.cache13 run-as-user=ez-ipupd 14 cache-file=/var/cache/ez-ipupdate/default-cache 15 15 16 16 # uncomment this once you have everything working how you want and you are 17 17 # ready to have ez-ipupdate running in the background all the time. to stop it -
ez-ipupdate-3.0.11b8
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 10 10 host=myhost 11 11 #interface=eth1 12 12 13 # if you use run-as ensure the user has permission to write this file 14 #cache-file=/tmp/ez-ipupdate.cache13 run-as-user=ez-ipupd 14 cache-file=/var/cache/ez-ipupdate/default-cache 15 15 16 16 # uncomment this once you have everything working how you want and you are 17 17 # ready to have ez-ipupdate running in the background all the time. to stop it -
example-heipv6tb.conf
old new 1 #!/usr/ local/bin/ez-ipupdate -c1 #!/usr/sbin/ez-ipupdate -c 2 2 # 3 3 # example config file for ez-ipupdate 4 4 # … … 11 11 interface=eth1 12 12 max-interval=2073600 13 13 14 # please create this file and ensure that the user that ez-ipupdate is running 15 # as has write permissions to it then uncomment this line, if you don't your 16 # dyndns account will probably get banned. if you run ez-ipupdate as root (bad 17 # idea, use "run-as-user") then you can just uncomment this line. 18 #cache-file=/etc/ez-ipupdate.cache.eth1 19 20 # for the mean time we'll just use a cache file in the temp directory 21 cache-file=/tmp/ez-ipupdate.cache 14 # if you don't use a cache file your account will probably get banned. 15 run-as-user=ez-ipupd 16 cache-file=/var/cache/ez-ipupdate/default-cache 22 17 23 18 # uncomment this once you have everything working how you want and you are 24 19 # ready to have ez-ipupdate running in the background all the time. to stop it
Note:
See TracBrowser
for help on using the repository browser.
