[PATCH] Fixing Bug 10720 - error: Unable to convert first SID

Stefan (metze) Metzmacher metze at samba.org
Tue Dec 2 01:12:41 MST 2014


Hi Andrew,

can you have a look at the following additional patch.

metze
-------------- next part --------------
From 15b3e340b5bb06d71ea423da5d65f7ff36e613c5 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Sat, 29 Nov 2014 10:52:05 +0100
Subject: [PATCH] s3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id()

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/lib/idmap_cache.c | 72 -----------------------------------------------
 source3/lib/idmap_cache.h |  2 --
 2 files changed, 74 deletions(-)

diff --git a/source3/lib/idmap_cache.c b/source3/lib/idmap_cache.c
index 8844171..11bda39 100644
--- a/source3/lib/idmap_cache.c
+++ b/source3/lib/idmap_cache.c
@@ -346,78 +346,6 @@ void idmap_cache_set_sid2unixid(const struct dom_sid *sid, struct unixid *unix_i
 	}
 }
 
-/**
- * Store a mapping in the idmap cache
- * @param[in] sid		the sid to map
- * @param[in] uid		the uid to map
- *
- * If both parameters are valid values, then a positive mapping in both
- * directions is stored. If "is_null_sid(sid)" is true, then this will be a
- * negative mapping of uid, we want to cache that for this uid we could not
- * find anything. Likewise if "uid==-1", then we want to cache that we did not
- * find a mapping for the sid passed here.
- */
-
-void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid)
-{
-	struct unixid id;
-	id.type = ID_TYPE_UID;
-	id.id = uid;
-
-	if (uid == -1) {
-		uid_t tmp_gid;
-		bool expired;
-		/* If we were asked to invalidate this SID -> UID
-		 * mapping, it was because we found out that this was
-		 * not a UID at all.  Do not overwrite a valid GID or
-		 * BOTH mapping */
-		if (idmap_cache_find_sid2gid(sid, &tmp_gid, &expired)) {
-			if (!expired) {
-				return;
-			}
-		}
-	}
-
-	idmap_cache_set_sid2unixid(sid, &id);
-	return;
-}
-
-/**
- * Store a mapping in the idmap cache
- * @param[in] sid		the sid to map
- * @param[in] gid		the gid to map
- *
- * If both parameters are valid values, then a positive mapping in both
- * directions is stored. If "is_null_sid(sid)" is true, then this will be a
- * negative mapping of gid, we want to cache that for this gid we could not
- * find anything. Likewise if "gid==-1", then we want to cache that we did not
- * find a mapping for the sid passed here.
- */
-
-void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid)
-{
-	struct unixid id;
-	id.type = ID_TYPE_GID;
-	id.id = gid;
-
-	if (gid == -1) {
-		uid_t tmp_uid;
-		bool expired;
-		/* If we were asked to invalidate this SID -> GID
-		 * mapping, it was because we found out that this was
-		 * not a GID at all.  Do not overwrite a valid UID or
-		 * BOTH mapping */
-		if (idmap_cache_find_sid2uid(sid, &tmp_uid, &expired)) {
-			if (!expired) {
-				return;
-			}
-		}
-	}
-
-	idmap_cache_set_sid2unixid(sid, &id);
-	return;
-}
-
 static char* key_xid2sid_str(TALLOC_CTX* mem_ctx, char t, const char* id) {
 	return talloc_asprintf(mem_ctx, "IDMAP/%cID2SID/%s", t, id);
 }
diff --git a/source3/lib/idmap_cache.h b/source3/lib/idmap_cache.h
index 0885266..5b8586f 100644
--- a/source3/lib/idmap_cache.h
+++ b/source3/lib/idmap_cache.h
@@ -32,8 +32,6 @@ bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid,
 bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired);
 bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired);
 void idmap_cache_set_sid2unixid(const struct dom_sid *sid, struct unixid *unix_id);
-void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid);
-void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid);
 
 bool idmap_cache_del_uid(uid_t uid);
 bool idmap_cache_del_gid(gid_t gid);
-- 
1.9.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141202/9f75cf44/attachment.pgp>


More information about the samba-technical mailing list