components/samba/samba/patches/7167490-8952.patch
author Jiri Sasek <Jiri.Sasek@Sun.COM>
Mon, 18 Jun 2012 11:06:49 -0700
changeset 874 cef42778dd8b
permissions -rw-r--r--
7167490 Samba 3.6.4 coredumps when trying to use setgroups for the internal default gid -1 7175829 passwords greater than 8 characters supplied to smbpasswd 3.6 don't work 7175184 Samba 3.6.4 net ads join fails failed to lookup DC info for domain 'DOMAIN' over rpc: Logon failure

From 7a64da3189a1e901aff66aa5e2e46e4a9c03750f Mon Sep 17 00:00:00 2001
From: Ira Cooper <[email protected]>
Date: Wed, 23 May 2012 21:39:03 -0400
Subject: [PATCH] s3-passdb: Fix negative SID->uid/gid cache handling. (bug #8952)

-1 uid/gid signals a non existent uid/gid.

Signed-off-by: Stefan Metzmacher <[email protected]>
---
 source3/passdb/lookup_sid.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index 5cf391f..2afa86e 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -1490,7 +1490,24 @@ bool sids_to_unix_ids(const struct dom_sid *sids, uint32_t num_sids,
 			continue;
 		}
 	}
+
 done:
+	for (i=0; i<num_sids; i++) {
+		switch(ids[i].type) {
+		case WBC_ID_TYPE_GID:
+			if (ids[i].id.gid == (gid_t)-1) {
+				ids[i].type = WBC_ID_TYPE_NOT_SPECIFIED;
+			}
+			break;
+		case WBC_ID_TYPE_UID:
+			if (ids[i].id.uid == (uid_t)-1) {
+				ids[i].type = WBC_ID_TYPE_NOT_SPECIFIED;
+			}
+			break;
+		case WBC_ID_TYPE_NOT_SPECIFIED:
+			break;
+		}
+	}
 	ret = true;
 fail:
 	TALLOC_FREE(wbc_ids);
-- 
1.7.4.1