public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-mdns/, sys-auth/nss-mdns/files/
@ 2016-05-29 18:58 Amy Winston
  0 siblings, 0 replies; 3+ messages in thread
From: Amy Winston @ 2016-05-29 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     75e23df8c331b7498d1f27a82bf0d048f627bb3d
Author:     Amy Winston <amynka <AT> gentoo <DOT> org>
AuthorDate: Sun May 29 18:50:25 2016 +0000
Commit:     Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Sun May 29 18:57:29 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75e23df8

sys-auth/nss-mdns: revbump, add ipv6 patch bug #584286

Package-Manager: portage-2.2.28
RepoMan-Options: --force

 sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch   | 528 +++++++++++++++++++++
 ...mdns-0.10-r2.ebuild => nss-mdns-0.10-r3.ebuild} |   5 +-
 2 files changed, 531 insertions(+), 2 deletions(-)

diff --git a/sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch b/sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch
new file mode 100644
index 0000000..6d6dbc9
--- /dev/null
+++ b/sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch
@@ -0,0 +1,528 @@
+diff -u src/avahi.c src/avahi.c
+--- src/avahi.c	2006-04-29 05:14:09.000000000 +0800
++++ src/avahi.c	2013-01-04 10:00:05.025558790 +0800
+@@ -26,6 +26,7 @@
+ #include <sys/socket.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <arpa/inet.h>
+ #include <sys/un.h>
+@@ -34,6 +35,7 @@
+ 
+ #include "avahi.h"
+ #include "util.h"
++#include "query.h"
+ 
+ #define WHITESPACE " \t"
+ 
+@@ -93,7 +95,8 @@
+     p = ln+1;
+     p += strspn(p, WHITESPACE);
+ 
+-    /* Skip interface */
++    /* Parse interface */
++    if (af == AF_INET6) ((ipv6_address_t*)data)->if_idx = strtoul(p, 0, 10);
+     p += strcspn(p, WHITESPACE);
+     p += strspn(p, WHITESPACE);
+ 
+diff -u src/avahi-test.c src/avahi-test.c
+--- src/avahi-test.c	2007-02-09 00:42:23.000000000 +0800
++++ src/avahi-test.c	2013-01-04 09:59:06.174017729 +0800
+@@ -24,6 +24,7 @@
+ #include <stdio.h>
+ 
+ #include "avahi.h"
++#include "query.h"
+ 
+ int main(int argc, char *argv[]) {
+     uint8_t data[64];
+@@ -35,15 +36,20 @@
+     else
+         printf("AF_INET: failed (%i).\n", r);
+ 
+-/*     if ((r = avahi_resolve_name(AF_INET6, argc >= 2 ? argv[1] : "cocaine.local", data)) == 0) */
+-/*         printf("AF_INET6: %s\n", inet_ntop(AF_INET6, data, t, sizeof(t))); */
+-/*     else */
+-/*         printf("AF_INET6: failed (%i).\n", r); */
+-
+     if ((r = avahi_resolve_address(AF_INET, data, t, sizeof(t))) == 0)
+         printf("REVERSE: %s\n", t);
+     else
+         printf("REVERSE: failed (%i).\n", r);
++
++     if ((r = avahi_resolve_name(AF_INET6, argc >= 2 ? argv[1] : "cocaine.local", data)) == 0)
++         printf("AF_INET6: %s, %u\n", inet_ntop(AF_INET6, data, t, sizeof(t)), ((ipv6_address_t*)data)->if_idx);
++     else
++         printf("AF_INET6: failed (%i).\n", r);
++
++    if ((r = avahi_resolve_address(AF_INET6, data, t, sizeof(t))) == 0)
++        printf("REVERSE: %s\n", t);
++    else
++        printf("REVERSE: failed (%i).\n", r);
+ 
+     return 0;
+ }
+diff -u src/bsdnss.c src/bsdnss.c
+--- src/bsdnss.c	2007-02-09 00:42:23.000000000 +0800
++++ src/bsdnss.c	2013-01-04 09:49:45.566389491 +0800
+@@ -258,6 +258,8 @@
+ 			ai->ai_addrlen = sizeof(struct sockaddr_in6);
+ 			memcpy(&((struct sockaddr_in6 *)psa)->sin6_addr, hap,
+ 			    ai->ai_addrlen);
++			if (((struct sockaddr_in6 *)psa)->sin6_addr[0] == 0xfe && ((struct sockaddr_in6 *)psa)->sin6_addr[0] == 0x80)
++			    ((struct sockaddr_in6 *)psa)->sin6_scope_id = ((struct ipv6_address_t*) hap)->if_idx;
+ 			break;
+ 		default:
+ 			ai->ai_addrlen = sizeof(struct sockaddr_storage);
+diff -u src/map-file src/map-file
+--- src/map-file	2007-01-02 02:36:21.000000000 +0800
++++ src/map-file	2013-01-07 08:56:56.406478774 +0800
+@@ -18,6 +18,12 @@
+ _nss_mdns_minimal_gethostbyname2_r;         
+ _nss_mdns4_minimal_gethostbyname2_r;
+ _nss_mdns6_minimal_gethostbyname2_r;
++_nss_mdns_gethostbyname4_r;         
++_nss_mdns4_gethostbyname4_r;
++_nss_mdns6_gethostbyname4_r;
++_nss_mdns_minimal_gethostbyname4_r;         
++_nss_mdns4_minimal_gethostbyname4_r;
++_nss_mdns6_minimal_gethostbyname4_r;
+ local: 
+ *;
+ };
+diff -u src/nss.c src/nss.c
+--- src/nss.c	2013-01-07 15:14:23.000000000 +0800
++++ src/nss.c	2013-01-07 16:52:38.399842517 +0800
+@@ -41,22 +41,27 @@
+ 
+ #if defined(NSS_IPV4_ONLY) && ! defined(MDNS_MINIMAL)
+ #define _nss_mdns_gethostbyname2_r _nss_mdns4_gethostbyname2_r
++#define _nss_mdns_gethostbyname4_r _nss_mdns4_gethostbyname4_r
+ #define _nss_mdns_gethostbyname_r  _nss_mdns4_gethostbyname_r
+ #define _nss_mdns_gethostbyaddr_r  _nss_mdns4_gethostbyaddr_r
+ #elif defined(NSS_IPV4_ONLY) && defined(MDNS_MINIMAL)
+ #define _nss_mdns_gethostbyname2_r _nss_mdns4_minimal_gethostbyname2_r
++#define _nss_mdns_gethostbyname4_r _nss_mdns4_minimal_gethostbyname4_r
+ #define _nss_mdns_gethostbyname_r  _nss_mdns4_minimal_gethostbyname_r
+ #define _nss_mdns_gethostbyaddr_r  _nss_mdns4_minimal_gethostbyaddr_r
+ #elif defined(NSS_IPV6_ONLY) && ! defined(MDNS_MINIMAL)
+ #define _nss_mdns_gethostbyname2_r _nss_mdns6_gethostbyname2_r
++#define _nss_mdns_gethostbyname4_r _nss_mdns6_gethostbyname4_r
+ #define _nss_mdns_gethostbyname_r  _nss_mdns6_gethostbyname_r
+ #define _nss_mdns_gethostbyaddr_r  _nss_mdns6_gethostbyaddr_r
+ #elif defined(NSS_IPV6_ONLY) && defined(MDNS_MINIMAL)
+ #define _nss_mdns_gethostbyname2_r _nss_mdns6_minimal_gethostbyname2_r
++#define _nss_mdns_gethostbyname4_r _nss_mdns6_minimal_gethostbyname4_r
+ #define _nss_mdns_gethostbyname_r  _nss_mdns6_minimal_gethostbyname_r
+ #define _nss_mdns_gethostbyaddr_r  _nss_mdns6_minimal_gethostbyaddr_r
+ #elif defined(MDNS_MINIMAL)
+ #define _nss_mdns_gethostbyname2_r _nss_mdns_minimal_gethostbyname2_r
++#define _nss_mdns_gethostbyname4_r _nss_mdns_minimal_gethostbyname4_r
+ #define _nss_mdns_gethostbyname_r  _nss_mdns_minimal_gethostbyname_r
+ #define _nss_mdns_gethostbyaddr_r  _nss_mdns_minimal_gethostbyaddr_r
+ #endif
+@@ -81,6 +86,12 @@
+         char *name[MAX_ENTRIES];
+     } data;
+ };
++struct user_gai_buf {
++    struct gaih_addrtuple *list_base;
++    int list_size;
++    int list_idx;
++    int wrote_name;
++};
+ 
+ #ifndef NSS_IPV6_ONLY
+ static void ipv4_callback(const ipv4_address_t *ipv4, void *userdata) {
+@@ -93,6 +104,21 @@
+     u->data.ipv4[u->count++] = *ipv4;
+     u->data_len += sizeof(ipv4_address_t);
+ }
++static void ipv4_gai_callback(const ipv4_address_t *ipv4, void *userdata) {
++    struct user_gai_buf *u = userdata;
++    assert(ipv4 && userdata);
++
++    if (u->list_idx+1 >= u->list_size)
++        return;
++
++    u->list_base[u->list_idx].name = 0;
++    u->list_base[u->list_idx].family = AF_INET;
++    u->list_base[u->list_idx].addr[0] = ipv4->address;
++    u->list_base[u->list_idx].scopeid = 0;
++    if (u->list_idx > 0) u->list_base[u->list_idx-1].next = &u->list_base[u->list_idx];
++    u->list_base[u->list_idx].next = 0;
++    u->list_idx += 1;
++}
+ #endif
+ 
+ #ifndef NSS_IPV4_ONLY
+@@ -106,6 +132,21 @@
+     u->data.ipv6[u->count++] = *ipv6;
+     u->data_len += sizeof(ipv6_address_t);
+ }
++static void ipv6_gai_callback(const ipv6_address_t *ipv6, void *userdata) {
++    struct user_gai_buf *u = userdata;
++    assert(ipv6 && userdata);
++
++    if (u->list_idx+1 >= u->list_size)
++        return;
++
++    u->list_base[u->list_idx].name = 0;
++    u->list_base[u->list_idx].family = AF_INET6;
++    memcpy(u->list_base[u->list_idx].addr, ipv6->address, sizeof(u->list_base[u->list_idx].addr));
++    u->list_base[u->list_idx].scopeid = ipv6->if_idx;
++    if (u->list_idx > 0) u->list_base[u->list_idx-1].next = &u->list_base[u->list_idx];
++    u->list_base[u->list_idx].next = 0;
++    u->list_idx += 1;
++}
+ #endif
+ 
+ static void name_callback(const char*name, void *userdata) {
+@@ -538,6 +579,265 @@
+ 
+     status = NSS_STATUS_SUCCESS;
+     
++finish:
++#ifdef ENABLE_LEGACY
++    if (fd >= 0)
++        close(fd);
++#endif
++
++    return status;
++}
++
++enum nss_status _nss_mdns_gethostbyname4_r(
++    const char *name,
++    struct gaih_addrtuple **pat,
++    char *buffer,
++    size_t buflen,
++    int *errnop,
++    int *h_errnop,
++    int32_t *ttlp) {
++
++    struct user_gai_buf u;
++    enum nss_status status = NSS_STATUS_UNAVAIL;
++    int i;
++    size_t l, idx;
++    void (*ipv4_func)(const ipv4_address_t *ipv4, void *userdata);
++    void (*ipv6_func)(const ipv6_address_t *ipv6, void *userdata);
++    int name_allowed;
++    int af = AF_UNSPEC;
++
++#ifdef ENABLE_AVAHI
++    int avahi_works = 1;
++    void * data[32];
++#endif
++
++#ifdef ENABLE_LEGACY
++    int fd = -1;
++#endif
++
++    if (pat) {
++	af = (*pat)->family;
++    }
++
++/*     DEBUG_TRAP; */
++
++#ifdef NSS_IPV6_ONLY
++    if (af == AF_UNSPEC)
++        af = AF_INET6;
++#endif
++
++#ifdef NSS_IPV4_ONLY
++    if (af == AF_UNSPEC)
++        af = AF_INET;
++#endif
++
++#ifdef NSS_IPV4_ONLY
++    if (af != AF_INET) 
++#elif NSS_IPV6_ONLY
++    if (af != AF_INET6)
++#else        
++    if (af != AF_INET && af != AF_INET6 && af != AF_UNSPEC)
++#endif        
++    {    
++        *errnop = EINVAL;
++        *h_errnop = NO_RECOVERY;
++
++        goto finish;
++    }
++
++    if (buflen <
++        sizeof(struct gaih_addrtuple))  {
++        
++        *errnop = ERANGE;
++        *h_errnop = NO_RECOVERY;
++        status = NSS_STATUS_TRYAGAIN;
++        
++        goto finish;
++    }
++    
++    u.list_base = (struct user_gai_buf*) buffer;
++    u.list_size = buflen / sizeof( struct user_gai_buf );
++    u.list_idx = 0;
++    u.wrote_name = 0;
++
++#ifdef NSS_IPV6_ONLY
++    ipv4_func = NULL;
++#else
++    ipv4_func = (af == AF_INET || af == AF_UNSPEC) ? ipv4_gai_callback : NULL;
++#endif    
++
++#ifdef NSS_IPV4_ONLY
++    ipv6_func = NULL;
++#else
++    ipv6_func = (af == AF_INET6 || af == AF_UNSPEC) ? ipv6_gai_callback : NULL;
++#endif
++
++    name_allowed = verify_name_allowed(name);
++    
++#ifdef ENABLE_AVAHI
++
++    if (avahi_works && name_allowed) {
++        int r;
++
++	if (af == AF_INET || af == AF_UNSPEC) {
++	    if ((r = avahi_resolve_name(AF_INET, name, data)) < 0)
++		avahi_works = 0;
++	    else if (r == 0) {
++		if (ipv4_func) {
++		    ipv4_func((ipv4_address_t*) data, &u);
++		}
++	    }
++	    else
++		status = NSS_STATUS_NOTFOUND;
++	}
++	if (af == AF_INET6 || af == AF_UNSPEC) {
++	    if ((r = avahi_resolve_name(AF_INET6, name, data)) < 0)
++		avahi_works = 0;
++	    else if (r == 0) {
++		if (ipv6_func)
++		    ipv6_func((ipv6_address_t*)data, &u);
++	    }
++	    else
++		status = NSS_STATUS_NOTFOUND;
++	}
++    }
++
++#ifdef HONOUR_SEARCH_DOMAINS
++    if (u.list_idx == 0 && avahi_works && !ends_with(name, ".")) {
++        char **domains;
++
++        if ((domains = get_search_domains())) {
++            char **p;
++            
++            /* Try to concatenate host names */
++	    for (p = domains; *p; p++) {
++                int fullnamesize;
++                char *fullname;
++                
++	        fullnamesize = strlen(name) + strlen(*p) + 2;
++
++                if (!(fullname = malloc(fullnamesize)))
++                    break;
++                
++		snprintf(fullname, fullnamesize, "%s.%s", name, *p);
++
++                if (verify_name_allowed(fullname)) {
++                    int r;
++
++		    if (af == AF_INET || af == AF_UNSPEC) {
++			r = avahi_resolve_name(AF_INET, fullname, data);
++                    
++			if (r < 0) {
++			    /* Lookup failed */
++			    avahi_works = 0;
++			    free(fullname);
++			    break;
++			} else if (r == 0) {
++			    /* Lookup succeeded */
++			    if (ipv4_func)
++				ipv4_func((ipv4_address_t*) data, &u);
++			}
++		    }
++		    if (af == AF_INET6 || af == AF_UNSPEC) {
++			r = avahi_resolve_name(AF_INET6, fullname, data);
++                    
++			if (r < 0) {
++			    /* Lookup failed */
++			    avahi_works = 0;
++			    free(fullname);
++			    break;
++			} else if (r == 0) {
++			    /* Lookup succeeded */
++			    if (ipv6_func)
++				ipv6_func((ipv6_address_t*)data, &u);
++			}
++		    }
++		    free(fullname);
++		    if (u.list_idx > 0) break;
++                    
++		} else
++                    free(fullname);
++	    }
++            
++	    free_domains(domains);
++	}
++    }
++#endif /* HONOUR_SEARCH_DOMAINS */
++#endif /* ENABLE_AVAHI */
++
++#if defined(ENABLE_LEGACY) && defined(ENABLE_AVAHI)
++    if (u.list_idx == 0 && !avahi_works) 
++#endif
++
++#if defined(ENABLE_LEGACY)
++    {
++        if ((fd = mdns_open_socket()) < 0) {
++            *errnop = errno;
++            *h_errnop = NO_RECOVERY;
++            goto finish;
++        }
++
++        if (name_allowed) {
++            /* Ignore return value */
++            mdns_query_name(fd, name, ipv4_func, ipv6_func, &u);
++
++            if (!u.list_idx)
++                status = NSS_STATUS_NOTFOUND;
++        }
++
++#ifdef HONOUR_SEARCH_DOMAINS
++        if (u.list_idx == 0 && !ends_with(name, ".")) {
++            char **domains;
++            
++            /* Try the search domains if the user did not use a traling '.' */
++            
++            if ((domains = get_search_domains())) {
++                char **p;
++                
++                for (p = domains; *p; p++) {
++                    int fullnamesize = 0;
++                    char *fullname = NULL;
++                    
++                    fullnamesize = strlen(name) + strlen(*p) + 2;
++                    if (!(fullname = malloc(fullnamesize)))
++                        break;
++                    
++                    snprintf(fullname, fullnamesize, "%s.%s", name, *p);
++                    
++                    if (verify_name_allowed(fullname)) {
++                        
++                        /* Ignore return value */
++                        mdns_query_name(fd, fullname, ipv4_func, ipv6_func, &u);
++                        
++                        if (u.list_idx > 0) {
++                            /* We found something, so let's quit */
++                            free(fullname);
++                            break;
++                        } else
++                            status = NSS_STATUS_NOTFOUND;
++
++                    }
++                    
++                    free(fullname);
++                }
++                
++                free_domains(domains);
++	    }
++        }
++#endif /* HONOUR_SEARCH_DOMAINS */
++    }
++#endif /* ENABLE_LEGACY */
++
++    if (u.list_idx == 0) {
++        *errnop = ETIMEDOUT;
++        *h_errnop = HOST_NOT_FOUND;
++        goto finish;
++    }
++    
++    *pat = (struct gaih_addrtuple*) buffer;
++
++    status = NSS_STATUS_SUCCESS;
++    
+ finish:
+ #ifdef ENABLE_LEGACY
+     if (fd >= 0)
+diff -u src/query.c src/query.c
+--- src/query.c	2007-02-09 00:42:23.000000000 +0800
++++ src/query.c	2013-01-04 09:57:03.778972196 +0800
+@@ -263,7 +263,7 @@
+     return n_sent;
+ }
+ 
+-static int recv_dns_packet(int fd, struct dns_packet **ret_packet, uint8_t *ret_ttl, struct timeval *end) {
++static int recv_dns_packet(int fd, struct dns_packet **ret_packet, uint8_t *ret_ttl, uint32_t *if_idx, struct timeval *end) {
+     struct dns_packet *p= NULL;
+     struct msghdr msg;
+     struct iovec io;
+@@ -286,6 +286,10 @@
+     msg.msg_controllen = sizeof(aux);
+     msg.msg_flags = 0;
+     
++#ifndef IP_PKTINFO
++    *if_idx = 0;
++#endif
++
+     for (;;) {
+         ssize_t l;
+         int r;
+@@ -304,6 +308,14 @@
+                     *ret_ttl = (uint8_t) (*(uint32_t*) CMSG_DATA(cmsg));
+                     break;
+                 }
++#ifdef IP_PKTINFO
++                if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO)
++		{
++                    *if_idx = ((struct in_pktinfo*) CMSG_DATA(cmsg))->ipi_ifindex;
++                    break;
++                }
++#endif
++
+             }
+                      
+             if (!cmsg)
+@@ -427,9 +439,10 @@
+ 
+     while (!done) {
+         uint8_t ttl;
++        uint32_t if_idx;
+         int r;
+ 
+-        if ((r = recv_dns_packet(fd, &p, &ttl, &end)) < 0)
++        if ((r = recv_dns_packet(fd, &p, &ttl, &if_idx, &end)) < 0)
+             return -1;
+         else if (r > 0) /* timeout */
+             return 1;
+@@ -488,6 +501,7 @@
+                         rdlength == sizeof(ipv6_address_t)) {
+                         
+                         ipv6_address_t ipv6;
++                        ipv6.if_idx = if_idx;
+                         
+                         if (dns_packet_consume_bytes(p, &ipv6, sizeof(ipv6_address_t)) < 0)
+                             break;
+@@ -584,9 +598,10 @@
+ 
+     while (!done) {
+         uint8_t ttl;
++        uint32_t if_idx;
+         int r;
+ 
+-        if ((r = recv_dns_packet(fd, &p, &ttl, &end)) < 0)
++        if ((r = recv_dns_packet(fd, &p, &ttl, &if_idx, &end)) < 0)
+             return -1;
+         else if (r > 0) /* timeout */
+             return 1;
+diff -u src/query.h src/query.h
+--- src/query.h	2005-06-21 22:43:23.000000000 +0800
++++ src/query.h	2013-01-03 14:09:22.138018327 +0800
+@@ -30,6 +30,7 @@
+ 
+ typedef struct {
+     uint8_t address[16];
++    uint32_t if_idx;
+ } ipv6_address_t;
+ 

diff --git a/sys-auth/nss-mdns/nss-mdns-0.10-r2.ebuild b/sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild
similarity index 92%
rename from sys-auth/nss-mdns/nss-mdns-0.10-r2.ebuild
rename to sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild
index 5255cd1..3be4d71 100644
--- a/sys-auth/nss-mdns/nss-mdns-0.10-r2.ebuild
+++ b/sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -23,7 +23,8 @@ RDEPEND="${RDEPEND}
 	)"
 
 src_prepare() {
-	epatch "${FILESDIR}"/${PN}-0.10-avahi-socket.patch
+	epatch "${FILESDIR}"/${PN}-0.10-avahi-socket.patch \
+		"${FILESDIR}"/${PN}-0.10-ipv6.patch
 	epatch_user
 	eautoreconf
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-mdns/, sys-auth/nss-mdns/files/
@ 2018-09-06 21:22 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2018-09-06 21:22 UTC (permalink / raw
  To: gentoo-commits

commit:     95b6bb2723c881536a35404b9f8f227b742a74c6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  6 20:54:19 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep  6 21:22:23 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95b6bb27

sys-auth/nss-mdns: Clean old up

 sys-auth/nss-mdns/Manifest                         |   2 -
 .../files/nss-mdns-0.10-avahi-socket.patch         |  14 -
 sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch   | 528 ---------------------
 sys-auth/nss-mdns/metadata.xml                     |   4 -
 sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild          |  57 ---
 sys-auth/nss-mdns/nss-mdns-0.11.ebuild             |  54 ---
 6 files changed, 659 deletions(-)

diff --git a/sys-auth/nss-mdns/Manifest b/sys-auth/nss-mdns/Manifest
index 821d3ef0c5f..b7a8af7b630 100644
--- a/sys-auth/nss-mdns/Manifest
+++ b/sys-auth/nss-mdns/Manifest
@@ -1,3 +1 @@
-DIST nss-mdns-0.10.tar.gz 353130 BLAKE2B 88cc7cbc908f397bbf52f590946b3bc8bc4c71585c9a0a52648ae3dd23b3f5ca9fbd24f0fc7c34dff08d7a4c8d72fec94a51a65650bed41b07aec6c81220d517 SHA512 7c9f4150648dfab34bc6f8551e5b58b0b7065e4c1472efb8ce1b00b2bd75627e5928b2c199d9dae742abe839968a8774e39c7646f8ce855d342b4d90252efc0e
-DIST nss-mdns-0.11.tar.gz 382059 BLAKE2B 5523c76d6f7364efde54b9bf303dfdf34c11b96c9348bfd4a62d095215e7d6f32e0d44e22d21677d51700d458a10f9c36f7ccecb7b4add04fcba629ee19abc21 SHA512 9dceb0f244c4cd27b04ca2014637873a0d137464c26780dfdb228502b06b310991494b115e42e1057c45478361d0e441ec73099fbf56a13a5933618b72390af4
 DIST nss-mdns-0.13.tar.gz 380261 BLAKE2B 555b7b9df8ff15da423712fac04ccbc303395d38a07121906cf31871a8684c71e43809b80674a489d87397902a33f4d19b0ae49a4c384290bad227a24880476f SHA512 f1b379111fb758323179ea3e447d754e934308940b11a8402dfb6033264940d831266d15ae1ee0badfecd5cdc7f589b42e4363dfc058f5e62026017d97eb0a3b

diff --git a/sys-auth/nss-mdns/files/nss-mdns-0.10-avahi-socket.patch b/sys-auth/nss-mdns/files/nss-mdns-0.10-avahi-socket.patch
deleted file mode 100644
index 9ada93d2b8f..00000000000
--- a/sys-auth/nss-mdns/files/nss-mdns-0.10-avahi-socket.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://bugs.gentoo.org/159341
-
-fix the full path to the socket run dir
-
---- src/Makefile.am
-+++ src/Makefile.am
-@@ -20,7 +20,7 @@
- AM_CFLAGS = \
- 	-DMDNS_ALLOW_FILE=\"$(sysconfdir)/mdns.allow\" \
- 	-DRESOLV_CONF_FILE=\"$(sysconfdir)/resolv.conf\" \
--	-DAVAHI_SOCKET=\"$(localstatedir)/run/avahi-daemon/socket\"
-+	-DAVAHI_SOCKET=\"/var/run/avahi-daemon/socket\"
- 
- #AM_CFLAGS += -DNDEBUG=1 -Os

diff --git a/sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch b/sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch
deleted file mode 100644
index 6d6dbc9eab5..00000000000
--- a/sys-auth/nss-mdns/files/nss-mdns-0.10-ipv6.patch
+++ /dev/null
@@ -1,528 +0,0 @@
-diff -u src/avahi.c src/avahi.c
---- src/avahi.c	2006-04-29 05:14:09.000000000 +0800
-+++ src/avahi.c	2013-01-04 10:00:05.025558790 +0800
-@@ -26,6 +26,7 @@
- #include <sys/socket.h>
- #include <string.h>
- #include <stdio.h>
-+#include <stdlib.h>
- #include <sys/types.h>
- #include <arpa/inet.h>
- #include <sys/un.h>
-@@ -34,6 +35,7 @@
- 
- #include "avahi.h"
- #include "util.h"
-+#include "query.h"
- 
- #define WHITESPACE " \t"
- 
-@@ -93,7 +95,8 @@
-     p = ln+1;
-     p += strspn(p, WHITESPACE);
- 
--    /* Skip interface */
-+    /* Parse interface */
-+    if (af == AF_INET6) ((ipv6_address_t*)data)->if_idx = strtoul(p, 0, 10);
-     p += strcspn(p, WHITESPACE);
-     p += strspn(p, WHITESPACE);
- 
-diff -u src/avahi-test.c src/avahi-test.c
---- src/avahi-test.c	2007-02-09 00:42:23.000000000 +0800
-+++ src/avahi-test.c	2013-01-04 09:59:06.174017729 +0800
-@@ -24,6 +24,7 @@
- #include <stdio.h>
- 
- #include "avahi.h"
-+#include "query.h"
- 
- int main(int argc, char *argv[]) {
-     uint8_t data[64];
-@@ -35,15 +36,20 @@
-     else
-         printf("AF_INET: failed (%i).\n", r);
- 
--/*     if ((r = avahi_resolve_name(AF_INET6, argc >= 2 ? argv[1] : "cocaine.local", data)) == 0) */
--/*         printf("AF_INET6: %s\n", inet_ntop(AF_INET6, data, t, sizeof(t))); */
--/*     else */
--/*         printf("AF_INET6: failed (%i).\n", r); */
--
-     if ((r = avahi_resolve_address(AF_INET, data, t, sizeof(t))) == 0)
-         printf("REVERSE: %s\n", t);
-     else
-         printf("REVERSE: failed (%i).\n", r);
-+
-+     if ((r = avahi_resolve_name(AF_INET6, argc >= 2 ? argv[1] : "cocaine.local", data)) == 0)
-+         printf("AF_INET6: %s, %u\n", inet_ntop(AF_INET6, data, t, sizeof(t)), ((ipv6_address_t*)data)->if_idx);
-+     else
-+         printf("AF_INET6: failed (%i).\n", r);
-+
-+    if ((r = avahi_resolve_address(AF_INET6, data, t, sizeof(t))) == 0)
-+        printf("REVERSE: %s\n", t);
-+    else
-+        printf("REVERSE: failed (%i).\n", r);
- 
-     return 0;
- }
-diff -u src/bsdnss.c src/bsdnss.c
---- src/bsdnss.c	2007-02-09 00:42:23.000000000 +0800
-+++ src/bsdnss.c	2013-01-04 09:49:45.566389491 +0800
-@@ -258,6 +258,8 @@
- 			ai->ai_addrlen = sizeof(struct sockaddr_in6);
- 			memcpy(&((struct sockaddr_in6 *)psa)->sin6_addr, hap,
- 			    ai->ai_addrlen);
-+			if (((struct sockaddr_in6 *)psa)->sin6_addr[0] == 0xfe && ((struct sockaddr_in6 *)psa)->sin6_addr[0] == 0x80)
-+			    ((struct sockaddr_in6 *)psa)->sin6_scope_id = ((struct ipv6_address_t*) hap)->if_idx;
- 			break;
- 		default:
- 			ai->ai_addrlen = sizeof(struct sockaddr_storage);
-diff -u src/map-file src/map-file
---- src/map-file	2007-01-02 02:36:21.000000000 +0800
-+++ src/map-file	2013-01-07 08:56:56.406478774 +0800
-@@ -18,6 +18,12 @@
- _nss_mdns_minimal_gethostbyname2_r;         
- _nss_mdns4_minimal_gethostbyname2_r;
- _nss_mdns6_minimal_gethostbyname2_r;
-+_nss_mdns_gethostbyname4_r;         
-+_nss_mdns4_gethostbyname4_r;
-+_nss_mdns6_gethostbyname4_r;
-+_nss_mdns_minimal_gethostbyname4_r;         
-+_nss_mdns4_minimal_gethostbyname4_r;
-+_nss_mdns6_minimal_gethostbyname4_r;
- local: 
- *;
- };
-diff -u src/nss.c src/nss.c
---- src/nss.c	2013-01-07 15:14:23.000000000 +0800
-+++ src/nss.c	2013-01-07 16:52:38.399842517 +0800
-@@ -41,22 +41,27 @@
- 
- #if defined(NSS_IPV4_ONLY) && ! defined(MDNS_MINIMAL)
- #define _nss_mdns_gethostbyname2_r _nss_mdns4_gethostbyname2_r
-+#define _nss_mdns_gethostbyname4_r _nss_mdns4_gethostbyname4_r
- #define _nss_mdns_gethostbyname_r  _nss_mdns4_gethostbyname_r
- #define _nss_mdns_gethostbyaddr_r  _nss_mdns4_gethostbyaddr_r
- #elif defined(NSS_IPV4_ONLY) && defined(MDNS_MINIMAL)
- #define _nss_mdns_gethostbyname2_r _nss_mdns4_minimal_gethostbyname2_r
-+#define _nss_mdns_gethostbyname4_r _nss_mdns4_minimal_gethostbyname4_r
- #define _nss_mdns_gethostbyname_r  _nss_mdns4_minimal_gethostbyname_r
- #define _nss_mdns_gethostbyaddr_r  _nss_mdns4_minimal_gethostbyaddr_r
- #elif defined(NSS_IPV6_ONLY) && ! defined(MDNS_MINIMAL)
- #define _nss_mdns_gethostbyname2_r _nss_mdns6_gethostbyname2_r
-+#define _nss_mdns_gethostbyname4_r _nss_mdns6_gethostbyname4_r
- #define _nss_mdns_gethostbyname_r  _nss_mdns6_gethostbyname_r
- #define _nss_mdns_gethostbyaddr_r  _nss_mdns6_gethostbyaddr_r
- #elif defined(NSS_IPV6_ONLY) && defined(MDNS_MINIMAL)
- #define _nss_mdns_gethostbyname2_r _nss_mdns6_minimal_gethostbyname2_r
-+#define _nss_mdns_gethostbyname4_r _nss_mdns6_minimal_gethostbyname4_r
- #define _nss_mdns_gethostbyname_r  _nss_mdns6_minimal_gethostbyname_r
- #define _nss_mdns_gethostbyaddr_r  _nss_mdns6_minimal_gethostbyaddr_r
- #elif defined(MDNS_MINIMAL)
- #define _nss_mdns_gethostbyname2_r _nss_mdns_minimal_gethostbyname2_r
-+#define _nss_mdns_gethostbyname4_r _nss_mdns_minimal_gethostbyname4_r
- #define _nss_mdns_gethostbyname_r  _nss_mdns_minimal_gethostbyname_r
- #define _nss_mdns_gethostbyaddr_r  _nss_mdns_minimal_gethostbyaddr_r
- #endif
-@@ -81,6 +86,12 @@
-         char *name[MAX_ENTRIES];
-     } data;
- };
-+struct user_gai_buf {
-+    struct gaih_addrtuple *list_base;
-+    int list_size;
-+    int list_idx;
-+    int wrote_name;
-+};
- 
- #ifndef NSS_IPV6_ONLY
- static void ipv4_callback(const ipv4_address_t *ipv4, void *userdata) {
-@@ -93,6 +104,21 @@
-     u->data.ipv4[u->count++] = *ipv4;
-     u->data_len += sizeof(ipv4_address_t);
- }
-+static void ipv4_gai_callback(const ipv4_address_t *ipv4, void *userdata) {
-+    struct user_gai_buf *u = userdata;
-+    assert(ipv4 && userdata);
-+
-+    if (u->list_idx+1 >= u->list_size)
-+        return;
-+
-+    u->list_base[u->list_idx].name = 0;
-+    u->list_base[u->list_idx].family = AF_INET;
-+    u->list_base[u->list_idx].addr[0] = ipv4->address;
-+    u->list_base[u->list_idx].scopeid = 0;
-+    if (u->list_idx > 0) u->list_base[u->list_idx-1].next = &u->list_base[u->list_idx];
-+    u->list_base[u->list_idx].next = 0;
-+    u->list_idx += 1;
-+}
- #endif
- 
- #ifndef NSS_IPV4_ONLY
-@@ -106,6 +132,21 @@
-     u->data.ipv6[u->count++] = *ipv6;
-     u->data_len += sizeof(ipv6_address_t);
- }
-+static void ipv6_gai_callback(const ipv6_address_t *ipv6, void *userdata) {
-+    struct user_gai_buf *u = userdata;
-+    assert(ipv6 && userdata);
-+
-+    if (u->list_idx+1 >= u->list_size)
-+        return;
-+
-+    u->list_base[u->list_idx].name = 0;
-+    u->list_base[u->list_idx].family = AF_INET6;
-+    memcpy(u->list_base[u->list_idx].addr, ipv6->address, sizeof(u->list_base[u->list_idx].addr));
-+    u->list_base[u->list_idx].scopeid = ipv6->if_idx;
-+    if (u->list_idx > 0) u->list_base[u->list_idx-1].next = &u->list_base[u->list_idx];
-+    u->list_base[u->list_idx].next = 0;
-+    u->list_idx += 1;
-+}
- #endif
- 
- static void name_callback(const char*name, void *userdata) {
-@@ -538,6 +579,265 @@
- 
-     status = NSS_STATUS_SUCCESS;
-     
-+finish:
-+#ifdef ENABLE_LEGACY
-+    if (fd >= 0)
-+        close(fd);
-+#endif
-+
-+    return status;
-+}
-+
-+enum nss_status _nss_mdns_gethostbyname4_r(
-+    const char *name,
-+    struct gaih_addrtuple **pat,
-+    char *buffer,
-+    size_t buflen,
-+    int *errnop,
-+    int *h_errnop,
-+    int32_t *ttlp) {
-+
-+    struct user_gai_buf u;
-+    enum nss_status status = NSS_STATUS_UNAVAIL;
-+    int i;
-+    size_t l, idx;
-+    void (*ipv4_func)(const ipv4_address_t *ipv4, void *userdata);
-+    void (*ipv6_func)(const ipv6_address_t *ipv6, void *userdata);
-+    int name_allowed;
-+    int af = AF_UNSPEC;
-+
-+#ifdef ENABLE_AVAHI
-+    int avahi_works = 1;
-+    void * data[32];
-+#endif
-+
-+#ifdef ENABLE_LEGACY
-+    int fd = -1;
-+#endif
-+
-+    if (pat) {
-+	af = (*pat)->family;
-+    }
-+
-+/*     DEBUG_TRAP; */
-+
-+#ifdef NSS_IPV6_ONLY
-+    if (af == AF_UNSPEC)
-+        af = AF_INET6;
-+#endif
-+
-+#ifdef NSS_IPV4_ONLY
-+    if (af == AF_UNSPEC)
-+        af = AF_INET;
-+#endif
-+
-+#ifdef NSS_IPV4_ONLY
-+    if (af != AF_INET) 
-+#elif NSS_IPV6_ONLY
-+    if (af != AF_INET6)
-+#else        
-+    if (af != AF_INET && af != AF_INET6 && af != AF_UNSPEC)
-+#endif        
-+    {    
-+        *errnop = EINVAL;
-+        *h_errnop = NO_RECOVERY;
-+
-+        goto finish;
-+    }
-+
-+    if (buflen <
-+        sizeof(struct gaih_addrtuple))  {
-+        
-+        *errnop = ERANGE;
-+        *h_errnop = NO_RECOVERY;
-+        status = NSS_STATUS_TRYAGAIN;
-+        
-+        goto finish;
-+    }
-+    
-+    u.list_base = (struct user_gai_buf*) buffer;
-+    u.list_size = buflen / sizeof( struct user_gai_buf );
-+    u.list_idx = 0;
-+    u.wrote_name = 0;
-+
-+#ifdef NSS_IPV6_ONLY
-+    ipv4_func = NULL;
-+#else
-+    ipv4_func = (af == AF_INET || af == AF_UNSPEC) ? ipv4_gai_callback : NULL;
-+#endif    
-+
-+#ifdef NSS_IPV4_ONLY
-+    ipv6_func = NULL;
-+#else
-+    ipv6_func = (af == AF_INET6 || af == AF_UNSPEC) ? ipv6_gai_callback : NULL;
-+#endif
-+
-+    name_allowed = verify_name_allowed(name);
-+    
-+#ifdef ENABLE_AVAHI
-+
-+    if (avahi_works && name_allowed) {
-+        int r;
-+
-+	if (af == AF_INET || af == AF_UNSPEC) {
-+	    if ((r = avahi_resolve_name(AF_INET, name, data)) < 0)
-+		avahi_works = 0;
-+	    else if (r == 0) {
-+		if (ipv4_func) {
-+		    ipv4_func((ipv4_address_t*) data, &u);
-+		}
-+	    }
-+	    else
-+		status = NSS_STATUS_NOTFOUND;
-+	}
-+	if (af == AF_INET6 || af == AF_UNSPEC) {
-+	    if ((r = avahi_resolve_name(AF_INET6, name, data)) < 0)
-+		avahi_works = 0;
-+	    else if (r == 0) {
-+		if (ipv6_func)
-+		    ipv6_func((ipv6_address_t*)data, &u);
-+	    }
-+	    else
-+		status = NSS_STATUS_NOTFOUND;
-+	}
-+    }
-+
-+#ifdef HONOUR_SEARCH_DOMAINS
-+    if (u.list_idx == 0 && avahi_works && !ends_with(name, ".")) {
-+        char **domains;
-+
-+        if ((domains = get_search_domains())) {
-+            char **p;
-+            
-+            /* Try to concatenate host names */
-+	    for (p = domains; *p; p++) {
-+                int fullnamesize;
-+                char *fullname;
-+                
-+	        fullnamesize = strlen(name) + strlen(*p) + 2;
-+
-+                if (!(fullname = malloc(fullnamesize)))
-+                    break;
-+                
-+		snprintf(fullname, fullnamesize, "%s.%s", name, *p);
-+
-+                if (verify_name_allowed(fullname)) {
-+                    int r;
-+
-+		    if (af == AF_INET || af == AF_UNSPEC) {
-+			r = avahi_resolve_name(AF_INET, fullname, data);
-+                    
-+			if (r < 0) {
-+			    /* Lookup failed */
-+			    avahi_works = 0;
-+			    free(fullname);
-+			    break;
-+			} else if (r == 0) {
-+			    /* Lookup succeeded */
-+			    if (ipv4_func)
-+				ipv4_func((ipv4_address_t*) data, &u);
-+			}
-+		    }
-+		    if (af == AF_INET6 || af == AF_UNSPEC) {
-+			r = avahi_resolve_name(AF_INET6, fullname, data);
-+                    
-+			if (r < 0) {
-+			    /* Lookup failed */
-+			    avahi_works = 0;
-+			    free(fullname);
-+			    break;
-+			} else if (r == 0) {
-+			    /* Lookup succeeded */
-+			    if (ipv6_func)
-+				ipv6_func((ipv6_address_t*)data, &u);
-+			}
-+		    }
-+		    free(fullname);
-+		    if (u.list_idx > 0) break;
-+                    
-+		} else
-+                    free(fullname);
-+	    }
-+            
-+	    free_domains(domains);
-+	}
-+    }
-+#endif /* HONOUR_SEARCH_DOMAINS */
-+#endif /* ENABLE_AVAHI */
-+
-+#if defined(ENABLE_LEGACY) && defined(ENABLE_AVAHI)
-+    if (u.list_idx == 0 && !avahi_works) 
-+#endif
-+
-+#if defined(ENABLE_LEGACY)
-+    {
-+        if ((fd = mdns_open_socket()) < 0) {
-+            *errnop = errno;
-+            *h_errnop = NO_RECOVERY;
-+            goto finish;
-+        }
-+
-+        if (name_allowed) {
-+            /* Ignore return value */
-+            mdns_query_name(fd, name, ipv4_func, ipv6_func, &u);
-+
-+            if (!u.list_idx)
-+                status = NSS_STATUS_NOTFOUND;
-+        }
-+
-+#ifdef HONOUR_SEARCH_DOMAINS
-+        if (u.list_idx == 0 && !ends_with(name, ".")) {
-+            char **domains;
-+            
-+            /* Try the search domains if the user did not use a traling '.' */
-+            
-+            if ((domains = get_search_domains())) {
-+                char **p;
-+                
-+                for (p = domains; *p; p++) {
-+                    int fullnamesize = 0;
-+                    char *fullname = NULL;
-+                    
-+                    fullnamesize = strlen(name) + strlen(*p) + 2;
-+                    if (!(fullname = malloc(fullnamesize)))
-+                        break;
-+                    
-+                    snprintf(fullname, fullnamesize, "%s.%s", name, *p);
-+                    
-+                    if (verify_name_allowed(fullname)) {
-+                        
-+                        /* Ignore return value */
-+                        mdns_query_name(fd, fullname, ipv4_func, ipv6_func, &u);
-+                        
-+                        if (u.list_idx > 0) {
-+                            /* We found something, so let's quit */
-+                            free(fullname);
-+                            break;
-+                        } else
-+                            status = NSS_STATUS_NOTFOUND;
-+
-+                    }
-+                    
-+                    free(fullname);
-+                }
-+                
-+                free_domains(domains);
-+	    }
-+        }
-+#endif /* HONOUR_SEARCH_DOMAINS */
-+    }
-+#endif /* ENABLE_LEGACY */
-+
-+    if (u.list_idx == 0) {
-+        *errnop = ETIMEDOUT;
-+        *h_errnop = HOST_NOT_FOUND;
-+        goto finish;
-+    }
-+    
-+    *pat = (struct gaih_addrtuple*) buffer;
-+
-+    status = NSS_STATUS_SUCCESS;
-+    
- finish:
- #ifdef ENABLE_LEGACY
-     if (fd >= 0)
-diff -u src/query.c src/query.c
---- src/query.c	2007-02-09 00:42:23.000000000 +0800
-+++ src/query.c	2013-01-04 09:57:03.778972196 +0800
-@@ -263,7 +263,7 @@
-     return n_sent;
- }
- 
--static int recv_dns_packet(int fd, struct dns_packet **ret_packet, uint8_t *ret_ttl, struct timeval *end) {
-+static int recv_dns_packet(int fd, struct dns_packet **ret_packet, uint8_t *ret_ttl, uint32_t *if_idx, struct timeval *end) {
-     struct dns_packet *p= NULL;
-     struct msghdr msg;
-     struct iovec io;
-@@ -286,6 +286,10 @@
-     msg.msg_controllen = sizeof(aux);
-     msg.msg_flags = 0;
-     
-+#ifndef IP_PKTINFO
-+    *if_idx = 0;
-+#endif
-+
-     for (;;) {
-         ssize_t l;
-         int r;
-@@ -304,6 +308,14 @@
-                     *ret_ttl = (uint8_t) (*(uint32_t*) CMSG_DATA(cmsg));
-                     break;
-                 }
-+#ifdef IP_PKTINFO
-+                if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO)
-+		{
-+                    *if_idx = ((struct in_pktinfo*) CMSG_DATA(cmsg))->ipi_ifindex;
-+                    break;
-+                }
-+#endif
-+
-             }
-                      
-             if (!cmsg)
-@@ -427,9 +439,10 @@
- 
-     while (!done) {
-         uint8_t ttl;
-+        uint32_t if_idx;
-         int r;
- 
--        if ((r = recv_dns_packet(fd, &p, &ttl, &end)) < 0)
-+        if ((r = recv_dns_packet(fd, &p, &ttl, &if_idx, &end)) < 0)
-             return -1;
-         else if (r > 0) /* timeout */
-             return 1;
-@@ -488,6 +501,7 @@
-                         rdlength == sizeof(ipv6_address_t)) {
-                         
-                         ipv6_address_t ipv6;
-+                        ipv6.if_idx = if_idx;
-                         
-                         if (dns_packet_consume_bytes(p, &ipv6, sizeof(ipv6_address_t)) < 0)
-                             break;
-@@ -584,9 +598,10 @@
- 
-     while (!done) {
-         uint8_t ttl;
-+        uint32_t if_idx;
-         int r;
- 
--        if ((r = recv_dns_packet(fd, &p, &ttl, &end)) < 0)
-+        if ((r = recv_dns_packet(fd, &p, &ttl, &if_idx, &end)) < 0)
-             return -1;
-         else if (r > 0) /* timeout */
-             return 1;
-diff -u src/query.h src/query.h
---- src/query.h	2005-06-21 22:43:23.000000000 +0800
-+++ src/query.h	2013-01-03 14:09:22.138018327 +0800
-@@ -30,6 +30,7 @@
- 
- typedef struct {
-     uint8_t address[16];
-+    uint32_t if_idx;
- } ipv6_address_t;
- 

diff --git a/sys-auth/nss-mdns/metadata.xml b/sys-auth/nss-mdns/metadata.xml
index a409ede683e..0c9ca91ffcf 100644
--- a/sys-auth/nss-mdns/metadata.xml
+++ b/sys-auth/nss-mdns/metadata.xml
@@ -8,10 +8,6 @@
 		<email>mgorny@gentoo.org</email>
 		<name>Michał Górny</name>
 	</maintainer>
-	<use>
-		<flag name="search-domains">Honour search domains from
-		/etc/resolv.conf (see bug #201948 for possible side effects)</flag>
-	</use>
 	<longdescription lang="en">
 		Name service switch module for multicast dns.
 	</longdescription>

diff --git a/sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild b/sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild
deleted file mode 100644
index 4f91439d370..00000000000
--- a/sys-auth/nss-mdns/nss-mdns-0.10-r3.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-inherit autotools eutils multilib-minimal
-
-DESCRIPTION="Name Service Switch module for Multicast DNS"
-HOMEPAGE="http://0pointer.de/lennart/projects/nss-mdns/"
-SRC_URI="http://0pointer.de/lennart/projects/nss-mdns/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~hppa ~mips ppc x86"
-IUSE="search-domains"
-
-RDEPEND=">=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}]"
-DEPEND="${RDEPEND}"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-0.10-avahi-socket.patch \
-		"${FILESDIR}"/${PN}-0.10-ipv6.patch
-	epatch_user
-	eautoreconf
-}
-
-multilib_src_configure() {
-	ECONF_SOURCE=${S} \
-	econf \
-		$(use_enable search-domains) \
-		--enable-avahi
-}
-
-multilib_src_install_all() {
-	dodoc README
-
-	insinto /etc
-	doins "${FILESDIR}"/mdns.allow
-}
-
-pkg_postinst() {
-	ewarn
-	ewarn "You must modify your name service switch look up file to enable"
-	ewarn "multicast DNS lookups.  If you wish to resolve only IPv6 addresses"
-	ewarn "use mdns6.  For IPv4 addresses only, use mdns4.  To resolve both"
-	ewarn "use mdns.  Keep in mind that mdns will be slower if there are no"
-	ewarn "IPv6 addresses published via mDNS on the network.  There are also"
-	ewarn "minimal (mdns?_minimal) libraries which only lookup .local hosts"
-	ewarn "and 169.254.x.x addresses."
-	ewarn
-	ewarn "Add the appropriate mdns into the hosts line in /etc/nsswitch.conf"
-	ewarn "An example line looks like:"
-	ewarn "hosts:	files mdns4_minimal [NOTFOUND=return] dns mdns4"
-	ewarn
-	ewarn "If you want to perform mDNS lookups for domains other than the ones"
-	ewarn "ending in .local, add them to /etc/mdns.allow"
-	ewarn
-}

diff --git a/sys-auth/nss-mdns/nss-mdns-0.11.ebuild b/sys-auth/nss-mdns/nss-mdns-0.11.ebuild
deleted file mode 100644
index d93a77b414f..00000000000
--- a/sys-auth/nss-mdns/nss-mdns-0.11.ebuild
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-inherit multilib-minimal
-
-DESCRIPTION="Name Service Switch module for Multicast DNS"
-HOMEPAGE="https://github.com/lathiat/nss-mdns"
-SRC_URI="https://github.com/lathiat/nss-mdns/releases/download/v${PV}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~x86"
-IUSE=""
-
-RDEPEND=">=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}]"
-DEPEND="${RDEPEND}"
-
-multilib_src_configure() {
-	local myconf=(
-		# $(localstatedir)/run/... is used to locate avahi-daemon socket
-		--localstatedir=/var
-	)
-
-	ECONF_SOURCE=${S} \
-	econf "${myconf[@]}"
-}
-
-# the check target only compiles manual-use test programs
-src_test() { :; }
-
-multilib_src_install_all() {
-	dodoc *.md
-
-	insinto /etc
-	doins "${FILESDIR}"/mdns.allow
-}
-
-pkg_postinst() {
-	ewarn "You have to modify your name service switch look up file to enable"
-	ewarn "multicast DNS lookups.  If you wish to resolve only IPv6 addresses"
-	ewarn "use mdns6.  For IPv4 addresses only, use mdns4.  To resolve both"
-	ewarn "use mdns.  Keep in mind that mdns will be slower if there are no"
-	ewarn "IPv6 addresses published via mDNS on the network.  There are also"
-	ewarn "minimal (mdns?_minimal) libraries which only lookup .local hosts"
-	ewarn "and 169.254.x.x addresses."
-	ewarn
-	ewarn "Add the appropriate mdns into the hosts line in /etc/nsswitch.conf."
-	ewarn "An example line looks like:"
-	ewarn "hosts:	files mdns4_minimal [NOTFOUND=return] dns mdns4"
-	ewarn
-	ewarn "If you want to perform mDNS lookups for domains other than the ones"
-	ewarn "ending in .local, add them to /etc/mdns.allow."
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-mdns/, sys-auth/nss-mdns/files/
@ 2024-01-17  5:47 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-01-17  5:47 UTC (permalink / raw
  To: gentoo-commits

commit:     1b7f453040380117f1789c851411e5157f0da93a
Author:     Nicholas Vinson <nvinson234 <AT> gmail <DOT> com>
AuthorDate: Sun Jan 14 14:26:37 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 17 05:45:03 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b7f4530

sys-auth/nss-mdns: Apply upstream ver. sym. patch

Update ebuild to apply proposed lld-17 version symbol patch from
upstream. The upstream patch splits the symbol map into multiple files
with each file tailored to its corresponding shared library.

Upstream PR: https://github.com/avahi/nss-mdns/pull/93

Bug: https://bugs.gentoo.org/919484
Signed-off-by: Nicholas Vinson <nvinson234 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34798
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/lld-17-undefined-versioned-symbols.patch | 160 +++++++++++++++++++++
 sys-auth/nss-mdns/nss-mdns-0.15.1.ebuild           |  13 +-
 2 files changed, 171 insertions(+), 2 deletions(-)

diff --git a/sys-auth/nss-mdns/files/lld-17-undefined-versioned-symbols.patch b/sys-auth/nss-mdns/files/lld-17-undefined-versioned-symbols.patch
new file mode 100644
index 000000000000..905e41853871
--- /dev/null
+++ b/sys-auth/nss-mdns/files/lld-17-undefined-versioned-symbols.patch
@@ -0,0 +1,160 @@
+Gentoo bug: https://bugs.gentoo.org/919484
+Upstream PR: https://github.com/avahi/nss-mdns/pull/93
+diff --git a/Makefile.am b/Makefile.am
+index d5a83c1..6df75f3 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -17,9 +17,6 @@
+ EXTRA_DIST=bootstrap.sh README.md ACKNOWLEDGEMENTS.md NEWS.md LICENSE
+ ACLOCAL_AMFLAGS=-I m4
+ 
+-# src
+-EXTRA_DIST += src/map-file
+-
+ AM_CFLAGS = \
+ 	-DMDNS_ALLOW_FILE=\"$(MDNS_ALLOW_FILE)\" \
+ 	-DAVAHI_SOCKET=\"$(AVAHI_SOCKET)\"
+@@ -47,29 +44,53 @@ endif
+ 
+ check_PROGRAMS = nss-test avahi-test
+ 
++src/libnss-mdns-la-map-file: $(srcdir)/src/map-file.in $(srcdir)/src/nss.h
++	$(COMPILE) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(libnss_mdns_la_CFLAGS) -E -x assembler-with-cpp -DVER_SYM_MAP_GEN -o $@ $<
++
++src/libnss-mdns-minimal-la-map-file: $(srcdir)/src/map-file.in $(srcdir)/src/nss.h
++	$(COMPILE) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(libnss_mdns_minimal_la_CFLAGS) -E -x assembler-with-cpp -DVER_SYM_MAP_GEN -o $@ $<
++
++src/libnss-mdns4-la-map-file: $(srcdir)/src/map-file.in $(srcdir)/src/nss.h
++	$(COMPILE) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(libnss_mdns4_la_CFLAGS) -E -x assembler-with-cpp -DVER_SYM_MAP_GEN -o $@ $<
++
++src/libnss-mdns4-minimal-la-map-file: $(srcdir)/src/map-file.in $(srcdir)/src/nss.h
++	$(COMPILE) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(libnss_mdns4_minimal_la_CFLAGS) -E -x assembler-with-cpp -DVER_SYM_MAP_GEN -o $@ $<
++
++src/libnss-mdns6-la-map-file: $(srcdir)/src/map-file.in $(srcdir)/src/nss.h
++	$(COMPILE) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(libnss_mdns6_la_CFLAGS) -E -x assembler-with-cpp -DVER_SYM_MAP_GEN -o $@ $<
++
++src/libnss-mdns6-minimal-la-map-file: $(srcdir)/src/map-file.in $(srcdir)/src/nss.h
++	$(COMPILE) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(libnss_mdns6_minimal_la_CFLAGS) -E -x assembler-with-cpp -DVER_SYM_MAP_GEN -o $@ $<
++
+ libnss_mdns_la_SOURCES=src/util.c src/util.h src/avahi.c src/avahi.h src/nss.c src/nss.h
++EXTRA_libnss_mdns_la_DEPENDENCIES=src/libnss-mdns-la-map-file
+ libnss_mdns_la_CFLAGS=$(AM_CFLAGS)
+-libnss_mdns_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=$(srcdir)/src/map-file
++libnss_mdns_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=src/libnss-mdns-la-map-file
+ 
+ libnss_mdns_minimal_la_SOURCES=$(libnss_mdns_la_SOURCES)
++EXTRA_libnss_mdns_minimal_la_DEPENDENCIES=src/libnss-mdns-minimal-la-map-file
+ libnss_mdns_minimal_la_CFLAGS=$(libnss_mdns_la_CFLAGS) -DMDNS_MINIMAL
+-libnss_mdns_minimal_la_LDFLAGS=$(libnss_mdns_la_LDFLAGS)
++libnss_mdns_minimal_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=src/libnss-mdns-minimal-la-map-file
+ 
+ libnss_mdns4_la_SOURCES=$(libnss_mdns_la_SOURCES)
++EXTRA_libnss_mdns4_la_DEPENDENCIES=src/libnss-mdns4-la-map-file
+ libnss_mdns4_la_CFLAGS=$(libnss_mdns_la_CFLAGS) -DNSS_IPV4_ONLY=1
+-libnss_mdns4_la_LDFLAGS=$(libnss_mdns_la_LDFLAGS)
++libnss_mdns4_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=src/libnss-mdns4-la-map-file
+ 
+ libnss_mdns4_minimal_la_SOURCES=$(libnss_mdns_la_SOURCES)
++EXTRA_libnss_mdns4_minimal_la_DEPENDENCIES=src/libnss-mdns4-minimal-la-map-file
+ libnss_mdns4_minimal_la_CFLAGS=$(libnss_mdns_la_CFLAGS) -DNSS_IPV4_ONLY=1 -DMDNS_MINIMAL
+-libnss_mdns4_minimal_la_LDFLAGS=$(libnss_mdns_la_LDFLAGS)
++libnss_mdns4_minimal_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=src/libnss-mdns4-minimal-la-map-file
+ 
+ libnss_mdns6_la_SOURCES=$(libnss_mdns_la_SOURCES)
++EXTRA_libnss_mdns6_la_DEPENDENCIES=src/libnss-mdns6-la-map-file
+ libnss_mdns6_la_CFLAGS=$(libnss_mdns_la_CFLAGS) -DNSS_IPV6_ONLY=1
+-libnss_mdns6_la_LDFLAGS=$(libnss_mdns_la_LDFLAGS)
++libnss_mdns6_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=src/libnss-mdns6-la-map-file
+ 
+ libnss_mdns6_minimal_la_SOURCES=$(libnss_mdns_la_SOURCES)
++EXTRA_libnss_mdns6_minimal_la_DEPENDENCIES=src/libnss-mdns6-minimal-la-map-file
+ libnss_mdns6_minimal_la_CFLAGS=$(libnss_mdns_la_CFLAGS) -DNSS_IPV6_ONLY=1 -DMDNS_MINIMAL
+-libnss_mdns6_minimal_la_LDFLAGS=$(libnss_mdns_la_LDFLAGS)
++libnss_mdns6_minimal_la_LDFLAGS=$(AM_LDFLAGS) -shrext .so.2 -Wl,-version-script=src/libnss-mdns6-minimal-la-map-file
+ 
+ nss_mdns_la_SOURCES=$(libnss_mdns_la_SOURCES) src/bsdnss.c
+ nss_mdns_la_CFLAGS=$(AM_CFLAGS)
+diff --git a/src/map-file b/src/map-file
+deleted file mode 100644
+index 69e7987..0000000
+--- a/src/map-file
++++ /dev/null
+@@ -1,41 +0,0 @@
+-NSSMDNS_0 {
+-global:
+-
+-_nss_mdns_gethostbyaddr_r;
+-_nss_mdns4_gethostbyaddr_r;
+-_nss_mdns6_gethostbyaddr_r;
+-_nss_mdns_minimal_gethostbyaddr_r;
+-_nss_mdns4_minimal_gethostbyaddr_r;
+-_nss_mdns6_minimal_gethostbyaddr_r;
+-
+-_nss_mdns_gethostbyname_r;
+-_nss_mdns4_gethostbyname_r;
+-_nss_mdns6_gethostbyname_r;
+-_nss_mdns_minimal_gethostbyname_r;
+-_nss_mdns4_minimal_gethostbyname_r;
+-_nss_mdns6_minimal_gethostbyname_r;
+-
+-_nss_mdns_gethostbyname2_r;
+-_nss_mdns4_gethostbyname2_r;
+-_nss_mdns6_gethostbyname2_r;
+-_nss_mdns_minimal_gethostbyname2_r;
+-_nss_mdns4_minimal_gethostbyname2_r;
+-_nss_mdns6_minimal_gethostbyname2_r;
+-
+-_nss_mdns_gethostbyname3_r;
+-_nss_mdns4_gethostbyname3_r;
+-_nss_mdns6_gethostbyname3_r;
+-_nss_mdns_minimal_gethostbyname3_r;
+-_nss_mdns4_minimal_gethostbyname3_r;
+-_nss_mdns6_minimal_gethostbyname3_r;
+-
+-_nss_mdns_gethostbyname4_r;
+-_nss_mdns4_gethostbyname4_r;
+-_nss_mdns6_gethostbyname4_r;
+-_nss_mdns_minimal_gethostbyname4_r;
+-_nss_mdns4_minimal_gethostbyname4_r;
+-_nss_mdns6_minimal_gethostbyname4_r;
+-
+-local:
+-*;
+-};
+diff --git a/src/map-file.in b/src/map-file.in
+new file mode 100644
+index 0000000..caecf41
+--- /dev/null
++++ b/src/map-file.in
+@@ -0,0 +1,14 @@
++NSSMDNS_0 {
++global:
++
++#include "nss.h"
++
++_nss_mdns_gethostbyaddr_r;
++_nss_mdns_gethostbyname2_r;
++_nss_mdns_gethostbyname3_r;
++_nss_mdns_gethostbyname4_r;
++_nss_mdns_gethostbyname_r;
++
++local:
++*;
++};
+diff --git a/src/nss.h b/src/nss.h
+index dd8dbff..d63f51c 100644
+--- a/src/nss.h
++++ b/src/nss.h
+@@ -33,6 +33,7 @@
+ #define _nss_mdns_gethostbyaddr_r _nss_mdns_minimal_gethostbyaddr_r
+ #endif
+ 
++#ifndef VER_SYM_MAP_GEN
+ // Define prototypes for nss function we're going to export (fixes GCC warnings)
+ #ifndef __FreeBSD__
+ enum nss_status _nss_mdns_gethostbyname4_r(const char*, struct gaih_addrtuple**,
+@@ -50,3 +51,4 @@ enum nss_status _nss_mdns_gethostbyaddr_r(const void*, int, int,
+                                           int*);
+ 
+ #endif
++#endif

diff --git a/sys-auth/nss-mdns/nss-mdns-0.15.1.ebuild b/sys-auth/nss-mdns/nss-mdns-0.15.1.ebuild
index 13fffc2c4aae..3a3ef1f43012 100644
--- a/sys-auth/nss-mdns/nss-mdns-0.15.1.ebuild
+++ b/sys-auth/nss-mdns/nss-mdns-0.15.1.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit multilib-minimal
+inherit autotools multilib-minimal
 
 DESCRIPTION="Name Service Switch module for Multicast DNS"
 HOMEPAGE="https://github.com/lathiat/nss-mdns"
@@ -18,6 +18,15 @@ RDEPEND=">=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}]"
 DEPEND="${RDEPEND}
 	test? ( >=dev-libs/check-0.11[${MULTILIB_USEDEP}] )"
 
+PATCHES=(
+	"${FILESDIR}"/lld-17-undefined-versioned-symbols.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
 multilib_src_configure() {
 	local myconf=(
 		# $(localstatedir)/run/... is used to locate avahi-daemon socket


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-17  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-29 18:58 [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-mdns/, sys-auth/nss-mdns/files/ Amy Winston
  -- strict thread matches above, loose matches on Subject: below --
2018-09-06 21:22 Michał Górny
2024-01-17  5:47 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox