[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Sep 5 20:49:02 MDT 2012


The branch, master has been updated
       via  0d99175 join.py: Only replicate DNS zones if the source DC had DNS zones
       via  f453117 s3-printing: Restrict printing=cups to systems with cups development headers at build time
      from  e00ac55 Free protect_ids in secret_store_domain_sid() as the caller of fetch_secrets() must free the result in order to not leak memory. Signed-off-by: Jeremy Allison <jra at samba.org>

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0d99175f2afb4badd61ba903f3752a0207b049a3
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Sep 6 10:37:18 2012 +1000

    join.py: Only replicate DNS zones if the source DC had DNS zones
    
    This avoid folks needing to specify --dns-backend=NONE
    
    Andrew Bartlett
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Sep  6 04:48:55 CEST 2012 on sn-devel-104

commit f453117569e04087ae461677717b14cdd65a4cd4
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Sep 5 15:03:31 2012 +1000

    s3-printing: Restrict printing=cups to systems with cups development headers at build time
    
    This means that instead of failing due to the default commandline values not being quite correct
    that we clearly fail at loadparm and testparm time when parsing the printing= line.
    
    Andrew Bartlett

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

Summary of changes:
 docs-xml/smbdotconf/printing/printing.xml |    6 +++++-
 lib/param/param_table.c                   |    4 ++++
 source3/param/loadparm.c                  |   14 --------------
 source3/utils/testparm.c                  |    2 --
 source4/scripting/python/samba/join.py    |   25 ++++++++++++++++++-------
 5 files changed, 27 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/printing/printing.xml b/docs-xml/smbdotconf/printing/printing.xml
index c365594..eb5925f 100644
--- a/docs-xml/smbdotconf/printing/printing.xml
+++ b/docs-xml/smbdotconf/printing/printing.xml
@@ -18,7 +18,11 @@
     <constant>LPRNG</constant>, <constant>PLP</constant>,
     <constant>SYSV</constant>, <constant>HPUX</constant>,
     <constant>QNX</constant>, <constant>SOFTQ</constant>,
-    and <constant>CUPS</constant>.</para>
+    <constant>CUPS</constant> and <constant>IPRINT</constant>.</para>
+
+    <para>Be aware that CUPS and IPRINT are only available if the CUPS
+    development library was available at the time Samba was compiled
+    or packaged.</para>
 
     <para>To see what the defaults are for the other print 
     commands when using the various options use the <citerefentry><refentrytitle>testparm</refentrytitle>
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 4126d89..2aa392a 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -186,8 +186,12 @@ static const struct enum_list enum_printing[] = {
 	{PRINT_QNX, "qnx"},
 	{PRINT_PLP, "plp"},
 	{PRINT_LPRNG, "lprng"},
+#ifdef HAVE_CUPS
 	{PRINT_CUPS, "cups"},
+#endif
+#ifdef HAVE_IPRINT
 	{PRINT_IPRINT, "iprint"},
+#endif
 	{PRINT_LPRNT, "nt"},
 	{PRINT_LPROS2, "os2"},
 #if defined(DEVELOPER) || defined(ENABLE_SELFTEST)
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 1e41825..2c77691 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -408,7 +408,6 @@ static void init_printer_values(struct loadparm_service *pService)
 
 		case PRINT_CUPS:
 		case PRINT_IPRINT:
-#ifdef HAVE_CUPS
 			/* set the lpq command to contain the destination printer
 			   name only.  This is used by cups_queue_get() */
 			string_set(&pService->szLpqcommand, "%p");
@@ -418,15 +417,6 @@ static void init_printer_values(struct loadparm_service *pService)
 			string_set(&pService->szLpresumecommand, "");
 			string_set(&pService->szQueuepausecommand, "");
 			string_set(&pService->szQueueresumecommand, "");
-#else
-			string_set(&pService->szLpqcommand, "lpq -P'%p'");
-			string_set(&pService->szLprmcommand, "lprm -P'%p' %j");
-			string_set(&pService->szPrintcommand, "lpr -P'%p' %s; rm %s");
-			string_set(&pService->szLppausecommand, "lp -i '%p-%j' -H hold");
-			string_set(&pService->szLpresumecommand, "lp -i '%p-%j' -H resume");
-			string_set(&pService->szQueuepausecommand, "disable '%p'");
-			string_set(&pService->szQueueresumecommand, "enable '%p'");
-#endif /* HAVE_CUPS */
 			break;
 
 		case PRINT_SYSV:
@@ -5284,11 +5274,7 @@ const char *lp_printcapname(void)
 		return Globals.szPrintcapname;
 
 	if (sDefault.iPrinting == PRINT_CUPS) {
-#ifdef HAVE_CUPS
 		return "cups";
-#else
-		return "lpstat";
-#endif
 	}
 
 	if (sDefault.iPrinting == PRINT_BSD)
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 105f1c5..a9793ab 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -333,13 +333,11 @@ static void do_per_share_checks(int s)
 			"%s. Map system can only work if force create mode "
 			"excludes octal 010 (S_IXGRP).\n", lp_servicename(talloc_tos(), s));
 	}
