From 860b3e1cbc5d5961802b5b610bce12cdb3ca1b87 Mon Sep 17 00:00:00 2001 From: wilfried Date: Wed, 7 May 2003 08:33:19 +0000 Subject: [PATCH] update to 2.0.9 --- net/no-ip/Makefile | 14 ++-- net/no-ip/distinfo | 6 +- net/no-ip/patches/patch-Makefile | 33 ++++---- net/no-ip/patches/patch-no-ip_sh | 12 --- net/no-ip/patches/patch-noip2_c | 127 +++++++++++++++++++++++++++++++ net/no-ip/patches/patch-noip_c | 73 ------------------ net/no-ip/pkg/DEINSTALL | 4 +- net/no-ip/pkg/INSTALL | 61 --------------- net/no-ip/pkg/PLIST | 7 +- 9 files changed, 159 insertions(+), 178 deletions(-) delete mode 100644 net/no-ip/patches/patch-no-ip_sh create mode 100644 net/no-ip/patches/patch-noip2_c delete mode 100644 net/no-ip/patches/patch-noip_c delete mode 100644 net/no-ip/pkg/INSTALL diff --git a/net/no-ip/Makefile b/net/no-ip/Makefile index c29002e8ae0..a6cf7d98d2c 100644 --- a/net/no-ip/Makefile +++ b/net/no-ip/Makefile @@ -1,9 +1,10 @@ -# $OpenBSD: Makefile,v 1.2 2002/09/17 15:22:26 wilfried Exp $ +# $OpenBSD: Makefile,v 1.3 2003/05/07 08:33:19 wilfried Exp $ COMMENT= "No-IP.com Dynamic DNS client" -DISTNAME= noip_updater_v1.6 -PKGNAME= no-ip-1.6 +V= 2.0.9 +DISTNAME= noip-${V} +PKGNAME= no-ip-${V} CATEGORIES= net HOMEPAGE= http://www.no-ip.com/ @@ -22,13 +23,10 @@ MAKE_ENV= SYSCONFDIR="${SYSCONFDIR}" NO_REGRESS= Yes -ALL_TARGET= noip +ALL_TARGET= noip2 do-install: - ${INSTALL_PROGRAM} ${WRKBUILD}/noip ${PREFIX}/sbin - ${INSTALL_SCRIPT} ${WRKSRC}/no-ip.sh ${PREFIX}/sbin/no-ip - ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/no-ip/ - ${INSTALL_DATA} ${WRKSRC}/no-ip.conf.sample ${PREFIX}/share/examples/no-ip/ + ${INSTALL_PROGRAM} ${WRKBUILD}/noip2 ${PREFIX}/sbin ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/no-ip/ ${INSTALL_DATA} ${WRKSRC}/README.FIRST ${PREFIX}/share/doc/no-ip/ diff --git a/net/no-ip/distinfo b/net/no-ip/distinfo index 85ca153e436..13d27b14073 100644 --- a/net/no-ip/distinfo +++ b/net/no-ip/distinfo @@ -1,3 +1,3 @@ -MD5 (noip_updater_v1.6.tar.gz) = 6503e2e7d8ea35c304744a318b400a09 -RMD160 (noip_updater_v1.6.tar.gz) = 11a1bfd48793da703b3601d3937402cd357ff186 -SHA1 (noip_updater_v1.6.tar.gz) = 60bea63cfe0996d900b44fe21992bcb214dd7a3d +MD5 (noip-2.0.9.tar.gz) = b58c840661ec4b38742715442435140f +RMD160 (noip-2.0.9.tar.gz) = 8bda3390b891b3d3a282b9dfc561d9fd4da2ee29 +SHA1 (noip-2.0.9.tar.gz) = 1c16405bfa6dccb96e5d3560376c13ee7da0ea57 diff --git a/net/no-ip/patches/patch-Makefile b/net/no-ip/patches/patch-Makefile index bcb15c1850b..42ce509b28c 100644 --- a/net/no-ip/patches/patch-Makefile +++ b/net/no-ip/patches/patch-Makefile @@ -1,20 +1,25 @@ -$OpenBSD: patch-Makefile,v 1.1.1.1 2002/03/08 16:56:10 wilfried Exp $ ---- Makefile.orig Thu Oct 11 01:35:12 2001 -+++ Makefile Thu Mar 7 18:15:47 2002 -@@ -1,7 +1,5 @@ - TGT=noip - +$OpenBSD: patch-Makefile,v 1.2 2003/05/07 08:33:19 wilfried Exp $ +--- Makefile.orig Fri Jan 17 00:33:22 2003 ++++ Makefile Tue Apr 1 17:05:23 2003 +@@ -1,5 +1,4 @@ + TGT=noip2 -CC=gcc -- + + PREFIX=/usr/local + CONFDIR=${PREFIX}/etc +@@ -7,14 +6,13 @@ BINDIR=${PREFIX}/bin + # these defines are for linux and BSD LIBS= - ARCH=linux -@@ -11,7 +9,7 @@ ARCH=linux +-ARCH=linux + + # for solaris, uncomment the next two lines + # LIBS=-lsocket -lnsl # ARCH=sun - ${TGT}: noip.c -- ${CC} -O2 -g -D${ARCH} noip.c -o noip ${LIBS} -+ ${CC} ${CFLAGS} -DSYSCONFDIR=\"${SYSCONFDIR}\" -D${ARCH} noip.c -o noip ${LIBS} + ${TGT}: Makefile ${TGT}.c +- ${CC} -Wall -g -O2 -D${ARCH} -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS} ++ ${CC} -Wall -g -O2 -DPREFIX=\"${PREFIX}\" ${TGT}.c -o ${TGT} ${LIBS} - conf: - ./no-ip.sh + install: ${TGT} + cp ${TGT} ${BINDIR}/${TGT} diff --git a/net/no-ip/patches/patch-no-ip_sh b/net/no-ip/patches/patch-no-ip_sh deleted file mode 100644 index aaf103ad06a..00000000000 --- a/net/no-ip/patches/patch-no-ip_sh +++ /dev/null @@ -1,12 +0,0 @@ -$OpenBSD: patch-no-ip_sh,v 1.1.1.1 2002/03/08 16:56:10 wilfried Exp $ ---- no-ip.sh.orig Thu Oct 11 01:35:12 2001 -+++ no-ip.sh Thu Mar 7 11:28:58 2002 -@@ -89,7 +89,7 @@ done - # - if [ "$NAT" = "N" ] - then -- devs=`tail +3 /proc/net/dev | awk -F: '{print $1}' | tr -d ' '|tr '\n' ' '` -+ devs=`ifconfig -a | awk -F: '/flags=/ {print $1}' | tr '\n' ' '` - DEV=foo - while [ "$DEV" = "foo" ] - do diff --git a/net/no-ip/patches/patch-noip2_c b/net/no-ip/patches/patch-noip2_c new file mode 100644 index 00000000000..432454c591e --- /dev/null +++ b/net/no-ip/patches/patch-noip2_c @@ -0,0 +1,127 @@ +$OpenBSD: patch-noip2_c,v 1.1 2003/05/07 08:33:19 wilfried Exp $ +--- noip2.c.orig Sat Mar 8 16:56:04 2003 ++++ noip2.c Wed May 7 10:08:59 2003 +@@ -93,7 +93,8 @@ + #include + #include + #include +- ++#include ++#include + + #ifdef linux + #ifndef SIOCGIFADDR +@@ -153,11 +154,8 @@ + #define NOGROUP "@@NO_GROUP@@" + #define HOST 1 + #define GROUP 2 +-#ifndef PREFIX +- #define PREFIX "/usr/local" +-#endif +-#define CONFIG_FILEPATH PREFIX"/etc" +-#define CONFIG_FILENAME PREFIX"/etc/no-ip2.conf" ++#define CONFIG_FILEPATH "/etc" ++#define CONFIG_FILENAME "/etc/no-ip2.conf" + #define CONFSTRLEN 1024 + #define MAX_DEVLEN 16 + #define MAX_INSTANCE 4 +@@ -657,7 +655,7 @@ void save_IP() + void getip(char *p, char *device) + { + int fd; +- int *x; ++ struct sockaddr_in *sin; + struct ifreq ifr; + struct in_addr z; + +@@ -684,8 +682,8 @@ void getip(char *p, char *device) + return; + } + close(fd); +- x = (int *)&ifr.ifr_addr; // seems to be off by 2 bytes +- z.s_addr = x[1]; ++ sin = (struct sockaddr_in *)&ifr.ifr_addr; ++ z = sin->sin_addr; + strcpy(p, inet_ntoa(z)); + #ifdef DEBUG + if (my_instance ? my_instance->debug : debug) +@@ -1376,7 +1374,7 @@ int dynamic_update() + if (my_instance ? my_instance->debug : debug) + Msg("Running %s %s %s", buffer, p, tbuf); + #endif +- execl(buffer, p, tbuf, NULL); ++ execl(buffer, p, tbuf, (void*)0); + Msg("execl %s failed (%s)", buffer, strerror(errno)); + exit(0); // bad execute -- don't care! + default: // parent +@@ -1832,45 +1830,36 @@ void get_credentials(char *l, char *p) + ///////////////////////////////////////////////////////////////////////////// + int get_all_device_names(unsigned char *devs) + { +- +- int fd, i, devnum=0; +- int num_ifreq; ++ int devnum=0; + unsigned char *p, *q, *dq; +- struct ifreq *pIfr; +- struct ifconf Ifc; +- static struct ifreq IfcBuf[MAX_NET_DEVS]; +- +- Ifc.ifc_len = sizeof(IfcBuf); +- Ifc.ifc_buf = (char *) IfcBuf; +- +- if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { +- perror("socket()"); +- exit(1); ++ struct ifaddrs *ifap, *ifa; ++ if (getifaddrs(&ifap) != 0) { ++ return 0; + } +- if (ioctl(fd, SIOCGIFCONF, &Ifc) < 0) { +- perror("ioctl SIOCGIFCONF"); +- exit(1); +- } +- num_ifreq = Ifc.ifc_len / sizeof(struct ifreq); + dq = devs; // add new name into list +- for (pIfr=Ifc.ifc_req,i=0; iifr_name; +- if (strcmp("lo", p) == 0) +- continue; +- if (strchr(p, ':') != NULL) +- continue; +- devnum++; +- while (*p) +- *q++ = *p++; +- *q = 0; +- if (devnum >= MAX_NET_DEVS) { +- Msg(CMSG23, MAX_NET_DEVS); +- exit(1); +- } +- dq += LINELEN; ++ for (ifa = ifap; ifa; ifa = ifa->ifa_next) { ++ if (ifa->ifa_addr->sa_family == AF_LINK) { ++ struct if_data *ifd = (struct if_data *) ifa->ifa_data; ++ if (ifd->ifi_type != IFT_ETHER) ++ continue; ++ q = dq; // add new name into list ++ p = ifa->ifa_name; ++ if (strcmp("lo", p) == 0) ++ continue; ++ devnum++; ++ while (*p) ++ *q++ = *p++; ++ *q = 0; ++ if (devnum >= MAX_NET_DEVS) { ++ Msg(CMSG23, MAX_NET_DEVS); ++ exit(1); ++ } ++ dq += LINELEN; ++ } + } ++ freeifaddrs(ifap); + return devnum; ++ + } + ///////////////////////////////////////////////////////////////////////////// + void get_device_name(char *d) diff --git a/net/no-ip/patches/patch-noip_c b/net/no-ip/patches/patch-noip_c deleted file mode 100644 index beae8547812..00000000000 --- a/net/no-ip/patches/patch-noip_c +++ /dev/null @@ -1,73 +0,0 @@ -$OpenBSD: patch-noip_c,v 1.1.1.1 2002/03/08 16:56:10 wilfried Exp $ ---- noip.c.orig Thu Oct 11 01:48:12 2001 -+++ noip.c Fri Mar 8 17:40:50 2002 -@@ -94,9 +94,8 @@ - #define CLIENT_IP_PORT 8245 - #define OURBUFLEN 8192 - #define IPLEN 16 --#define SAVEDIPFILE "/tmp/no-ip_save" --#define CONFIG_FILENAME "/usr/local/lib/no-ip.conf" --#define CONFIG_FILENAME_ETC "/usr/local/etc/no-ip.conf" -+#define SAVEDIPFILE "/var/db/no-ip_save" -+#define CONFIG_FILENAME SYSCONFDIR "/no-ip.conf" - #define CONFIGNUM 10 - #define CONFSTRLEN 1024 - #define NUMBER 2 -@@ -224,8 +223,8 @@ void Usage() - #ifdef DEBUG - fprintf(stderr, " -d increase debug verbosity\n"); - #endif -- fprintf(stderr, "\n config file is either\n"); -- fprintf(stderr, " %s or %s\n", CONFIG_FILENAME,CONFIG_FILENAME_ETC); -+ fprintf(stderr, "\n config file is\n"); -+ fprintf(stderr, " %s\n", CONFIG_FILENAME); - fprintf(stderr, " and must contain %d required entries", CONFIGNUM); - fprintf(stderr, " in the form of KEYWORD = value\n"); - fprintf(stderr, " A complete description of the config file is in the README file.\n"); -@@ -254,12 +253,8 @@ int main(int argc, char *argv[]) - program = argv[0]; - openlog(program, LOG_PID, LOG_DAEMON); - process_options(argc, argv); -- if (config_filename == NULL) { -- if(!access(CONFIG_FILENAME, R_OK)) -- config_filename = CONFIG_FILENAME; -- else -- config_filename = CONFIG_FILENAME_ETC; -- } -+ if (config_filename == NULL) -+ config_filename = CONFIG_FILENAME; - if (handle_config_error(parse_config()) != SUCCESS) - return -1; - if (*groupname) -@@ -375,7 +370,7 @@ void save_IP(int sig) - void getip(char *p) - { - int fd; -- int *x; -+ struct sockaddr_in *sin; - struct ifreq ifr; - struct in_addr z; - -@@ -402,8 +397,8 @@ void getip(char *p) - return; - } - close(fd); -- x = (int *)&ifr.ifr_addr; // seems to be off by 2 bytes -- z.s_addr = x[1]; -+ sin = (struct sockaddr_in *)&ifr.ifr_addr; -+ z = sin->sin_addr; - strcpy(p, inet_ntoa(z)); - sprintf(suppliedIP, "&ip=%s", p); // force sending local address - #ifdef DEBUG -@@ -439,9 +434,9 @@ int run_as_background() - fclose(fildes); - } - if (fp != NULL) -- strncpy(Last_IP_Addr, buffer, IPLEN); -+ strlcpy(Last_IP_Addr, buffer, IPLEN); - else -- memset(Last_IP_Addr, 1, IPLEN); // bogus address at start -+ memset(Last_IP_Addr, 0, IPLEN); // bogus address at start - unlink(SAVEDIPFILE); - while (background) { - delay = MAX(60, interval * 60); diff --git a/net/no-ip/pkg/DEINSTALL b/net/no-ip/pkg/DEINSTALL index 287656307a9..072a8457392 100644 --- a/net/no-ip/pkg/DEINSTALL +++ b/net/no-ip/pkg/DEINSTALL @@ -1,10 +1,10 @@ #!/bin/sh -# $OpenBSD: DEINSTALL,v 1.1.1.1 2002/03/08 16:56:10 wilfried Exp $ +# $OpenBSD: DEINSTALL,v 1.2 2003/05/07 08:33:19 wilfried Exp $ set -e PATH=/bin:/usr/bin:/sbin:/usr/sbin PREFIX=${PKG_PREFIX:-/usr/local} -CONFIG_FILE=${SYSCONFDIR}/no-ip.conf +CONFIG_FILE=${SYSCONFDIR}/no-ip2.conf if [ -f $CONFIG_FILE ]; then echo diff --git a/net/no-ip/pkg/INSTALL b/net/no-ip/pkg/INSTALL deleted file mode 100644 index 7faba41fb62..00000000000 --- a/net/no-ip/pkg/INSTALL +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -# $OpenBSD: INSTALL,v 1.2 2002/04/26 03:35:34 pvalchev Exp $ - -set -e -PATH=/bin:/usr/bin:/sbin:/usr/sbin -PREFIX=${PKG_PREFIX:-/usr/local} -CONFIG_FILE=${SYSCONFDIR}/no-ip.conf -SAMPLE_CONFIG_FILE=$PREFIX/share/examples/no-ip/no-ip.conf.sample - -do_notice() -{ - echo - echo "+---------------" - echo "| The existing $1 configuration file, $CONFIG_FILE," - echo "| has NOT been changed. You may want to compare it to the" - echo "| current sample file, $SAMPLE_CONFIG_FILE," - echo "| and update your configuration as needed." - echo "+---------------" - echo -} - -do_install() -{ - install -o root -g wheel -m 600 $SAMPLE_CONFIG_FILE $CONFIG_FILE - echo - echo "+---------------" - echo "| The $1 configuration file, $CONFIG_FILE," - echo "| has been installed. Please view this file and change" - echo "| the configuration to meet your needs." - echo "+---------------" - echo - -} - -# verify proper execution -# -if [ $# -ne 2 ]; then - echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 - exit 1 -fi - -# Verify/process the command -# -case $2 in - PRE-INSTALL) - : nothing to pre-install for this port - ;; - POST-INSTALL) - if [ -f $CONFIG_FILE ]; then - do_notice $1 - else - do_install $1 - fi - ;; - *) - echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/net/no-ip/pkg/PLIST b/net/no-ip/pkg/PLIST index acc968eb10c..fae5cde318a 100644 --- a/net/no-ip/pkg/PLIST +++ b/net/no-ip/pkg/PLIST @@ -1,7 +1,4 @@ -@comment $OpenBSD: PLIST,v 1.1.1.1 2002/03/08 16:56:10 wilfried Exp $ -sbin/no-ip -sbin/noip +@comment $OpenBSD: PLIST,v 1.2 2003/05/07 08:33:19 wilfried Exp $ +sbin/noip2 share/doc/no-ip/README.FIRST -share/examples/no-ip/no-ip.conf.sample -@dirrm share/examples/no-ip @dirrm share/doc/no-ip