[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Thu Dec 18 01:10:03 MST 2014


The branch, master has been updated
       via  5fefdbc libcli-dns: Remove obsolete dns_host_file subsystem.
       via  48929ca s3-libsmb: Remove obsolete support for dns_host_file.
       via  f45c633 s4-libcli: Remove obsolete support for file resolving.
       via  7f00fcf addns: Remove support for dns_host_file.
       via  3ab2aa2 selftest: Use resolv_wrapper in the samba3 targets to join AD.
       via  2e4c151 selftest: Use resolv_wrapper in the samba4 target.
       via  4f6acb7 selftest: Always enable dns fakeing.
       via  30cc2e7 selftest: Define if we should fake dns resolving.
       via  1292d51 samba_dnsupdate: Allow the tool to work in 'make test'.
       via  e85ef1d samba_dnsupdate: Always fill out the nameservers of a dns object.
       via  35495da selftest: Wait for the logon server to register to join the member.
       via  cfb67cf nmblookup: Return if the lookup was successful or not.
       via  5179a0b selftest: Print better DC provisioning info.
       via  80b58ca selftest: Also pass the IPv6 address for the KDC around.
       via  843d81a selftest: Preload resolv_wrapper in selftest.
       via  064d40f s3:winbindd: try to use the trust account with kerberos if possible
       via  b9e4a8b s3:winbindd: fix anon fallback in cm_prepare_connection()
       via  b0e9779 s3:winbindd: also try to fallback to anonymous if we get NT_STATUS_INVALID_ACCOUNT_NAME
       via  c5b54ea s3:libsmb: let cli_session_setup_kerberos_recv() return a useful error code
      from  12aaafd s3:passdb: let pdb_get_trust_credentials() try pdb_get_trusteddom_creds() first

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


- Log -----------------------------------------------------------------
commit 5fefdbc8b3f9bf10f26590a0bd28badff138c698
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 20 11:37:35 2014 +0100

    libcli-dns: Remove obsolete dns_host_file subsystem.
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Dec 18 09:09:38 CET 2014 on sn-devel-104

commit 48929ca9eb87ddafe2548cb1cbf06de0f2c4b323
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 20 11:37:13 2014 +0100

    s3-libsmb: Remove obsolete support for dns_host_file.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit f45c63381469ab33a429a83035e860b2d87638ed
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 20 11:35:48 2014 +0100

    s4-libcli: Remove obsolete support for file resolving.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 7f00fcf5589fc0e27ddd1f78fbe9c223b26cd919
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 20 11:31:29 2014 +0100

    addns: Remove support for dns_host_file.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3ab2aa2511769ec2b32b1e80093b28a532693ae6
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Sep 4 14:33:05 2014 +0200

    selftest: Use resolv_wrapper in the samba3 targets to join AD.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2e4c15110b8c3f079f32645660dfbb20e32877e5
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 10 11:00:28 2014 +0200

    selftest: Use resolv_wrapper in the samba4 target.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4f6acb77ea23df8a5c19ad0156d5e3d70cbca44c
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Nov 20 10:48:47 2014 +0100

    selftest: Always enable dns fakeing.
    
    FIXME: This should be removed once we fixed adding records to the DNS
    server using nsupdate!
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 30cc2e7755074758a16fcf2a8d818321ee0b4021
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Nov 3 13:22:38 2014 +0100

    selftest: Define if we should fake dns resolving.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1292d513c1274a714c22da0781428859249cee26
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Sep 11 10:59:20 2014 +0200

    samba_dnsupdate: Allow the tool to work in 'make test'.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit e85ef1dbfef4b16c35cac80c0efc563d8cd1ba3e
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Oct 7 15:35:34 2014 +0200

    samba_dnsupdate: Always fill out the nameservers of a dns object.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 35495da4b840d3893124657c81427bfc2f78f9e2
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Sep 9 09:47:05 2014 +0200

    selftest: Wait for the logon server to register to join the member.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit cfb67cf623e541dd0b56241a30340419b9e5a393
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Sep 9 09:45:51 2014 +0200

    nmblookup: Return if the lookup was successful or not.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10803
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Pair-Programmed-With: Jeremy Allison <jra at samba.org>

commit 5179a0b61fa4fcf1538f86c4a6e0e2a34703e232
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 10 12:23:38 2014 +0200

    selftest: Print better DC provisioning info.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 80b58ca03e25bdfd41d93c2509030f2b41d71a52
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 10 10:59:39 2014 +0200

    selftest: Also pass the IPv6 address for the KDC around.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 843d81a14f79803360e8658d224e568435daded6
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 3 17:16:36 2014 +0200

    selftest: Preload resolv_wrapper in selftest.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 064d40f4d30d711797b76082afbb936dcfd9c659
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Dec 16 09:05:39 2014 +0000

    s3:winbindd: try to use the trust account with kerberos if possible
    
    This trust account is usable for SMB authentication via kerberos,
    so we should try that if we think the domain is active directory.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11010
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b9e4a8b869db20eb296950750ceb110eec3e3cd8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Dec 16 11:28:41 2014 +0000

    s3:winbindd: fix anon fallback in cm_prepare_connection()
    
    We should not crash with machine_password==NULL.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11010
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b0e97793aba2847726455df8f4d694d2564442f7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Dec 18 01:20:29 2014 +0000

    s3:winbindd: also try to fallback to anonymous if we get NT_STATUS_INVALID_ACCOUNT_NAME
    
    Kerberos authentication may return NT_STATUS_INVALID_ACCOUNT_NAME (PRINCIPAL_UNKNOWN)
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11010
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c5b54ea1adb14b04e10cd4fa509345fe78942a75
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Dec 16 09:45:15 2014 +0000

    s3:libsmb: let cli_session_setup_kerberos_recv() return a useful error code
    
    Forcing NT_STATUS_UNSUCCESSFUL is not a good idea, we should return
    NT_STATUS_LOGON_FAILURE instead.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11010
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 lib/addns/dnsquery.c                  |  96 ++++----
 lib/addns/dnsquery.h                  |   7 -
 lib/addns/wscript_build               |   2 +-
 libcli/dns/dns.h                      |  12 -
 libcli/dns/dns_hosts_file.c           | 434 ----------------------------------
 libcli/dns/wscript_build              |   4 -
 libcli/nbt/libnbt.h                   |   6 -
 selftest/selftest.pl                  |  42 +++-
 selftest/target/Samba3.pm             |  88 ++++++-
 selftest/target/Samba4.pm             | 159 ++++++++++---
 selftest/wscript                      |   8 +
 source3/libads/ldap.c                 |  10 +-
 source3/libsmb/cliconnect.c           |  28 ++-
 source3/libsmb/dsgetdcname.c          |  48 ++--
 source3/libsmb/namequery.c            |  48 +---
 source3/utils/net_ads.c               |  14 +-
 source3/utils/net_lookup.c            |  16 +-
 source3/utils/nmblookup.c             |  25 +-
 source3/winbindd/winbindd_cm.c        |  46 ++--
 source4/libcli/resolve/dns_ex.c       |   2 +-
 source4/libcli/resolve/file.c         | 160 -------------
 source4/libcli/resolve/resolve_lp.c   |   2 -
 source4/libcli/wscript_build          |   2 +-
 source4/scripting/bin/samba_dnsupdate |  17 +-
 24 files changed, 446 insertions(+), 830 deletions(-)
 delete mode 100644 libcli/dns/dns_hosts_file.c
 delete mode 100644 source4/libcli/resolve/file.c


Changeset truncated at 500 lines:

diff --git a/lib/addns/dnsquery.c b/lib/addns/dnsquery.c
index 57ef8d9..4e2aaf4 100644
--- a/lib/addns/dnsquery.c
+++ b/lib/addns/dnsquery.c
@@ -390,7 +390,6 @@ static NTSTATUS dns_send_req( TALLOC_CTX *ctx, const char *name, int q_type,
 *********************************************************************/
 
 NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
-				const char *dns_hosts_file,
 				const char *name,
 				struct dns_rr_srv **dclist,
 				int *numdcs)
@@ -408,12 +407,6 @@ NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (dns_hosts_file) {
-		return resolve_dns_hosts_file_as_dns_rr(dns_hosts_file,
-							name, true, ctx,
-							dclist, numdcs);
-	}
-
 	/* Send the request.  May have to loop several times in case
 	   of large replies */
 
@@ -586,7 +579,6 @@ NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
 *********************************************************************/
 
 NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
-				const char *dns_hosts_file,
 				const char *dnsdomain,
 				struct dns_rr_ns **nslist,
 				int *numns)
