[SCM] Samba Shared Repository - branch v3-6-test updated

Volker Lendecke vlendec at samba.org
Mon Feb 28 03:56:53 MST 2011


The branch, v3-6-test has been updated
       via  a4fb3dd s3: Fix a typo
       via  9f06c02 s3: Fix a comment
       via  aad2248 s3: Fix some nonempty blank lines
       via  d3b7c56 s3: Use strndup in parse_nss_param
       via  d00f35d s3: properly find our standard nss_info backends
      from  3c49c06 s3:net: fix usage for "net rpc registry export"

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


- Log -----------------------------------------------------------------
commit a4fb3ddd5774fb1a5ceb436c945f4465bde46d2f
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 26 14:01:08 2011 +0100

    s3: Fix a typo
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sun Feb 27 20:14:20 CET 2011 on sn-devel-104

commit 9f06c02193e8b7b7cc3b82e80503013a306d0fd6
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 26 13:41:43 2011 +0100

    s3: Fix a comment

commit aad224853d67bd0cd49ba91b6cc5a2525a332d72
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 26 12:36:19 2011 +0100

    s3: Fix some nonempty blank lines

commit d3b7c56fbc4e27696ac7de8226e84a799fc62604
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Feb 26 11:53:21 2011 +0100

    s3: Use strndup in parse_nss_param

commit d00f35def385c522533668da4e343cef5d30beed
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Feb 27 19:09:28 2011 +0100

    s3: properly find our standard nss_info backends
    
    Right now, the nss_info backends are tied to the idmap backends (which is wrong
    IMHO). In the domain child we don't load the idmap backend anymore, so we don't
    have the nss info modules. This needs fixing properly.

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

Summary of changes:
 source3/libads/kerberos.c                |   19 +++++++++----------
 source3/libnet/libnet_join.c             |    4 ++--
 source3/smbd/open.c                      |   19 +++++++++----------
 source3/winbindd/idmap_ad.c              |   18 +++++++++---------
 source3/winbindd/idmap_hash/idmap_hash.c |    4 ++--
 source3/winbindd/idmap_nss.c             |   14 +++++++-------
 source3/winbindd/idmap_tdb.c             |   18 +++++++++---------
 source3/winbindd/nss_info.c              |   28 +++++++++++++++-------------
 source3/winbindd/nss_info_template.c     |   10 +++++-----
 9 files changed, 67 insertions(+), 67 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 31af496..11bfb4d 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -11,12 +11,12 @@
    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/>.
 */
@@ -192,7 +192,7 @@ int kerberos_kinit_password_ext(const char *principal,
 	if ((code = krb5_cc_resolve(ctx, cache_name ? cache_name : krb5_cc_default_name(ctx), &cc))) {
 		goto out;
 	}
-	
+
 	if ((code = smb_krb5_parse_name(ctx, principal, &me))) {
 		goto out;
 	}
@@ -231,7 +231,7 @@ int kerberos_kinit_password_ext(const char *principal,
 	if ((code = krb5_cc_initialize(ctx, cc, me))) {
 		goto out;
 	}
-	
+
 	if ((code = krb5_cc_store_cred(ctx, cc, &my_creds))) {
 		goto out;
 	}
@@ -298,7 +298,7 @@ int ads_kdestroy(const char *cc_name)
 			error_message(code)));
 		return code;
 	}
