s3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id()
authorStefan Metzmacher <metze@samba.org>
Sat, 29 Nov 2014 09:52:05 +0000 (10:52 +0100)
committerGarming Sam <garming@samba.org>
Wed, 3 Dec 2014 05:44:29 +0000 (06:44 +0100)
Change-Id: I40bcfacb812b0dac7917533c9baf82a79f598efd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Dec  3 06:44:29 CET 2014 on sn-devel-104

source3/lib/idmap_cache.c
source3/lib/idmap_cache.h

index 884417193f86428ab0913ae21c0d551c00434fc3..11bda393d0e41006bbdd0e6a92220f51a2489f53 100644 (file)
@@ -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);
 }
index 088526635e6716bd93fd0fb5cd83fccc72b82d9a..5b8586f70225c12fbd413d9a29b3f6a5d2909cc2 100644 (file)
@@ -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);