@@ -604,11 +596,6 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (dns_hosts_file) {
-		DEBUG(1, ("NO 'NS' lookup available when using resolv:host file"));
-		return NT_STATUS_OBJECT_NAME_NOT_FOUND;
-	}
-
 	/* Send the request.  May have to loop several times in case
 	   of large replies */
 
@@ -747,7 +734,6 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
 ********************************************************************/
 
 static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
-				       const char *dns_hosts_file,
 				       const char *servicename,
 				       const char *dc_pdc_gc_domains,
 				       const char *realm,
@@ -767,7 +753,7 @@ static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
 	if (!name) {
 		return NT_STATUS_NO_MEMORY;
 	}
-	return ads_dns_lookup_srv(ctx, dns_hosts_file, name, dclist, numdcs);
+	return ads_dns_lookup_srv(ctx, name, dclist, numdcs);
 }
 
 /********************************************************************
@@ -775,7 +761,6 @@ static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx,
 ********************************************************************/
 
 NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
-			   const char *dns_hosts_file,
 			   const char *realm,
 			   const char *sitename,
 			   struct dns_rr_srv **dclist,
@@ -783,8 +768,13 @@ NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
 {
 	NTSTATUS status;
 
-	status = ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "dc",
-					realm, sitename, dclist, numdcs);
+	status = ads_dns_query_internal(ctx,
+					"_ldap",
+					"dc",
+					realm,
+					sitename,
+					dclist,
+					numdcs);
 
 	if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
 	    NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
