summaryrefslogtreecommitdiff
path: root/source3/sam
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-08 22:10:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:08 -0500
commitfed660877c16562265327c6093ea645cf4176b5c (patch)
treee92ae1356542ba095d806bbe1093fa56fbc8ddcc /source3/sam
parent66bb4f03c3466205488f72e4878e8801c5bbb295 (diff)
downloadsamba-fed660877c16562265327c6093ea645cf4176b5c.tar.gz
samba-fed660877c16562265327c6093ea645cf4176b5c.tar.bz2
samba-fed660877c16562265327c6093ea645cf4176b5c.zip
r7415: * big change -- volker's new async winbindd from trunk
(This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8)
Diffstat (limited to 'source3/sam')
-rw-r--r--source3/sam/idmap.c11
-rw-r--r--source3/sam/idmap_ldap.c11
-rw-r--r--source3/sam/idmap_util.c16
3 files changed, 19 insertions, 19 deletions
diff --git a/source3/sam/idmap.c b/source3/sam/idmap.c
index d18157643b..91fe97e23a 100644
--- a/source3/sam/idmap.c
+++ b/source3/sam/idmap.c
@@ -153,11 +153,16 @@ BOOL idmap_init(const char **remote_backend)
Don't do id mapping. This is used to make winbind a netlogon proxy only.
**************************************************************************/
-void idmap_proxyonly(void)
+void idmap_set_proxyonly(void)
{
proxyonly = True;
}
+BOOL idmap_proxyonly(void)
+{
+ return proxyonly;
+}
+
/**************************************************************************
This is a rare operation, designed to allow an explicit mapping to be
set up for a sid to a POSIX id.
@@ -223,7 +228,7 @@ NTSTATUS idmap_get_id_from_sid(unid_t *id, int *id_type, const DOM_SID *sid)
return NT_STATUS_OK;
}
- if (remote_map == NULL) {
+ if ((remote_map == NULL) || (loc_type & ID_CACHE_ONLY)) {
return ret;
}
@@ -288,7 +293,7 @@ NTSTATUS idmap_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type)
if (NT_STATUS_IS_OK(ret))
return ret;
- if (remote_map == NULL)
+ if ((remote_map == NULL) || (loc_type & ID_CACHE_ONLY))
return ret;
/* We have a second chance, ask our authoritative backend */
diff --git a/source3/sam/idmap_ldap.c b/source3/sam/idmap_ldap.c
index 5773cd3479..b4a8c8a752 100644
--- a/source3/sam/idmap_ldap.c
+++ b/source3/sam/idmap_ldap.c
@@ -71,7 +71,8 @@ static NTSTATUS ldap_set_mapping(const DOM_SID *sid, unid_t id, int id_type)
else
fstrcpy( type, get_attr_key2string( sidmap_attr_list, LDAP_ATTR_GIDNUMBER ) );
- pstr_sprintf(id_str, "%d", ((id_type & ID_USERID) ? id.uid : id.gid));
+ pstr_sprintf(id_str, "%lu", ((id_type & ID_USERID) ? (unsigned long)id.uid :
+ (unsigned long)id.gid));
smbldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_IDMAP_ENTRY );
@@ -500,9 +501,9 @@ static NTSTATUS ldap_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type)
type = get_attr_key2string( idpool_attr_list, LDAP_ATTR_GIDNUMBER );
pstrcpy( suffix, lp_ldap_idmap_suffix() );
- pstr_sprintf(filter, "(&(objectClass=%s)(%s=%d))",
+ pstr_sprintf(filter, "(&(objectClass=%s)(%s=%lu))",
LDAP_OBJ_IDMAP_ENTRY, type,
- ((id_type & ID_USERID) ? id.uid : id.gid));
+ ((id_type & ID_USERID) ? (unsigned long)id.uid : (unsigned long)id.gid));
attr_list = get_attr_list( sidmap_attr_list );
rc = smbldap_search(ldap_state.smbldap_state, suffix, LDAP_SCOPE_SUBTREE,
@@ -700,8 +701,8 @@ static NTSTATUS verify_idpool( void )
return NT_STATUS_UNSUCCESSFUL;
}
- fstr_sprintf( uid_str, "%d", luid );
- fstr_sprintf( gid_str, "%d", lgid );
+ fstr_sprintf( uid_str, "%lu", (unsigned long)luid );
+ fstr_sprintf( gid_str, "%lu", (unsigned long)lgid );
smbldap_set_mod( &mods, LDAP_MOD_ADD, "objectClass", LDAP_OBJ_IDPOOL );
smbldap_set_mod( &mods, LDAP_MOD_ADD,
diff --git a/source3/sam/idmap_util.c b/source3/sam/idmap_util.c
index 41689f413b..3c9f420a9a 100644
--- a/source3/sam/idmap_util.c
+++ b/source3/sam/idmap_util.c
@@ -100,14 +100,13 @@ BOOL idmap_check_sid_is_in_free_range(const DOM_SID *sid)
Returns SID pointer.
*****************************************************************/
-NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid)
+NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid, int flags)
{
unid_t id;
- int flags;
DEBUG(10,("idmap_uid_to_sid: uid = [%lu]\n", (unsigned long)uid));
- flags = ID_USERID;
+ flags |= ID_USERID;
id.uid = uid;
return idmap_get_sid_from_id(sid, id, flags);
@@ -118,20 +117,15 @@ NTSTATUS idmap_uid_to_sid(DOM_SID *sid, uid_t uid)
Returns SID pointer.
*****************************************************************/
-NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid)
+NTSTATUS idmap_gid_to_sid(DOM_SID *sid, gid_t gid, int flags)
{
unid_t id;
- int flags;
DEBUG(10,("idmap_gid_to_sid: gid = [%lu]\n", (unsigned long)gid));
- flags = ID_GROUPID;
-#if 0 /* JERRY */
- if (!idmap_check_ugid_is_in_free_range(gid)) {
- flags |= ID_QUERY_ONLY;
- }
-#endif
+ flags |= ID_GROUPID;
id.gid = gid;
+
return idmap_get_sid_from_id(sid, id, flags);
}