[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue Feb 9 08:23:04 MST 2010


The branch, master has been updated
       via  e0472c5... s3:selftest: make selftest requires bash for now
       via  4dc2be2... s3:passdb: only use gid_to_sid() result if the result is a group of our local sam
      from  fb0c032... s3: fix some wrong newlines in de translation strings

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


- Log -----------------------------------------------------------------
commit e0472c59c8f9e0fe5aafd539ca901468cd599a30
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 9 12:58:29 2010 +0100

    s3:selftest: make selftest requires bash for now
    
    So force bash until we removed the dependency to bash.
    
    metze

commit 4dc2be2264926fe415e4e40e212f94793c9831d1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 9 12:57:01 2010 +0100

    s3:passdb: only use gid_to_sid() result if the result is a group of our local sam
    
    Otherwise retry with pdb_gid_to_sid().
    
    metze

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

Summary of changes:
 source3/passdb/pdb_get_set.c |   20 ++++++++++++++++----
 source3/selftest/tests.sh    |    2 +-
 2 files changed, 17 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index a5f7a02..8001bbb 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -184,6 +184,7 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
 {
 	DOM_SID *gsid;
 	struct passwd *pwd;
+	bool need_lookup_sid = false;
 
 	/* Return the cached group SID if we have that */
 	if ( sampass->group_sid ) {
@@ -214,10 +215,6 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
 
 	gid_to_sid(gsid, pwd->pw_gid);
 	if (!is_null_sid(gsid)) {
-		enum lsa_SidType type = SID_NAME_UNKNOWN;
-		TALLOC_CTX *mem_ctx;
-		bool lookup_ret;
-		const DOM_SID *usid = pdb_get_user_sid(sampass);
 		DOM_SID dgsid;
 		uint32_t rid;
 
@@ -233,8 +230,23 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass)
 			case DOMAIN_RID_USERS:
 				sampass->group_sid = gsid;
 				return sampass->group_sid;
+			default:
+				need_lookup_sid = true;
+				break;
+			}
+		} else {
+			ZERO_STRUCTP(gsid);
+			if (pdb_gid_to_sid(pwd->pw_gid, gsid)) {
+				need_lookup_sid = true;
 			}
 		}
+	}
+
+	if (need_lookup_sid) {
+		enum lsa_SidType type = SID_NAME_UNKNOWN;
+		TALLOC_CTX *mem_ctx;
+		bool lookup_ret;
+		const DOM_SID *usid = pdb_get_user_sid(sampass);
 
 		mem_ctx = talloc_init("pdb_get_group_sid");
 		if (!mem_ctx) {
diff --git a/source3/selftest/tests.sh b/source3/selftest/tests.sh
index 0fbee8a..582c900 100755
--- a/source3/selftest/tests.sh
+++ b/source3/selftest/tests.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # This script generates a list of testsuites that should be run as part of 
 # the Samba 3 test suite.
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list