@@ -795,9 +785,13 @@ NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
 	    ((!NT_STATUS_IS_OK(status)) ||
 	     (NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
 		/* Sitename DNS query may have failed. Try without. */
-		status = ads_dns_query_internal(ctx, dns_hosts_file,
-						"_ldap", "dc", realm,
-						NULL, dclist, numdcs);
+		status = ads_dns_query_internal(ctx,
+						"_ldap",
+						"dc",
+						realm,
+						NULL,
+						dclist,
+						numdcs);
 	}
 	return status;
 }
@@ -807,7 +801,6 @@ NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
 ********************************************************************/
 
 NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
-			   const char *dns_hosts_file,
 			   const char *realm,
 			   const char *sitename,
 			   struct dns_rr_srv **dclist,
@@ -815,8 +808,13 @@ NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
 {
 	NTSTATUS status;
 
-	status = ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "gc",
-					realm, sitename, dclist, numdcs);
+	status = ads_dns_query_internal(ctx,
+					"_ldap",
+					"gc",
+					realm,
+					sitename,
+					dclist,
+					numdcs);
 
 	if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
 	    NT_STATUS_EQUAL(status, NT_STATUS_CONNECTION_REFUSED)) {
@@ -827,9 +825,13 @@ NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
 	    ((!NT_STATUS_IS_OK(status)) ||
 	     (NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
 		/* Sitename DNS query may have failed. Try without. */
-		status = ads_dns_query_internal(ctx, dns_hosts_file,
-						"_ldap", "gc", realm,
-						NULL, dclist, numdcs);
+		status = ads_dns_query_internal(ctx,
+						"_ldap",
+						"gc",
+						realm,
+						NULL,
+						dclist,
+						numdcs);
 	}
 	return status;
 }
@@ -841,7 +843,6 @@ NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
 ********************************************************************/
 
 NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
-			    const char *dns_hosts_file,
 			    const char *dns_forest_name,
 			    const char *sitename,
 			    struct dns_rr_srv **dclist,
@@ -849,8 +850,12 @@ NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
 {
 	NTSTATUS status;
 
-	status = ads_dns_query_internal(ctx, dns_hosts_file, "_kerberos", "dc",
-					dns_forest_name, sitename, dclist,
+	status = ads_dns_query_internal(ctx,
+					"_kerberos",
+					"dc",
+					dns_forest_name,
+					sitename,
+					dclist,
 					numdcs);
 
 	if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT) ||
@@ -862,10 +867,13 @@ NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
 	    ((!NT_STATUS_IS_OK(status)) ||
 	     (NT_STATUS_IS_OK(status) && (numdcs == 0)))) {
 		/* Sitename DNS query may have failed. Try without. */
-		status = ads_dns_query_internal(ctx, dns_hosts_file,
-						"_kerberos", "dc",
-						dns_forest_name, NULL,
-						dclist, numdcs);
+		status = ads_dns_query_internal(ctx,
+						"_kerberos",
+						"dc",
+						dns_forest_name,
+						NULL,
+						dclist,
+						numdcs);
 	}
 	return status;
 }
