svn commit: samba r2692 - in trunk/source: nsswitch sam
vlendec at samba.org
vlendec at samba.org
Mon Sep 27 14:44:48 GMT 2004
Author: vlendec
Date: 2004-09-27 14:44:48 +0000 (Mon, 27 Sep 2004)
New Revision: 2692
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source&rev=2692&nolog=1
Log:
Increase a debug level for a quite frequent operation.
Optimization for 'idmap backend = ldap': When asking sid2id for the wrong
type, don't ask ldap when we have the opposite mapping in the local tdb.
Volker
Modified:
trunk/source/nsswitch/winbindd_sid.c
trunk/source/sam/idmap.c
Changeset:
Modified: trunk/source/nsswitch/winbindd_sid.c
===================================================================
--- trunk/source/nsswitch/winbindd_sid.c 2004-09-27 14:44:07 UTC (rev 2691)
+++ trunk/source/nsswitch/winbindd_sid.c 2004-09-27 14:44:48 UTC (rev 2692)
@@ -219,7 +219,7 @@
if (NT_STATUS_IS_OK(result))
return WINBINDD_OK;
- DEBUG(1, ("Could not get uid for sid %s\n", state->request.data.sid));
+ DEBUG(4, ("Could not get uid for sid %s\n", state->request.data.sid));
return WINBINDD_ERROR;
}
@@ -329,7 +329,7 @@
if (NT_STATUS_IS_OK(result))
return WINBINDD_OK;
- DEBUG(1, ("Could not get gid for sid %s\n", state->request.data.sid));
+ DEBUG(4, ("Could not get gid for sid %s\n", state->request.data.sid));
return WINBINDD_ERROR;
}
Modified: trunk/source/sam/idmap.c
===================================================================
--- trunk/source/sam/idmap.c 2004-09-27 14:44:07 UTC (rev 2691)
+++ trunk/source/sam/idmap.c 2004-09-27 14:44:48 UTC (rev 2692)
@@ -200,6 +200,7 @@
{
NTSTATUS ret;
int loc_type;
+ unid_t loc_id;
if (proxyonly)
return NT_STATUS_UNSUCCESSFUL;
@@ -223,6 +224,32 @@
return ret;
}
+ /* Before forking out to the possibly slow remote map, lets see if we
+ * already have the sid as uid when asking for a gid or vice versa. */
+
+ loc_type = *id_type & ID_TYPEMASK;
+
+ switch (loc_type) {
+ case ID_USERID:
+ loc_type = ID_GROUPID;
+ break;
+ case ID_GROUPID:
+ loc_type = ID_USERID;
+ break;
+ default:
+ loc_type = ID_EMPTY;
+ }
+
+ loc_type |= ID_QUERY_ONLY;
+
+ ret = cache_map->get_id_from_sid(&loc_id, &loc_type, sid);
+
+ if (NT_STATUS_IS_OK(ret)) {
+ /* Ok, we have the uid as gid or vice versa. The remote map
+ * would not know anything different, so return here. */
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
/* Ok, the mapping was not in the cache, give the remote map a
second try. */
More information about the samba-cvs
mailing list