[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Mon Sep 2 03:58:04 MDT 2013


The branch, v4-0-test has been updated
       via  8749a30 s3:lib/gencache: place gencache.tdb into /var/cache/samba
       via  825d273 python/provision: remove unused linklocal=False argument from interface_ips_v6()
       via  1cfb0ae s4:samba_upgradedns: don't pass linklocal=False to interface_ips_v6()
       via  ad2dc0f python/pyglue: filter out loopback and linklocal addresses unless all_interfaces is given
      from  25ded36 Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 8749a307c5d24bf9d613f7edf3354b689eaaf83e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 28 11:00:27 2013 +0100

    s3:lib/gencache: place gencache.tdb into /var/cache/samba
    
    /var/lock/samba is located on tmpfs on newer systems,
    but we want to keep things like the server affinity cache
    across reboots.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 54529fd354275cfb4ece407f95ef34675b202ea3)
    
    Fix bug #9802 - gencache.tdb should be moved to /var/cache/samba.
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Mon Sep  2 11:57:51 CEST 2013 on sn-devel-104

commit 825d2731a7276848d8a673c05c4a503a37c2904c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 30 15:18:44 2013 +0200

    python/provision: remove unused linklocal=False argument from interface_ips_v6()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Bjoern Jacke <bj at sernet.de>
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Fri Aug 30 17:33:58 CEST 2013 on sn-devel-104
    
    (cherry picked from commit 3430448fc01ce3fbe0606a2c239d3c98a5b78361)
    
    The last 3 patches address bug #10030 - ::1 added to nameserver on join.

commit 1cfb0ae84885215c186650f941fd867868df7c11
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 30 15:17:59 2013 +0200

    s4:samba_upgradedns: don't pass linklocal=False to interface_ips_v6()
    
    This is the default...
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Bjoern Jacke <bj at sernet.de>
    (cherry picked from commit 9edc0276c742194ec381c266acedf3216ccf1c69)

commit ad2dc0facbc02e82cae1882a3e15aae81f1cfb53
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 30 14:59:01 2013 +0200

    python/pyglue: filter out loopback and linklocal addresses unless all_interfaces is given
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=10030
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Bjoern Jacke <bj at sernet.de>
    (cherry picked from commit 0e6aca40413fb3cfd4300f282204a69743be4a65)

-----------------------------------------------------------------------

Summary of changes:
 python/pyglue.c                        |   45 ++++++++++++++++++++++++++++++-
 python/samba/provision/__init__.py     |    6 ++--
 source3/lib/gencache.c                 |    2 +-
 source4/scripting/bin/samba_upgradedns |    2 +-
 4 files changed, 48 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/pyglue.c b/python/pyglue.c
index c21de46..802153a 100644
--- a/python/pyglue.c
+++ b/python/pyglue.c
@@ -164,18 +164,59 @@ static PyObject *py_interface_ips(PyObject *self, PyObject *args)
 	/* first count how many are not loopback addresses */
 	for (ifcount = i = 0; i<count; i++) {
 		const char *ip = iface_list_n_ip(ifaces, i);
-		if (!(!all_interfaces && iface_list_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
+
+		if (all_interfaces) {
 			ifcount++;
+			continue;
+		}
+
+		if (iface_list_same_net(ip, "127.0.0.1", "255.0.0.0")) {
+			continue;
+		}
+
+		if (iface_list_same_net(ip, "169.254.0.0", "255.255.0.0")) {
+			continue;
 		}
+
+		if (iface_list_same_net(ip, "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")) {
+			continue;
+		}
+
+		if (iface_list_same_net(ip, "fe80::", "ffff:ffff:ffff:ffff::")) {
+			continue;
+		}
+
+		ifcount++;
 	}
 
 	pylist = PyList_New(ifcount);
 	for (ifcount = i = 0; i<count; i++) {
 		const char *ip = iface_list_n_ip(ifaces, i);
-		if (!(!all_interfaces && iface_list_same_net(ip, "127.0.0.1", "255.0.0.0"))) {
+
+		if (all_interfaces) {
 			PyList_SetItem(pylist, ifcount, PyString_FromString(ip));
 			ifcount++;
+			continue;
+		}
+
+		if (iface_list_same_net(ip, "127.0.0.1", "255.0.0.0")) {
+			continue;
+		}
+
+		if (iface_list_same_net(ip, "169.254.0.0", "255.255.0.0")) {
+			continue;
 		}
+
+		if (iface_list_same_net(ip, "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")) {
+			continue;
+		}
+
+		if (iface_list_same_net(ip, "fe80::", "ffff:ffff:ffff:ffff::")) {
+			continue;
+		}
+
+		PyList_SetItem(pylist, ifcount, PyString_FromString(ip));
+		ifcount++;
 	}
 	talloc_free(tmp_ctx);
 	return pylist;
diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py
index f13b7d1..e0b3d22 100644
--- a/python/samba/provision/__init__.py
+++ b/python/samba/provision/__init__.py
@@ -1695,12 +1695,12 @@ def interface_ips_v4(lp):
     return ret
 
 
-def interface_ips_v6(lp, linklocal=False):
+def interface_ips_v6(lp):
     """return only IPv6 IPs"""
     ips = samba.interface_ips(lp, False)
     ret = []
     for i in ips:
-        if i.find(':') != -1 and (linklocal or i.find('%') == -1):
+        if i.find(':') != -1:
             ret.append(i)
     return ret
 
@@ -1997,7 +1997,7 @@ def provision(logger, session_info, credentials, smbconf=None,
 
     if hostip6 is None:
         logger.info("Looking up IPv6 addresses")
-        hostips = interface_ips_v6(lp, linklocal=False)
+        hostips = interface_ips_v6(lp)
         if hostips:
             hostip6 = hostips[0]
         if len(hostips) > 1:
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 95b4811..da779c9 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -63,7 +63,7 @@ static bool gencache_init(void)
 	/* skip file open if it's already opened */
 	if (cache) return True;
 
-	cache_fname = lock_path("gencache.tdb");
+	cache_fname = cache_path("gencache.tdb");
 
 	DEBUG(5, ("Opening cache file at %s\n", cache_fname));
 
diff --git a/source4/scripting/bin/samba_upgradedns b/source4/scripting/bin/samba_upgradedns
index 3c30090..b7af98c 100755
--- a/source4/scripting/bin/samba_upgradedns
+++ b/source4/scripting/bin/samba_upgradedns
@@ -331,7 +331,7 @@ if __name__ == '__main__':
             logger.debug("IPv4 addresses: %s" % hostip)
 
         logger.info("Looking up IPv6 addresses")
-        hostip6 = interface_ips_v6(lp, linklocal=False)
+        hostip6 = interface_ips_v6(lp)
         if not hostip6:
             hostip6 = None
         else:


-- 
Samba Shared Repository


More information about the samba-cvs mailing list