@@ -875,13 +883,17 @@ NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
 ********************************************************************/
 
 NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
-			   const char *dns_hosts_file,
 			   const char *dns_domain_name,
 			   struct dns_rr_srv **dclist,
 			   int *numdcs )
 {
-	return ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", "pdc",
-				      dns_domain_name, NULL, dclist, numdcs);
+	return ads_dns_query_internal(ctx,
+				      "_ldap",
+				      "pdc",
+				      dns_domain_name,
+				      NULL,
+				      dclist,
+				      numdcs);
 }
 
 /********************************************************************
@@ -889,7 +901,6 @@ NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
 ********************************************************************/
 
 NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
-				const char *dns_hosts_file,
 				const char *dns_forest_name,
 				const char *domain_guid,
 				struct dns_rr_srv **dclist,
@@ -905,6 +916,11 @@ NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	return ads_dns_query_internal(ctx, dns_hosts_file, "_ldap", domains,
-				      dns_forest_name, NULL, dclist, numdcs);
+	return ads_dns_query_internal(ctx,
+				      "_ldap",
+				      domains,
+				      dns_forest_name,
+				      NULL,
+				      dclist,
+				      numdcs);
 }
diff --git a/lib/addns/dnsquery.h b/lib/addns/dnsquery.h
index 1491b69..213ed32 100644
--- a/lib/addns/dnsquery.h
+++ b/lib/addns/dnsquery.h
@@ -25,40 +25,33 @@
 /* The following definitions come from libads/dns.c  */
 
 NTSTATUS ads_dns_lookup_srv(TALLOC_CTX *ctx,
-				const char *dns_hosts_file,
 				const char *name,
 				struct dns_rr_srv **dclist,
 				int *numdcs);
 NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
