diff options
author | Michael Adam <obnox@samba.org> | 2012-11-23 17:53:39 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-12-03 08:48:27 +0100 |
commit | c408126b47b0ce496a8b2293a8481d439b4234cf (patch) | |
tree | a851c1bec536ad8b825f4060ce699d75610146cd | |
parent | 5f7a3720036c422142774ce49147328dc784fec8 (diff) | |
download | samba-c408126b47b0ce496a8b2293a8481d439b4234cf.tar.gz samba-c408126b47b0ce496a8b2293a8481d439b4234cf.tar.bz2 samba-c408126b47b0ce496a8b2293a8481d439b4234cf.zip |
s3:winbindd: remove unused idmap_sid_to_gid()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/winbindd/idmap_proto.h | 1 | ||||
-rw-r--r-- | source3/winbindd/idmap_util.c | 74 |
2 files changed, 0 insertions, 75 deletions
diff --git a/source3/winbindd/idmap_proto.h b/source3/winbindd/idmap_proto.h index c6f76bd075..6b3d8cfc9f 100644 --- a/source3/winbindd/idmap_proto.h +++ b/source3/winbindd/idmap_proto.h @@ -55,7 +55,6 @@ NTSTATUS idmap_tdb_init(void); NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid); NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid); -NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid); bool idmap_unix_id_is_in_range(uint32_t id, struct idmap_domain *dom); #endif /* _WINBINDD_IDMAP_PROTO_H_ */ diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index 7acef8dbd1..9d9ada7199 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -154,80 +154,6 @@ backend: return NT_STATUS_OK; } -/***************************************************************** - Returns the GID mapped to the given SID. - If mapping is not possible or SID maps to a UID returns an error. -*****************************************************************/ - -NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid) -{ - NTSTATUS ret; - struct id_map map; - bool expired; - - DEBUG(10,("idmap_sid_to_gid: sid = [%s], domain = '%s'\n", - sid_string_dbg(sid), domname)); - - if (winbindd_use_idmap_cache() - && idmap_cache_find_sid2gid(sid, gid, &expired)) { - DEBUG(10, ("idmap_cache_find_sid2gid found %d%s\n", - (int)(*gid), expired ? " (expired)": "")); - if (expired && idmap_is_online()) { - DEBUG(10, ("revalidating expired entry\n")); - goto backend; - } - if ((*gid) == -1) { - DEBUG(10, ("Returning negative cache entry\n")); - return NT_STATUS_NONE_MAPPED; - } - DEBUG(10, ("Returning positive cache entry\n")); - return NT_STATUS_OK; - } - -backend: - ZERO_STRUCT(map); - map.sid = sid; - map.xid.type = ID_TYPE_GID; - - ret = idmap_backends_sid_to_unixid(domname, &map); - - if (!NT_STATUS_IS_OK(ret)) { - DEBUG(10, ("idmap_backends_sid_to_unixid failed: %s\n", - nt_errstr(ret))); - if (winbindd_use_idmap_cache()) { - idmap_cache_set_sid2gid(sid, -1); - } - return ret; - } - - if (map.status != ID_MAPPED) { - DEBUG(10, ("sid [%s] is not mapped\n", sid_string_dbg(sid))); - if (winbindd_use_idmap_cache()) { - idmap_cache_set_sid2gid(sid, -1); - } - return NT_STATUS_NONE_MAPPED; - } - - if (map.xid.type != ID_TYPE_GID) { - DEBUG(10, ("sid [%s] not mapped to a gid " - "[%u,%u,%u]\n", - sid_string_dbg(sid), - map.status, - map.xid.type, - map.xid.id)); - if (winbindd_use_idmap_cache()) { - idmap_cache_set_sid2gid(sid, -1); - } - return NT_STATUS_NONE_MAPPED; - } - - *gid = map.xid.id; - if (winbindd_use_idmap_cache()) { - idmap_cache_set_sid2unixid(sid, &map.xid); - } - return NT_STATUS_OK; -} - /** * check whether a given unix id is inside the filter range of an idmap domain */ |