Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2019 20:49:47 +0000 (UTC)
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352189 - stable/12/lib/libcasper/services/cap_dns
Message-ID:  <201909102049.x8AKnlws070319@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: oshogbo
Date: Tue Sep 10 20:49:47 2019
New Revision: 352189
URL: https://svnweb.freebsd.org/changeset/base/352189

Log:
  MFCr340638:
   libcasper: provide compatibility with the old version of service
  
    Some external tools like tcpdump(1) have upstream the changes with old limits
    name. Because of that provide compatibility with the old names.
  
    Reported by:  emaste

Modified:
  stable/12/lib/libcasper/services/cap_dns/cap_dns.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libcasper/services/cap_dns/cap_dns.c
==============================================================================
--- stable/12/lib/libcasper/services/cap_dns/cap_dns.c	Tue Sep 10 20:45:51 2019	(r352188)
+++ stable/12/lib/libcasper/services/cap_dns/cap_dns.c	Tue Sep 10 20:49:47 2019	(r352189)
@@ -474,7 +474,8 @@ dns_gethostbyname(const nvlist_t *limits, const nvlist
 	struct hostent *hp;
 	int family;
 
-	if (!dns_allowed_type(limits, "NAME2ADDR"))
+	if (!dns_allowed_type(limits, "NAME2ADDR") &&
+	    !dns_allowed_type(limits, "NAME"))
 		return (NO_RECOVERY);
 
 	family = (int)nvlist_get_number(nvlin, "family");
@@ -498,7 +499,8 @@ dns_gethostbyaddr(const nvlist_t *limits, const nvlist
 	size_t addrsize;
 	int family;
 
-	if (!dns_allowed_type(limits, "ADDR2NAME"))
+	if (!dns_allowed_type(limits, "ADDR2NAME") &&
+	    !dns_allowed_type(limits, "ADDR"))
 		return (NO_RECOVERY);
 
 	family = (int)nvlist_get_number(nvlin, "family");
@@ -524,7 +526,8 @@ dns_getnameinfo(const nvlist_t *limits, const nvlist_t
 	socklen_t salen;
 	int error, flags;
 
-	if (!dns_allowed_type(limits, "ADDR2NAME"))
+	if (!dns_allowed_type(limits, "ADDR2NAME") &&
+	    !dns_allowed_type(limits, "ADDR"))
 		return (NO_RECOVERY);
 
 	error = 0;
@@ -617,7 +620,8 @@ dns_getaddrinfo(const nvlist_t *limits, const nvlist_t
 	unsigned int ii;
 	int error, family, n;
 
-	if (!dns_allowed_type(limits, "NAME2ADDR"))
+	if (!dns_allowed_type(limits, "NAME2ADDR") &&
+	    !dns_allowed_type(limits, "NAME"))
 		return (NO_RECOVERY);
 
 	hostname = dnvlist_get_string(nvlin, "hostname", NULL);
@@ -703,7 +707,9 @@ dns_limit(const nvlist_t *oldlimits, const nvlist_t *n
 				return (EINVAL);
 			type = nvlist_get_string(newlimits, name);
 			if (strcmp(type, "ADDR2NAME") != 0 &&
-			    strcmp(type, "NAME2ADDR") != 0) {
+			    strcmp(type, "NAME2ADDR") != 0 &&
+			    strcmp(type, "ADDR") != 0 &&
+			    strcmp(type, "NAME") != 0) {
 				return (EINVAL);
 			}
 			if (!dns_allowed_type(oldlimits, type))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909102049.x8AKnlws070319>