diff options
Diffstat (limited to 'net-dns/ez-ipupdate')
-rw-r--r-- | net-dns/ez-ipupdate/Manifest | 12 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/ez-ipupdate-3.0.11.13.3_beta8-r3.ebuild | 127 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-3322.diff | 65 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-dnsexit.diff | 262 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-ipv6.diff | 41 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-linux.diff | 213 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate.initd | 93 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/files/ez-ipupdate.service | 12 | ||||
-rw-r--r-- | net-dns/ez-ipupdate/metadata.xml | 10 |
9 files changed, 835 insertions, 0 deletions
diff --git a/net-dns/ez-ipupdate/Manifest b/net-dns/ez-ipupdate/Manifest new file mode 100644 index 000000000000..287665b9fcd8 --- /dev/null +++ b/net-dns/ez-ipupdate/Manifest @@ -0,0 +1,12 @@ +AUX ez-ipupdate-3.0.11.13.3_beta8-3322.diff 1934 SHA256 2fb89b2563c9c240c37b3eeaba4b1797c6a9c20c12dc2122dee02a7feb96e5f4 SHA512 b6a5bf2d7bc46d192d20a25cf9a220703553f3143f6db681366b90815a28be7fb716618b8a13302d0e892924b4803c8ceb535df6026e4f3154118812f1f87647 WHIRLPOOL f252127d84b5dfe890a660b99bedee4d75cef05c2694dc4be23ed8504088f00b2c001ecf0b2268ec4150a5e542742eed4f838a1838a5d13851a0819f13860d11 +AUX ez-ipupdate-3.0.11.13.3_beta8-dnsexit.diff 6770 SHA256 0eae6b193cb5b6b2c11c7dc3339327b05e279d63213ecd8d414c93325df8115a SHA512 e3f14a06383c3a49453b5b4b37e2030d17289ed4d43f15e7a48739e40adced66857820328a2635b814c1003541b3f0ea9bf46d3343c2ffe5fea27b2872a20670 WHIRLPOOL b2a94b2576b2f298504db627ac0856c414e93c906a8ce69f15b0122bf6de3b45d52596a931b02df8b47c621d77be75b6a85acaf2101812069182f5ee4f857ef6 +AUX ez-ipupdate-3.0.11.13.3_beta8-ipv6.diff 767 SHA256 163c0cc4fd92a5b75c0154eead7045fdf5817a58c8ac4af6ad13ad51ce1441fc SHA512 7b62ce5ad610963beac5138ecb797fd2a36643720c25cae4efe94621c92e9b57dd2c73b2320735c56b477f06894e35e9eeb085b8c365729728c05eb6d0d78ae4 WHIRLPOOL 7b06993d219e48a364cc5d100f6e870450ca96b8563817d68df22ce9aa4205cbcad0aaf06a48b76c46de44aca36983f74b17c52a4a71f2d6b51dda8d97cf2b84 +AUX ez-ipupdate-3.0.11.13.3_beta8-linux.diff 5841 SHA256 d406fbd63c8463c7d21aa8bc87471c08d5fcfe42b0d3fbdd5daeb503170a356c SHA512 3cee4b7c0b145344bba892e3a6fbdd07b4e21020005a9094bd96950304fea89d8e16439de9133eebfe581764b0abf240c27f59188762ee209b96159e6d0af168 WHIRLPOOL 243bea4ca1848e7b9c365196a4c7fc84801dbea8baa8d42788c8706ad7cacbe962b3b62372ba1d881e2305112a946ccce1e6c63562f51b1211fb70e7645bdfcd +AUX ez-ipupdate.initd 2555 SHA256 9301469ef0c058ce574c96c55a66572a1d0c8e9fc860404b179482b1149e0fbf SHA512 31729abd0aae2d225838dcbbbd724ea2402536eced290c71dfcd201fe48dbb1cf176da519d239b380089aee1afbeb66fc488d42bfb1432e14dfe36a484d8f841 WHIRLPOOL 8cf261f050c6efc2a4175629b91f8effc57a0bd36a437ffed910cec1725ddd49e54a7a7e9148bc8cee719e15454ddf8390994a607ef0f0e1b8414800074d1c67 +AUX ez-ipupdate.service 363 SHA256 5f49b86d9fd70260baff42948b5eb5133de2b9c9da47aae2ec09e7ff96510c43 SHA512 d8822278f9c32419fd95a37ee7523ce83bbbd5d0e43dd9869b076ffd837121ca2f5ee07ebd66bb6942ac9a2bf1c07025877781b2ed049945bcaee4e04a039022 WHIRLPOOL 1daa8eebfa54070317e5df7e7c7dcd0a8c02edb24e41501c0d8e6619f6ed270630d980a851fa014ba3bbff48e795e6dfcf7c0d5d06f2fdfce20581ce21f9c79a +DIST ez-ipupdate_3.0.11b8-13.3.diff.gz 154094 SHA256 2c058941f8b172c8564d841d4413b7fa7a5c4dbd53d7d5574c2ff58f41cf39b3 SHA512 bef3c344a3c16f224cc3c6e662213713bb1123b4e47347d83d01d632c5ca0b09e7f0e5a989b3987655759ac901307c8dd6768fab3056c8878c0adcf78b0d5fb9 WHIRLPOOL f213674b871bdf950fe3f1a1131561954c77f0c79a2e4a70752f8a1a88f86e221ad269d92839c30a49544c636ccad77f9e096687a381209cb86367329eafd4ca +DIST ez-ipupdate_3.0.11b8.orig.tar.gz 81975 SHA256 bf5b8d11ffe055c5891d0ab64bbfa86e99cbda645d40f346146b939fec8d962d SHA512 85de91cde25d176374ade7128e8932a4e015cd04beb8d5b71bf540e2f59b6c409d1c8bd0ff7c50734b87ecc19a74a7b1da3e646a8c8787badcae4feb9dba7864 WHIRLPOOL ce279c1d8f1ae404c936b959b9273bce1c37404d7ecf0d7262468bb4b71f6aee75797a2448ea7a0191c9f8a01ffef92107f71727e2c7d445469ec61f0be8f162 +EBUILD ez-ipupdate-3.0.11.13.3_beta8-r3.ebuild 3481 SHA256 e65e66855ce7ceacb12c8d2b67235de130d8dd89d94387064ad9d2ad517965b0 SHA512 210e454786bbb443c6b5c24d201d4cd0af048517780b5aac2c9fe57266bbd8431594e5f2b09a5a312831e908a7e02a2bb364bb0c6c8acb4422b5402200936415 WHIRLPOOL 28352ae4573f1b199a05b3370f1e5a641f3337f9d92c9b31c61b488140210b4af540b4abba30d14fa3f041ea834dc6062ce20492a5725f7714caaf6a91e884ed +MISC ChangeLog 3307 SHA256 ac8c6ca2086963f7b97a758fc2910e17bac7d835257b59c443369ab204aed7dc SHA512 6905bdb4cf7284b9dc3df1d7dd4be27c68014d3209f13ffd159fd9a7eb7376117e2ddf4e5245406743ca1e6edd4816d015083461180f2213f97d0c59b8bd6d2c WHIRLPOOL 7b7e903b468dbd261f00b7ac02e3f0d60b9f97c77d75d9d07c4ca3b2178a802a6e24684494cf43b9bcf39792d362e156b659e7b7c08b42307a890878c06a1043 +MISC ChangeLog-2015 7785 SHA256 9f15c325d9d3915cceb0487b7ab5a518a40c7a2d020516fc27af7ffac23939b8 SHA512 305c8cbf6ee81393ae1547bef84e1809f63746d9033208ec1795253a0ac36fdd9a9f870256ae9f0325a6fe312564bb2b818e01fca0ab6d98768d59018d4a0632 WHIRLPOOL 25bab2031c41d5474c5e28ede68426f150bd3f1dffa1364650a64ee4b7a0c6d6d8a10ce7a4e196f125c7e35ca5937a6b4dcc4063a9f77ffbf7340084cf2fae63 +MISC metadata.xml 404 SHA256 25c8957aee3263e19fd88b60dfaee092b36f626b3d68fe84a2ca8deab24d45aa SHA512 07417b283cb97be8e2d9ff84dc6fd42d89cb1fc48bd356efa7c29498137fbec47fd408960915805d18d9aa7b49a530ec55271a8eb97287b15586678c4fdf5b20 WHIRLPOOL c4b9ef7e136cc5f6cc6aae338924ef446429367860e161d63ccfaf3715e18ea29d989d094f235ab4fa99a6030876bd96177c332320a44f3c13f73ebc85b8816d diff --git a/net-dns/ez-ipupdate/ez-ipupdate-3.0.11.13.3_beta8-r3.ebuild b/net-dns/ez-ipupdate/ez-ipupdate-3.0.11.13.3_beta8-r3.ebuild new file mode 100644 index 000000000000..df5841dd2a89 --- /dev/null +++ b/net-dns/ez-ipupdate/ez-ipupdate-3.0.11.13.3_beta8-r3.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" +inherit eutils readme.gentoo systemd user versionator + +MY_BETA="$(get_version_component_range 6)" +MY_PATCH="$(get_version_component_range 4-5)" +MY_PV="$(get_version_component_range 1-3)${MY_BETA/beta/b}" + +DESCRIPTION="Dynamic DNS client for lots of dynamic dns services" +HOMEPAGE="http://ez-ipupdate.com/" +SRC_URI="mirror://debian/pool/main/e/ez-ipupdate/${PN}_${MY_PV}.orig.tar.gz + mirror://debian/pool/main/e/ez-ipupdate/${PN}_${MY_PV}-${MY_PATCH}.diff.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~sparc ~x86" +IUSE="" + +DEPEND="" +RDEPEND="" + +S="${WORKDIR}/${PN}-${MY_PV}" + +DISABLE_AUTOFORMATTING="yes" +DOC_CONTENTS=" +Please create one or more config files in +/etc/ez-ipupdate/. A bunch of samples can +be found in the doc directory. + +All config files must have a '.conf' extension. + +If you are using openRC you need to: +- Please do not use the 'run-as-user', 'run-as-euser', +'cache-file' and 'pidfile' options, since these are +handled internally by the init-script. + +-If you want to use ez-ipupdate in daemon mode, +please add 'daemon' to the config file(s) and +add the ez-ipupdate init-script to the default runlevel. +Without the 'daemon' option, you can run the +init-script with the 'update' parameter inside +your PPP ip-up script. +" + +src_prepare() { + # apply debian patches + epatch "${WORKDIR}/${PN}_${MY_PV}-${MY_PATCH}.diff" + + # repair/apply additional debian patches + sed -i -e "s|^\(---\s*\)\.\./|\1|g" debian/patches/*.diff + EPATCH_SOURCE="${S}/debian/patches" EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch + + # adding members.3322.org support + epatch "${FILESDIR}/${P}-3322.diff" + + # adding www.dnsexit.com support + epatch "${FILESDIR}/${P}-dnsexit.diff" + + # make ez-ipupdate work with iproute2/dhcpcd under linux (bug #318905) + epatch "${FILESDIR}/${P}-linux.diff" + + # allows to set IPv6 via -a option, (bug #432764) + epatch "${FILESDIR}/${P}-ipv6.diff" + + # repair format mask issues + sed -i -e "s|\(\s*\)\(strlen(putbuf)\)|\1(int)\2|g" ez-ipupdate.c || die + + # comment out obsolete options + sed -i -e "s:^\(run-as-user.*\):#\1:g" \ + -e "s:^\(cache-file.*\):#\1:g" ex*conf || die + + # make 'missing' executable (bug #103480) + chmod +x missing +} + +src_configure() { + econf --bindir=/usr/sbin +} + +src_install() { + emake DESTDIR="${D}" install + newinitd "${FILESDIR}/ez-ipupdate.initd" ez-ipupdate + systemd_dounit "${FILESDIR}/${PN}.service" + keepdir /etc/ez-ipupdate + + # install docs + dodoc README + newdoc debian/README.Debian README.debian + newdoc debian/changelog ChangeLog.debian + newdoc CHANGELOG ChangeLog + doman debian/ez-ipupdate.8 + + # install example configs + docinto examples + dodoc ex*conf + + readme.gentoo_create_doc +} + +pkg_preinst() { + enewgroup ez-ipupd + enewuser ez-ipupd -1 -1 /var/cache/ez-ipupdate ez-ipupd +} + +pkg_postinst() { + chmod 750 /etc/ez-ipupdate /var/cache/ez-ipupdate + chown ez-ipupd:ez-ipupd /etc/ez-ipupdate /var/cache/ez-ipupdate + + readme.gentoo_print_elog + + if [ -f /etc/ez-ipupdate.conf ]; then + elog "!!! IMPORTANT UPDATE NOTICE !!!" + elog + elog "The ez-ipupdate init-script can now handle more" + elog "than one config file. New config file location is" + elog "/etc/ez-ipupdate/*.conf" + elog + if [ ! -f /etc/ez-ipupdate/default.conf ]; then + mv -f /etc/ez-ipupdate.conf /etc/ez-ipupdate/default.conf + elog "Your old configuration has been moved to" + elog "/etc/ez-ipupdate/default.conf" + elog + fi + fi +} diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-3322.diff b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-3322.diff new file mode 100644 index 000000000000..d6bf0152a098 --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-3322.diff @@ -0,0 +1,65 @@ +diff -Naur ez-ipupdate-3.0.11b8.orig/example-3322.conf ez-ipupdate-3.0.11b8/example-3322.conf +--- ez-ipupdate-3.0.11b8.orig/example-3322.conf 1970-01-01 01:00:00.000000000 +0100 ++++ ez-ipupdate-3.0.11b8/example-3322.conf 2011-01-23 19:30:43.785652588 +0100 +@@ -0,0 +1,19 @@ ++#!/usr/local/bin/ez-ipupdate -c ++# ++# example config file for ez-ipupdate ++# ++# this file is actually executable! ++# ++ ++service-type=qdns ++#service-type=qdns-static ++user=myuserid:mypassword ++host=mydomain.whatever.com ++interface=eth1 ++max-interval=2073600 ++ ++# uncomment this once you have everything working how you want and you are ++# ready to have ez-ipupdate running in the background all the time. to stop it ++# you can use "killall -QUIT ez-ipupdate" under linux. ++#daemon ++ +diff -Naur ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ez-ipupdate-3.0.11b8/ez-ipupdate.c +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c 2011-01-23 19:29:17.698793394 +0100 ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c 2011-01-23 19:29:17.799792055 +0100 +@@ -103,6 +103,11 @@ + #define HEIPV6TB_DEFAULT_PORT "80" + #define HEIPV6TB_REQUEST "/index.cgi" + ++#define QDNS_DEFAULT_SERVER "members.3322.org" ++#define QDNS_DEFAULT_PORT "80" ++#define QDNS_REQUEST "/dyndns/update" ++#define QDNS_STAT_REQUEST "/dyndns/update" ++ + #define DEFAULT_TIMEOUT 120 + #define DEFAULT_UPDATE_PERIOD 120 + #define DEFAULT_RESOLV_PERIOD 30 +@@ -514,6 +519,26 @@ + HEIPV6TB_DEFAULT_PORT, + HEIPV6TB_REQUEST + }, ++ { "qdns", ++ { "qdns", 0, 0, }, ++ DYNDNS_init, ++ DYNDNS_update_entry, ++ DYNDNS_check_info, ++ DYNDNS_fields_used, ++ QDNS_DEFAULT_SERVER, ++ QDNS_DEFAULT_PORT, ++ QDNS_REQUEST ++ }, ++ { "qdns-static", ++ { "qdns-static", "qdns-stat", "statdns", }, ++ DYNDNS_init, ++ DYNDNS_update_entry, ++ DYNDNS_check_info, ++ DYNDNS_STAT_fields_used, ++ QDNS_DEFAULT_SERVER, ++ QDNS_DEFAULT_PORT, ++ QDNS_STAT_REQUEST ++ }, + }; + + static struct service_t *service = NULL; diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-dnsexit.diff b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-dnsexit.diff new file mode 100644 index 000000000000..fd80485f0f4f --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-dnsexit.diff @@ -0,0 +1,262 @@ +diff -Naur ez-ipupdate-3.0.11b8.orig/example-dnsexit.conf ez-ipupdate-3.0.11b8/example-dnsexit.conf +--- ez-ipupdate-3.0.11b8.orig/example-dnsexit.conf 1970-01-01 01:00:00.000000000 +0100 ++++ ez-ipupdate-3.0.11b8/example-dnsexit.conf 2011-01-23 19:32:53.181937517 +0100 +@@ -0,0 +1,19 @@ ++#!/usr/sbin/ez-ipupdate -c ++# ++# example config file for ez-ipupdate ++# ++# this file is actually executable! ++# ++ ++service-type=dnsexit ++user=loginname:password ++host=www.yourdomain.com ++interface=eth1 ++ ++run-as-user=ez-ipupd ++cache-file=/var/cache/ez-ipupdate/default-cache ++ ++# uncomment this once you have everything working how you want and you are ++# ready to have ez-ipupdate running in the background all the time. to stop it ++# you can use "killall -QUIT ez-ipupdate" under linux. ++#daemon +diff -Naur ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ez-ipupdate-3.0.11b8/ez-ipupdate.c +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c 2011-01-23 19:32:53.074938936 +0100 ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c 2011-01-23 19:32:53.182937505 +0100 +@@ -103,6 +103,10 @@ + #define HEIPV6TB_DEFAULT_PORT "80" + #define HEIPV6TB_REQUEST "/index.cgi" + ++#define DNSEXIT_DEFAULT_SERVER "www.dnsexit.com" ++#define DNSEXIT_DEFAULT_PORT "80" ++#define DNSEXIT_REQUEST "/RemoteUpdate.sv" ++ + #define DEFAULT_TIMEOUT 120 + #define DEFAULT_UPDATE_PERIOD 120 + #define DEFAULT_RESOLV_PERIOD 30 +@@ -341,6 +345,11 @@ + int HEIPV6TB_check_info(void); + static char *HEIPV6TB_fields_used[] = { "server", "user", NULL }; + ++int DNSEXIT_update_entry(void); ++int DNSEXIT_check_info(void); ++static char *DNSEXIT_fields_used[] = { "server", "user", "address", "wildcard", "mx", "host", NULL }; ++ ++ + struct service_t services[] = { + { "NULL", + { "null", "NULL", 0, }, +@@ -514,6 +523,16 @@ + HEIPV6TB_DEFAULT_PORT, + HEIPV6TB_REQUEST + }, ++ { "dnsexit", ++ { "dnsexit", 0, 0, }, ++ NULL, ++ DNSEXIT_update_entry, ++ DNSEXIT_check_info, ++ DNSEXIT_fields_used, ++ DNSEXIT_DEFAULT_SERVER, ++ DNSEXIT_DEFAULT_PORT, ++ DNSEXIT_REQUEST ++ }, + }; + + static struct service_t *service = NULL; +@@ -4241,6 +4260,195 @@ + } + return(UPDATERES_ERROR); + break; ++ } ++ ++ return(UPDATERES_OK); ++} ++ ++int DNSEXIT_check_info(void) ++{ ++ char buf[BUFSIZ+1]; ++ ++ if((host == NULL) || (*host == '\0')) ++ { ++ if(options & OPT_DAEMON) ++ { ++ return(-1); ++ } ++ if(host) { free(host); } ++ printf("host: "); ++ *buf = '\0'; ++ fgets(buf, BUFSIZ, stdin); ++ host = strdup(buf); ++ chomp(host); ++ } ++ ++ if(interface == NULL && address == NULL) ++ { ++ if(options & OPT_DAEMON) ++ { ++ fprintf(stderr, "you must provide either an interface or an address\n"); ++ return(-1); ++ } ++ if(interface) { free(interface); } ++ printf("interface: "); ++ *buf = '\0'; ++ fgets(buf, BUFSIZ, stdin); ++ chomp(buf); ++ option_handler(CMD_interface, buf); ++ } ++ ++ warn_fields(service->fields_used); ++ ++ return 0; ++} ++ ++int DNSEXIT_update_entry(void) ++{ ++ char buf[BUFFER_SIZE+1]; ++ char *bp = buf; ++ int bytes; ++ int btot; ++ int ret; ++ ++ buf[BUFFER_SIZE] = '\0'; ++ ++ if(do_connect((int*)&client_sockfd, server, port) != 0) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("error connecting to %s:%s\n", server, port); ++ } ++ return(UPDATERES_ERROR); ++ } ++ ++ snprintf(buf, BUFFER_SIZE, "GET %s?action=edit&", request); ++ output(buf); ++ if(address != NULL && *address != '\0') ++ { ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "myip", address); ++ output(buf); ++ } ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "wildcard", wildcard ? "ON" : "OFF"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "mx", mx); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "backmx", *mx == '\0' ? "NO" : "YES"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "host", host); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "login", user_name); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "%s=%s&", "password", password); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, " HTTP/1.0\015\012"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "Authorization: Basic %s\015\012", auth); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "User-Agent: %s-%s %s [%s] (%s)\015\012", ++ "ez-update", VERSION, OS, (options & OPT_DAEMON) ? "daemon" : "", "by Angus Mackay"); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "Host: %s\015\012", server); ++ output(buf); ++ snprintf(buf, BUFFER_SIZE, "\015\012"); ++ output(buf); ++ ++ bp = buf; ++ bytes = 0; ++ btot = 0; ++ while((bytes=read_input(bp, BUFFER_SIZE-btot)) > 0) ++ { ++ bp += bytes; ++ btot += bytes; ++ dprintf((stderr, "btot: %d\n", btot)); ++ } ++ close(client_sockfd); ++ buf[btot] = '\0'; ++ ++ dprintf((stderr, "server output: %s\n", buf)); ++ ++ if(sscanf(buf, " HTTP/1.%*c %3d", &ret) != 1) ++ { ++ ret = -1; ++ } ++ ++ switch(ret) ++ { ++ case -1: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("strange server response, are you connecting to the right server?\n"); ++ } ++ return(UPDATERES_ERROR); ++ break; ++ ++ case 200: ++ ++ if(strstr(buf, "0=Success") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Request successful\n"); ++ } ++ } ++ else if(strstr(buf, "1=IP is the same as the IP on the system") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Request successful but the IP is the same as previous update\n"); ++ } ++ } ++ else if(strstr(buf, "2=Invalid passwords") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Invalid Password\n"); ++ } ++ } ++ else if(strstr(buf, "3=User not found") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Username not found\n"); ++ } ++ } ++ else if(strstr(buf, "4=Update too often") != NULL) ++ { ++ if(!(options & OPT_QUIET)) ++ { ++ printf("Updatting too often\n"); ++ } ++ } ++ else ++ { ++ show_message("Errors return from server\n"); ++ if(!(options & OPT_QUIET)) ++ { ++ fprintf(stderr, "server output: %s\n", buf); ++ } ++ return(UPDATERES_ERROR); ++ } ++ break; ++ ++ case 401: ++ if(!(options & OPT_QUIET)) ++ { ++ show_message("authentication failure\n"); ++ } ++ return(UPDATERES_SHUTDOWN); ++ break; ++ ++ default: ++ if(!(options & OPT_QUIET)) ++ { ++ // reuse the auth buffer ++ *auth = '\0'; ++ sscanf(buf, " HTTP/1.%*c %*3d %255[^\r\n]", auth); ++ show_message("unknown return code: %d\n", ret); ++ show_message("server response: %s\n", auth); ++ } ++ return(UPDATERES_ERROR); ++ break; + } + + return(UPDATERES_OK); diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-ipv6.diff b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-ipv6.diff new file mode 100644 index 000000000000..ec41647e066f --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-ipv6.diff @@ -0,0 +1,41 @@ +diff --git a/ez-ipupdate.c b/ez-ipupdate.c +index ff093a9..eea7624 100644 +--- a/ez-ipupdate.c ++++ b/ez-ipupdate.c +@@ -849,6 +849,27 @@ int is_dotted_quad(char *addr) + return(1); + } + ++int is_ip_addr(char *addr) ++{ ++#if HAVE_ARPA_INET_H ++ char dst[16]; ++ ++ if(inet_pton(AF_INET,addr,dst) == 1) ++ { ++ return(1); ++ } ++ ++ if(inet_pton(AF_INET6,addr,dst) == 1) ++ { ++ return(1); ++ } ++ ++ return(0); ++#else ++ return is_dotted_quad(addr); ++#endif ++} ++ + void parse_service(char *str) + { + int i; +@@ -1859,7 +1880,7 @@ int DYNDNS_check_info(void) + chomp(host); + } + +- if(address != NULL && !is_dotted_quad(address)) ++ if(address != NULL && !is_ip_addr(address)) + { + fprintf(stderr, "the IP address \"%s\" is invalid\n", address); + return(-1); diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-linux.diff b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-linux.diff new file mode 100644 index 000000000000..8a282bb58c34 --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate-3.0.11.13.3_beta8-linux.diff @@ -0,0 +1,213 @@ +diff -Naur ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c ez-ipupdate-3.0.11b8/ez-ipupdate.c +--- ez-ipupdate-3.0.11b8.orig/ez-ipupdate.c 2011-01-23 19:35:10.885111914 +0100 ++++ ez-ipupdate-3.0.11b8/ez-ipupdate.c 2011-01-23 19:35:10.979110667 +0100 +@@ -172,6 +172,17 @@ + # ifdef HAVE_SYS_SOCKIO_H + # include <sys/sockio.h> + # endif ++# ifdef __linux__ ++/*# include <linux/if.h> */ ++# include <linux/netlink.h> ++# include <linux/rtnetlink.h> ++/* Under Linux, we reopen socket in get_if_addr() every time */ ++# define socketopen(sock) ++# define socketclose(sock) ++# else ++# define socketopen(sock) sock = socket(AF_INET, SOCK_STREAM, 0) ++# define socketclose(sock) close(sock) ++# endif + #endif + + #include <dprintf.h> +@@ -1605,6 +1616,114 @@ + int get_if_addr(int sock, char *name, struct sockaddr_in *sin) + { + #ifdef IF_LOOKUP ++#ifdef __linux__ ++ struct { ++ struct nlmsghdr nlmsg_info; ++ struct ifaddrmsg ifaddrmsg_info; ++ char buffer[2048]; ++ } req; ++ struct nlmsghdr *curr; ++ int len; ++ char buf[8192]; ++ ++ /* open a socket and bind it. ++ Under non-linux, the socket can be kept open, but it seems under ++ linux we cannot use the same socket for several requests reliable ++ [although sometimes it works...] */ ++ static struct sockaddr_nl local; ++ sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); ++ if(sock < 0) { ++ perror("socket"); ++ return -1; ++ } ++ local.nl_family = AF_NETLINK; ++ local.nl_pad = 0; ++ local.nl_pid = getpid(); ++ local.nl_groups = 0; ++ if(bind(sock, (struct sockaddr*) &local, sizeof(local)) < 0) { ++ perror("bind"); ++ close(sock); ++ return -1; ++ } ++ ++ memset(&req, 0, sizeof(req)); ++ req.nlmsg_info.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg)); ++ req.nlmsg_info.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; ++ req.nlmsg_info.nlmsg_type = RTM_GETADDR; ++ req.nlmsg_info.nlmsg_pid = getpid(); ++ req.ifaddrmsg_info.ifa_family = AF_INET; ++ if(send(sock, &req, req.nlmsg_info.nlmsg_len, 0) < 0) { ++ perror("sendmsg(sock)"); ++ close(sock); ++ return -1; ++ } ++ ++ len = recv(sock, buf, sizeof(buf), 0); ++ close(sock); ++ if(len < 0) { ++ perror("recv"); ++ return -1; ++ } else if(len == 0) { ++ dprintf((stderr, "No interfaces found")); ++ return -1; ++ } ++ ++ /* Initialize sin except for address */ ++ bzero(sin, sizeof(struct sockaddr_in)); ++ sin->sin_family = AF_INET; ++ ++ /* We take the last non-private IP with matching name */ ++ int found = 0; ++ curr = (struct nlmsghdr *) buf; ++ for(; NLMSG_OK(curr, len); curr = NLMSG_NEXT(curr, len)) { ++ struct ifaddrmsg *curraddr = (struct ifaddrmsg *) NLMSG_DATA(curr); ++ struct rtattr *datalist = (struct rtattr *) IFA_RTA(curraddr); ++ int datalen = IFA_PAYLOAD(curr); ++ int mystat = 0; ++ struct in_addr sin_addr; ++ in_addr_t addr; ++ for(; RTA_OK(datalist, datalen); datalist = RTA_NEXT(datalist, datalen)) { ++ switch(datalist->rta_type) { ++ case IFA_LABEL: ++ if(strcmp((char *)RTA_DATA(datalist), name) != 0) ++ mystat = -1; ++ break; ++ case IFA_LOCAL: ++ addr = ((struct in_addr *)RTA_DATA(datalist))->s_addr; ++ /* addr: 192.168.0.0/16 || 172.16.0.0/12 || 10.0.0.0/8 */ ++ if(((addr & 0xFFFF) == 0xA8C0) ++ || ((addr & 0xF0FF) == 0x10AC) ++ || ((addr & 0xFF) == 0x0A)) { ++ mystat = -1; ++ } ++ else { ++ /* We must not store yet sin->sin_addr, since name might not match */ ++ sin_addr = *((struct in_addr *)RTA_DATA(datalist)); ++ mystat = 1; ++ } ++ break; ++ default: ++ break; ++ } ++ if(mystat < 0) ++ break; ++ } ++ if(mystat > 0) { ++ sin->sin_addr = sin_addr; ++ found = 1; ++ /* If you want to take the first non-private IP with matching name ++ uncomment the next break command: ++ break; */ ++ } ++ } ++ if(found) { ++ dprintf((stderr, "%s: %s\n", name, inet_ntoa(sin->sin_addr))); ++ return 0; ++ } ++ dprintf((stderr, "%s: %s\n", name, "has no non-private address")); ++ return -1; ++#else ++/* ifndef __linux__ */ + struct ifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); +@@ -1638,7 +1757,10 @@ + return -1; + } + return -1; ++#endif ++/* endif __linux__ */ + #else ++/* ifndef IF_LOOKUP */ + return -1; + #endif + } +@@ -4490,7 +4612,7 @@ + #ifdef IF_LOOKUP + if(options & OPT_DAEMON) + { +- sock = socket(AF_INET, SOCK_STREAM, 0); ++ socketopen(sock); + } + #endif + +@@ -4745,12 +4867,12 @@ + struct sockaddr_in sin; + int sock; + +- sock = socket(AF_INET, SOCK_STREAM, 0); ++ socketopen(sock); + if(get_if_addr(sock, interface, &sin) != 0) + { + exit(1); + } +- close(sock); ++ socketclose(sock); + snprintf(ipbuf, sizeof(ipbuf), "%s", inet_ntoa(sin.sin_addr)); + #else + fprintf(stderr, "interface lookup not enabled at compile time\n"); +@@ -4791,7 +4913,7 @@ + struct sockaddr_in sin; + int sock; + +- sock = socket(AF_INET, SOCK_STREAM, 0); ++ socketopen(sock); + if(get_if_addr(sock, interface, &sin) == 0) + { + if(address) { free(address); } +@@ -4802,7 +4924,7 @@ + show_message("could not resolve ip address for %s.\n", interface); + exit(1); + } +- close(sock); ++ socketclose(sock); + } + + for(i=0; i<ntrys; i++) +@@ -4846,12 +4968,12 @@ + struct sockaddr_in sin; + int sock; + +- sock = socket(AF_INET, SOCK_STREAM, 0); ++ socketopen(sock); + if(get_if_addr(sock, interface, &sin) != 0) + { + exit(1); + } +- close(sock); ++ socketclose(sock); + snprintf(ipbuf, sizeof(ipbuf), "%s", inet_ntoa(sin.sin_addr)); + #else + fprintf(stderr, "interface lookup not enabled at compile time\n"); +@@ -4878,7 +5000,7 @@ + } + + #ifdef IF_LOOKUP +- if(sock > 0) { close(sock); } ++ if(sock > 0) { socketclose(sock); } + #endif + + if(address) { free(address); } diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate.initd b/net-dns/ez-ipupdate/files/ez-ipupdate.initd new file mode 100644 index 000000000000..2f531e764059 --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate.initd @@ -0,0 +1,93 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_commands="update" + +depend() { + need net + after rp-pppoe +} + +getconfig() { # 0: no daemon / 1: daemon + local CONF NAME LIST="" + for CONF in /etc/ez-ipupdate/*.conf; do + if [ -f "${CONF}" ]; then + # Don't run configurations that are (not) daemons + grep -q '^[[:space:]]*daemon' "${CONF}"; [ $? -eq $1 ] && continue + # Don't run configurations that run in the foreground + grep -q '^[[:space:]]*foreground' "${CONF}" && continue + # add config to list + NAME="${CONF##*/}" + LIST="${LIST} ${NAME%.*}" + fi + done + echo ${LIST} +} + +start() { + local NAME LIST=$(getconfig 1) + + if [ -z "${LIST}" ]; then + eerror "You need at least one config file in /etc/ez-ipupdate" + eerror "containing the 'daemon' keyword and no 'foreground' keyword." + return 1 + fi + + for dir in /var/run/ez-ipupdate /var/cache/ez-ipupdate; do + checkpath -q -d -m 0750 -o ez-ipupd:ez-ipupd ${dir} + done + + for NAME in ${LIST}; do + local CONFIG="/etc/ez-ipupdate/${NAME}.conf" + local PIDFILE="/var/run/ez-ipupdate/${NAME}.pid" + local CACHEFILE="/var/cache/ez-ipupdate/${NAME}.cache" + ebegin "Starting ez-ipupdate (${NAME})" + start-stop-daemon -p "${PIDFILE}" --start --quiet --exec /usr/sbin/ez-ipupdate \ + --user ez-ipupd:ez-ipupd -- -c "${CONFIG}" -F "${PIDFILE}" -b "${CACHEFILE}" + eend $? + done + return 0 # do not fail +} + +stop() { + local PIDFILE NAME + for PIDFILE in /var/run/ez-ipupdate/*.pid; do + if [ -f "${PIDFILE}" ]; then + NAME="${PIDFILE##*/}" + ebegin "Stopping ez-ipupdate (${NAME%.*})" + start-stop-daemon --stop --signal QUIT --quiet --pidfile "${PIDFILE}" + eend $? || rm -f "${PIDFILE}" + else + eerror "No running ez-ipupdate process" + fi + done + return 0 # do not fail +} + +update() { + local NAME TEXT LIST=$(getconfig 0) + + if [ -z "${LIST}" ]; then + eerror "You need at least one config file in /etc/ez-ipupdate" + eerror "containing no 'daemon' and 'foreground' keyword." + return 1 + fi + + for NAME in ${LIST}; do + local CONFIG="/etc/ez-ipupdate/${NAME}.conf" + local CACHEFILE="/var/cache/ez-ipupdate/${NAME}.cache" + ebegin "Running ez-ipupdate (${NAME})" + TEXT=$(/usr/sbin/ez-ipupdate -q -R ez-ipupd -c "${CONFIG}" -b "${CACHEFILE}" 2>&1) + if eend $?; then + if [ -n "${TEXT}" ]; then + echo "${TEXT}" | while read line; do einfo " $line"; done + fi + else + if [ -n "${TEXT}" ]; then + echo "${TEXT}" | while read line; do eerror " $line"; done + fi + fi + done + return 0 # do not fail +} diff --git a/net-dns/ez-ipupdate/files/ez-ipupdate.service b/net-dns/ez-ipupdate/files/ez-ipupdate.service new file mode 100644 index 000000000000..2f3d79b13dcd --- /dev/null +++ b/net-dns/ez-ipupdate/files/ez-ipupdate.service @@ -0,0 +1,12 @@ +[Unit] +Description=ez-ipupdate: Check and update your IP to dynamic DNS Server +Requires=network-online.target +After=network-online.target + +[Service] +ExecStart=/usr/sbin/ez-ipupdate -f -R ez-ipupd -c /etc/ez-ipupdate/defaults.conf -b /var/cache/ez-ipupdate/defaults.cache +ExecReload=/bin/kill -HUP $MAINPID +KillSignal=SIGQUIT + +[Install] +WantedBy=multi-user.target diff --git a/net-dns/ez-ipupdate/metadata.xml b/net-dns/ez-ipupdate/metadata.xml new file mode 100644 index 000000000000..982eb1127e65 --- /dev/null +++ b/net-dns/ez-ipupdate/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <longdescription lang="en"> + Ez-ipupdate is a client for the dynamic IP service offered by + http://www.ez-ip.net. It has several options and is quite complete. + It is written in pure C and supports a daemon mode. + </longdescription> +</pkgmetadata> |