-				const char *dns_hosts_file,
 				const char *dnsdomain,
 				struct dns_rr_ns **nslist,
 				int *numns);
 NTSTATUS ads_dns_query_dcs(TALLOC_CTX *ctx,
-			   const char *dns_hosts_file,
 			   const char *realm,
 			   const char *sitename,
 			   struct dns_rr_srv **dclist,
 			   int *numdcs );
 NTSTATUS ads_dns_query_gcs(TALLOC_CTX *ctx,
-			   const char *dns_hosts_file,
 			   const char *realm,
 			   const char *sitename,
 			   struct dns_rr_srv **dclist,
 			   int *numdcs );
 NTSTATUS ads_dns_query_kdcs(TALLOC_CTX *ctx,
-			    const char *dns_hosts_file,
 			    const char *dns_forest_name,
 			    const char *sitename,
 			    struct dns_rr_srv **dclist,
 			    int *numdcs );
 NTSTATUS ads_dns_query_pdc(TALLOC_CTX *ctx,
-			   const char *dns_hosts_file,
 			   const char *dns_domain_name,
 			   struct dns_rr_srv **dclist,
 			   int *numdcs );
 NTSTATUS ads_dns_query_dcs_guid(TALLOC_CTX *ctx,
-				const char *dns_hosts_file,
 				const char *dns_forest_name,
 				const char *domain_guid,
 				struct dns_rr_srv **dclist,
diff --git a/lib/addns/wscript_build b/lib/addns/wscript_build
index 5fac61c..b1948ba 100755
--- a/lib/addns/wscript_build
+++ b/lib/addns/wscript_build
@@ -2,6 +2,6 @@
 
 bld.SAMBA_LIBRARY('addns',
                    source='dnsquery.c dnsrecord.c dnsutils.c dnssock.c dnsgss.c dnsmarshall.c error.c',
-                   public_deps='dnshostsfile samba-util gssapi ndr resolv',
+                   public_deps='samba-util gssapi ndr resolv',
                    private_library=True,
                    vars=locals())
diff --git a/libcli/dns/dns.h b/libcli/dns/dns.h
index 01aa6c4..01994ca 100644
--- a/libcli/dns/dns.h
+++ b/libcli/dns/dns.h
@@ -54,15 +54,3 @@ struct dns_rr_ns {
 	const char *hostname;
 	struct sockaddr_storage ss;
 };
-
-NTSTATUS resolve_dns_hosts_file_as_sockaddr(const char *dns_hosts_file,
-					    const char *name, bool srv_lookup,
-					    TALLOC_CTX *mem_ctx,
-					    struct sockaddr_storage **return_iplist,
-					    int *return_count);
-
-NTSTATUS resolve_dns_hosts_file_as_dns_rr(const char *dns_hosts_file,
-					  const char *name, bool srv_lookup,
-					  TALLOC_CTX *mem_ctx,
-					  struct dns_rr_srv **return_rr,
-					  int *return_count);
diff --git a/libcli/dns/dns_hosts_file.c b/libcli/dns/dns_hosts_file.c
deleted file mode 100644
index 3730477..0000000
--- a/libcli/dns/dns_hosts_file.c
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-
-   read a file containing DNS names, types and IP addresses
-
-   Copyright (C) Andrew Tridgell 1994-1998
-   Copyright (C) Jeremy Allison 2007
-   Copyright (C) Andrew Bartlett 2009-2011
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/* The purpose of this file is to read the file generated by the samba_dnsupdate script */
-
-#include "includes.h"
-#include "lib/util/xfile.h"
-#include "lib/util/util_net.h"
-#include "system/filesys.h"
-#include "system/network.h"
-#include "libcli/nbt/libnbt.h"
-#include "libcli/dns/dns.h"
-
-#ifdef strcasecmp
-#undef strcasecmp
-#endif
-
-/********************************************************
- Start parsing the dns_hosts_file file.
-*********************************************************/
-
-static XFILE *startdns_hosts_file(const char *fname)
-{
-	XFILE *fp = x_fopen(fname,O_RDONLY, 0);
-	if (!fp) {
-		DEBUG(4,("startdns_hosts_file: Can't open dns_hosts_file file %s. "
-			"Error was %s\n",
-			fname, strerror(errno)));
-		return NULL;
-	}
-	return fp;
-}
-
-/********************************************************
- Parse the next line in the dns_hosts_file file.
-*********************************************************/
-
-static bool getdns_hosts_fileent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, char **pp_name_type,
-			  char **pp_next_name,
-			  struct sockaddr_storage *pss, uint32_t *p_port)
-{
-	char line[1024];
-
-	*pp_name = NULL;
-	*pp_name_type = NULL;
-	*pp_next_name = NULL;
-	*p_port = 0;
-
-	while(!x_feof(fp) && !x_ferror(fp)) {
-		char *name_type = NULL;
-		char *name = NULL;
-		char *next_name = NULL;
-		char *ip = NULL;
-		char *port = NULL;
-
-		const char *ptr;
-		int count = 0;
-
-		if (!fgets_slash(line,sizeof(line),fp)) {
-			continue;
-		}
-
-		if (*line == '#') {
-			continue;
-		}
-
-		ptr = line;
-
-		if (next_token_talloc(ctx, &ptr, &name_type, NULL))
-			++count;
-		if (count == 0) {
-			continue;
-		}
-		if (next_token_talloc(ctx, &ptr, &name, NULL))
-			++count;
-		if ((strcasecmp(name_type, "A") == 0) ||
-		    (strcasecmp(name_type, "AAAA") == 0))
-		{
-			if (next_token_talloc(ctx, &ptr, &ip, NULL))
-				++count;
-		} else if (name_type && strcasecmp(name_type, "SRV") == 0) {
-			if (next_token_talloc(ctx, &ptr, &next_name, NULL))
-				++count;
-			if (next_token_talloc(ctx, &ptr, &port, NULL))
-				++count;
-		} else if (name_type && strcasecmp(name_type, "CNAME") == 0) {
-			if (next_token_talloc(ctx, &ptr, &next_name, NULL))
-				++count;
-		} else if (name_type && strcasecmp(name_type, "NS") == 0) {
-			if (next_token_talloc(ctx, &ptr, &next_name, NULL))
-				++count;
-		}
-
-		if ((strcasecmp(name_type, "A") == 0) ||
-		    (strcasecmp(name_type, "AAAA") == 0))
-		{
-			if (count != 3) {
-				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts A[AAA] record [%s]\n",
-					 line));
-				continue;
-			}
-			DEBUG(4, ("getdns_hosts_fileent: host entry: %s %s %s\n",
-				  name_type, name, ip));
-			if (!interpret_string_addr(pss, ip, AI_NUMERICHOST)) {
-				DEBUG(0,("getdns_hosts_fileent: invalid address "
-					 "%s.\n", ip));
-			}
-
-		} else if (strcasecmp(name_type, "SRV") == 0) {
-			if (count != 4) {
-				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts SRV record [%s]\n",
-					 line));
-				continue;
-			}
-			*p_port = strtoul(port, NULL, 10);
-			if (*p_port == UINT32_MAX) {
-				DEBUG(0, ("getdns_hosts_fileent: Ill formed hosts SRV record [%s] (invalid port: %s)\n",
-					  line, port));
-				continue;
-			}
-			DEBUG(4, ("getdns_hosts_fileent: host entry: %s %s %s %u\n",
-				  name_type, name, next_name, (unsigned int)*p_port));
-			*pp_next_name = talloc_strdup(ctx, next_name);
-			if (!*pp_next_name) {
-				return false;
-			}
-		} else if (strcasecmp(name_type, "CNAME") == 0) {
-			if (count != 3) {
-				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts CNAME record [%s]\n",
-					 line));
-				continue;
-			}
-			DEBUG(4, ("getdns_hosts_fileent: host entry: %s %s %s\n",
-				  name_type, name, next_name));
-			*pp_next_name = talloc_strdup(ctx, next_name);
-			if (!*pp_next_name) {
-				return false;
-			}
-		} else if (strcasecmp(name_type, "NS") == 0) {
-			if (count != 3) {
-				DEBUG(0,("getdns_hosts_fileent: Ill formed hosts NS record [%s]\n",
-					 line));
-				continue;
-			}
-			DEBUG(4, ("getdns_hosts_fileent: NS entry: %s %s %s\n",
-				  name_type, name, next_name));
-			continue;
-		} else {
-			DEBUG(0,("getdns_hosts_fileent: unknown type %s\n", name_type));
-			continue;
-		}
-
-		*pp_name = talloc_strdup(ctx, name);
-		if (!*pp_name) {
-			return false;
-		}
-
-		*pp_name_type = talloc_strdup(ctx, name_type);
-		if (!*pp_name_type) {
-			return false;
-		}
-		return true;
-	}
-
-	return false;
-}
-
-/********************************************************
- Finish parsing the dns_hosts_file file.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list