-#ifdef HAVE_CUPS
 	if (lp_printing(s) == PRINT_CUPS && *(lp_printcommand(talloc_tos(), s)) != '\0') {
 		 fprintf(stderr,"Warning: Service %s defines a print command, but \
 rameter is ignored when using CUPS libraries.\n",
 			   lp_servicename(talloc_tos(), s) );
 	}
-#endif
 }
 
  int main(int argc, const char *argv[])
diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py
index 41d97cb..ac822fb 100644
--- a/source4/scripting/python/samba/join.py
+++ b/source4/scripting/python/samba/join.py
@@ -56,10 +56,6 @@ class dc_join(object):
         ctx.netbios_name = netbios_name
         ctx.targetdir = targetdir
         ctx.use_ntvfs = use_ntvfs
-        if dns_backend is None:
-            ctx.dns_backend = "NONE"
-        else:
-            ctx.dns_backend = dns_backend
 
         ctx.promote_existing = promote_existing
         ctx.promote_from_dn = None
@@ -118,6 +114,21 @@ class dc_join(object):
 
         ctx.dnsdomain = ctx.samdb.domain_dns_name()
         ctx.dnsforest = ctx.samdb.forest_dns_name()
+        ctx.domaindns_zone = 'DC=DomainDnsZones,%s' % ctx.base_dn
+
+        res_domaindns = ctx.samdb.search(scope=ldb.SCOPE_ONELEVEL,
+                                         attrs=[],
+                                         base=ctx.samdb.get_partitions_dn(),
+                                         expression="(&(objectClass=crossRef)(ncName=%s))" % ctx.domaindns_zone)
+        if dns_backend is None:
+            ctx.dns_backend = "NONE"
+        else:
+            if len(res_domaindns) == 0:
+                ctx.dns_backend = "NONE"
+                print "NO DNS zone information found in source domain, not replicating DNS"
+            else:
+                ctx.dns_backend = dns_backend
+
         ctx.dnshostname = "%s.%s" % (ctx.myname, ctx.dnsdomain)
 
         ctx.realm = ctx.dnsdomain
@@ -735,8 +746,8 @@ class dc_join(object):
                                destination_dsa_guid, rodc=ctx.RODC,
                                replica_flags=ctx.domain_replica_flags)
 
-            if 'DC=DomainDnsZones,%s' % ctx.base_dn in ctx.nc_list:
-                repl.replicate('DC=DomainDnsZones,%s' % ctx.base_dn, source_dsa_invocation_id,
+            if ctx.domaindns_zone in ctx.nc_list:
+                repl.replicate(ctx.domaindns_zone, source_dsa_invocation_id,
                                destination_dsa_guid, rodc=ctx.RODC,
                                replica_flags=ctx.replica_flags)
 
@@ -966,7 +977,7 @@ class dc_join(object):
         if not ctx.subdomain:
             ctx.nc_list += [ctx.base_dn]
             if ctx.dns_backend != "NONE":
-                ctx.nc_list += ['DC=DomainDnsZones,%s' % ctx.base_dn]
+                ctx.nc_list += [ctx.domaindns_zone]
 
         if ctx.dns_backend != "NONE":
             ctx.full_nc_list += ['DC=DomainDnsZones,%s' % ctx.base_dn]


-- 
Samba Shared Repository


More information about the samba-cvs mailing list