-  
+
 	if (!cc_name) {
 		if ((code = krb5_cc_default(ctx, &cc))) {
 			krb5_free_context(ctx);
@@ -541,11 +541,11 @@ krb5_principal kerberos_fetch_salt_princ_for_host_princ(krb5_context context,
 {
 	char *unparsed_name = NULL, *salt_princ_s = NULL;
 	krb5_principal ret_princ = NULL;
-	
+
 	/* lookup new key first */
 
 	if ( (salt_princ_s = kerberos_secrets_fetch_des_salt()) == NULL ) {
-	
+
 		/* look under the old key.  If this fails, just use the standard key */
 
 		if (smb_krb5_unparse_name(talloc_tos(), context, host_princ, &unparsed_name) != 0) {
@@ -560,10 +560,10 @@ krb5_principal kerberos_fetch_salt_princ_for_host_princ(krb5_context context,
 	if (smb_krb5_parse_name(context, salt_princ_s, &ret_princ) != 0) {
 		ret_princ = NULL;
 	}
-	
+
 	TALLOC_FREE(unparsed_name);
 	SAFE_FREE(salt_princ_s);
-	
+
 	return ret_princ;
 }
 
@@ -604,7 +604,6 @@ bool kerberos_secrets_store_salting_principal(const char *service,
 
 	if (smb_krb5_parse_name(context, princ_s, &princ) != 0) {
 		goto out;
-		
 	}
 	if (smb_krb5_unparse_name(talloc_tos(), context, princ, &unparsed_name) != 0) {
 		goto out;
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 22278ba..c2487c9 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -2153,7 +2153,7 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
 	/* for net ads leave, try to delete the account.  If it works, 
 	   no sense in disabling.  If it fails, we can still try to 
 	   disable it. jmcd */
-	   
+
 	if (r->in.delete_machine_account) {
 		ADS_STATUS ads_status;
 		ads_status = libnet_unjoin_connect_ads(mem_ctx, r);
@@ -2191,7 +2191,7 @@ static WERROR libnet_DomainUnjoin(TALLOC_CTX *mem_ctx,
 			}
 			return ntstatus_to_werror(status);
 		}
-		
+
 		r->out.disabled_machine_account = true;
 	}
 
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 14d15e7..a562ff3 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -4,17 +4,17 @@
    Copyright (C) Andrew Tridgell 1992-1998
    Copyright (C) Jeremy Allison 2001-2004
    Copyright (C) Volker Lendecke 2005
-   
+
    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/>.
 */
@@ -714,7 +714,7 @@ sa = 0x%x, share = 0x%x\n", (num), (unsigned int)(am), (unsigned int)(right), (u
 		   share_access, FILE_SHARE_WRITE);
 	CHECK_MASK(2, access_mask, FILE_WRITE_DATA | FILE_APPEND_DATA,
 		   entry->share_access, FILE_SHARE_WRITE);
-	
+
 	CHECK_MASK(3, entry->access_mask, FILE_READ_DATA | FILE_EXECUTE,
 		   share_access, FILE_SHARE_READ);
 	CHECK_MASK(4, access_mask, FILE_READ_DATA | FILE_EXECUTE,
@@ -842,7 +842,7 @@ static NTSTATUS open_mode_check(connection_struct *conn,
 	/*
 	 * Check if the share modes will give us access.
 	 */
-	
+
 #if defined(DEVELOPER)
 	for(i = 0; i < lck->num_share_modes; i++) {
 		validate_my_share_entries(conn->sconn, i,
@@ -868,7 +868,7 @@ static NTSTATUS open_mode_check(connection_struct *conn,
 			return NT_STATUS_SHARING_VIOLATION;
 		}
 	}
-	
+
 	return NT_STATUS_OK;
 }
 
@@ -1312,7 +1312,7 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
 		case OPENX_FILE_EXISTS_OPEN|OPENX_FILE_CREATE_IF_NOT_EXIST:
 			create_disposition = FILE_OPEN_IF;
 			break;
-       
+
 		case OPENX_FILE_EXISTS_TRUNCATE:
 			create_disposition = FILE_OVERWRITE;
 			break;
@@ -1331,7 +1331,7 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname,
 				  "open_func 0x%x\n", (unsigned int)open_func));
 			return False;
 	}
- 
+
 	/* Create the NT compatible share modes. */
 	switch (GET_DENY_MODE(deny_mode)) {
 		case DENY_ALL:
@@ -2652,7 +2652,6 @@ static NTSTATUS open_directory(connection_struct *conn,
 				info = FILE_WAS_OPENED;
 				status = NT_STATUS_OK;
 			}
-				
 			break;
 
 		case FILE_SUPERSEDE:
@@ -2712,7 +2711,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 	/*
 	 * Setup the files_struct for it.
 	 */
-	
+
 	fsp->mode = smb_dname->st.st_ex_mode;
 	fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_dname->st);
 	fsp->vuid = req ? req->vuid : UID_FIELD_INVALID;
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 32a3e17..4ca3248 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -192,7 +192,7 @@ static ADS_STATUS ad_idmap_cached_connection(struct idmap_domain *dom)
 			DEBUG(2,("ad_idmap_cached_connection: Failed to obtain schema details!\n"));
 		}
 	}
-	
+
 	return status;
 }
 
@@ -305,7 +305,7 @@ static NTSTATUS idmap_ad_unixids_to_sids(struct idmap_domain *dom, struct id_map
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	/* Only do query if we are online */
 	if (idmap_is_offline())	{
 		return NT_STATUS_FILE_IS_OFFLINE;
@@ -348,7 +348,7 @@ again:
 							  (unsigned long)ids[idx]->xid.id);
 			CHECK_ALLOC_DONE(u_filter);
 			break;
-				
+
 		case ID_TYPE_GID:
 			if ( ! g_filter) {
 				g_filter = talloc_asprintf(memctx, "(&(|"
@@ -557,7 +557,7 @@ again:
 				 ")(|",
 				 ATYPE_NORMAL_ACCOUNT, ATYPE_WORKSTATION_TRUST, ATYPE_INTERDOMAIN_TRUST,
 				 ATYPE_SECURITY_GLOBAL_GROUP, ATYPE_SECURITY_LOCAL_GROUP);
-		
+
 	CHECK_ALLOC_DONE(filter);
 
 	bidx = idx;
@@ -567,7 +567,7 @@ again:
 
 		sidstr = ldap_encode_ndr_dom_sid(talloc_tos(), ids[idx]->sid);
 		filter = talloc_asprintf_append_buffer(filter, "(objectSid=%s)", sidstr);
-			
+
 		TALLOC_FREE(sidstr);
 		CHECK_ALLOC_DONE(filter);
 	}
@@ -672,7 +672,7 @@ again:
 
 	ret = NT_STATUS_OK;
 
-	/* mark all unknwoni/expired ones as unmapped */
+	/* mark all unknown/expired ones as unmapped */
 	for (i = 0; ids[i]; i++) {
 		if (ids[i]->status != ID_MAPPED) 
 			ids[i]->status = ID_UNMAPPED;
@@ -700,7 +700,7 @@ static NTSTATUS idmap_ad_close(struct idmap_domain *dom)
 	}
 
 	TALLOC_FREE( ctx->ad_schema );
-	
+
 	return NT_STATUS_OK;
 }
 
@@ -1113,7 +1113,7 @@ static struct idmap_methods ad_methods = {
 
 /* The SFU and RFC2307 NSS plugins share everything but the init
    function which sets the intended schema model to use */
-  
+
 static struct nss_info_methods nss_rfc2307_methods = {
 	.init           = nss_rfc2307_init,
 	.get_nss_info   = nss_ad_get_info,
@@ -1160,7 +1160,7 @@ NTSTATUS idmap_ad_init(void)
 		if ( !NT_STATUS_IS_OK(status_idmap_ad) )
 			return status_idmap_ad;		
 	}
-	
+
 	if ( !NT_STATUS_IS_OK( status_nss_rfc2307 ) ) {
 		status_nss_rfc2307 = smb_register_idmap_nss(SMB_NSS_INFO_INTERFACE_VERSION,
 							    "rfc2307",  &nss_rfc2307_methods );		
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index c52a90f..da5c4e3 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -168,7 +168,7 @@ static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	nt_status = be_init(dom, NULL);
 	BAIL_ON_NTSTATUS_ERROR(nt_status);
 
@@ -218,7 +218,7 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom,
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	nt_status = be_init(dom, NULL);
 	BAIL_ON_NTSTATUS_ERROR(nt_status);
 
diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c
index ac5dd79..e802288 100644
--- a/source3/winbindd/idmap_nss.c
+++ b/source3/winbindd/idmap_nss.c
@@ -1,20 +1,20 @@
 /* 
    Unix SMB/CIFS implementation.
 
-   idmap PASSDB backend
+   idmap NSS backend
 
    Copyright (C) Simo Sorce 2006
-   
+
    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/>.
 */
@@ -50,7 +50,7 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	ctx = talloc_new(dom);
 	if ( ! ctx) {
 		DEBUG(0, ("Out of memory!\n"));
@@ -63,7 +63,7 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
 		const char *name;
 		enum lsa_SidType type;
 		bool ret;
-		
+
 		switch (ids[i]->xid.type) {
 		case ID_TYPE_UID:
 			pw = getpwuid((uid_t)ids[i]->xid.id);
@@ -141,7 +141,7 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	ctx = talloc_new(dom);
 	if ( ! ctx) {
 		DEBUG(0, ("Out of memory!\n"));
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index 6d2ab8e..aeb4f20 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -8,17 +8,17 @@
    Copyright (C) Jeremy Allison 2006
    Copyright (C) Simo Sorce 2003-2006
    Copyright (C) Michael Adam 2009-2010
-   
+
    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/>.
 */
@@ -342,7 +342,7 @@ done:
 /**********************************************************************
  IDMAP ALLOC TDB BACKEND
 **********************************************************************/
- 
+
 /**********************************
  Allocate a new id. 
 **********************************/
@@ -684,7 +684,7 @@ static NTSTATUS idmap_tdb_id_to_sid(struct idmap_domain *dom, struct id_map *map
 	case ID_TYPE_UID:
 		keystr = talloc_asprintf(ctx, "UID %lu", (unsigned long)map->xid.id);
 		break;
-		
+
 	case ID_TYPE_GID:
 		keystr = talloc_asprintf(ctx, "GID %lu", (unsigned long)map->xid.id);
 		break;
@@ -713,7 +713,7 @@ static NTSTATUS idmap_tdb_id_to_sid(struct idmap_domain *dom, struct id_map *map
 		ret = NT_STATUS_NONE_MAPPED;
 		goto done;
 	}
-		
+
 	if (!string_to_sid(map->sid, (const char *)data.dptr)) {
 		DEBUG(10,("INVALID SID (%s) in record %s\n",
 			(const char *)data.dptr, keystr));
@@ -807,7 +807,7 @@ static NTSTATUS idmap_tdb_unixids_to_sids(struct idmap_domain *dom, struct id_ma
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
 
 	for (i = 0; ids[i]; i++) {
@@ -821,7 +821,7 @@ static NTSTATUS idmap_tdb_unixids_to_sids(struct idmap_domain *dom, struct id_ma
 				ids[i]->status = ID_UNMAPPED;
 				continue;
 			}
-			
+
 			/* some fatal error occurred, return immediately */
 			goto done;
 		}
@@ -912,7 +912,7 @@ static NTSTATUS idmap_tdb_sids_to_unixids(struct idmap_domain *dom, struct id_ma
 	for (i = 0; ids[i]; i++) {
 		ids[i]->status = ID_UNKNOWN;
 	}
-	
+
 	ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
 
 	state.dom = dom;
diff --git a/source3/winbindd/nss_info.c b/source3/winbindd/nss_info.c
index 67ffbf2..b8e32b9 100644
--- a/source3/winbindd/nss_info.c
+++ b/source3/winbindd/nss_info.c
@@ -88,8 +88,6 @@ static struct nss_function_entry *nss_get_backend(const char *name )
 static bool parse_nss_parm( const char *config, char **backend, char **domain )
 {
 	char *p;
-	char *q;
-	int len;
 
 	*backend = *domain = NULL;
 
@@ -111,17 +109,8 @@ static bool parse_nss_parm( const char *config, char **backend, char **domain )
 		*domain = SMB_STRDUP( p+1 );
 	}
 
-	len = PTR_DIFF(p,config)+1;
-	if ( (q = SMB_MALLOC_ARRAY( char, len )) == NULL ) {
-		SAFE_FREE( *backend );
-		return False;
-	}
-
-	StrnCpy( q, config, len-1);
-	q[len-1] = '\0';
-	*backend = q;
-
-	return True;
+	*backend = SMB_STRNDUP(config, PTR_DIFF(p, config));
+	return (*backend != NULL);
 }
 
 static NTSTATUS nss_domain_list_add_domain(const char *domain,
@@ -205,6 +194,19 @@ static NTSTATUS nss_init(const char **nss_list)
 
 		nss_backend = nss_get_backend(backend);
 		if (nss_backend == NULL) {
+			/*
+			 * This is a freaking hack. We don't have proper
+			 * modules for nss_info backends. Right now we have
+			 * our standard nss_info backends in the ad backend.
+			 */
+			status = smb_probe_module("idmap", "ad");
+			if ( !NT_STATUS_IS_OK(status) ) {
+				continue;
+			}
+		}
+
+		nss_backend = nss_get_backend(backend);
+		if (nss_backend == NULL) {
 			/* attempt to register the backend */
 			status = smb_probe_module( "nss_info", backend );
 			if ( !NT_STATUS_IS_OK(status) ) {
diff --git a/source3/winbindd/nss_info_template.c b/source3/winbindd/nss_info_template.c
index 0bc398e..7eb7510 100644
--- a/source3/winbindd/nss_info_template.c
+++ b/source3/winbindd/nss_info_template.c
@@ -8,12 +8,12 @@
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 3 of the License, or (at your option) any later version.
-   
+
    This library 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
    Library General Public License for more details.
-   


-- 
Samba Shared Repository


More information about the samba-cvs mailing list