summaryrefslogtreecommitdiff
path: root/source3/sam
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-07-09 16:44:47 +0000
committerGerald Carter <jerry@samba.org>2003-07-09 16:44:47 +0000
commit16ff7b26f6b9d288cbd1d39e075b637e24da13a6 (patch)
treeb20088c7adac8df8823defc6649db0a9607c0c6a /source3/sam
parent816724fb39ba1d13f553704b2deaa3e8e716c5ab (diff)
downloadsamba-16ff7b26f6b9d288cbd1d39e075b637e24da13a6.tar.gz
samba-16ff7b26f6b9d288cbd1d39e075b637e24da13a6.tar.bz2
samba-16ff7b26f6b9d288cbd1d39e075b637e24da13a6.zip
Large set of changes to add UNIX account/group management
to winbindd. See README.idmap-and-winbind-changes for details. (This used to be commit 1111bc7b0c7165e1cdf8d90eb49f4c368d2eded6)
Diffstat (limited to 'source3/sam')
-rw-r--r--source3/sam/idmap.c15
-rw-r--r--source3/sam/idmap_ldap.c1
-rw-r--r--source3/sam/idmap_tdb.c17
3 files changed, 32 insertions, 1 deletions
diff --git a/source3/sam/idmap.c b/source3/sam/idmap.c
index a8c47ab9ae..1db89eba24 100644
--- a/source3/sam/idmap.c
+++ b/source3/sam/idmap.c
@@ -252,6 +252,21 @@ NTSTATUS idmap_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type)
}
/**************************************************************************
+ Get ID from SID. This can create a mapping for a SID to a POSIX id.
+**************************************************************************/
+
+NTSTATUS idmap_allocate_id(unid_t *id, int id_type)
+{
+ /* we have to allocate from the authoritative backend */
+
+ if ( remote_map )
+ return remote_map->allocate_id( id, id_type );
+
+ return cache_map->allocate_id( id, id_type );
+}
+
+
+/**************************************************************************
Shutdown maps.
**************************************************************************/
diff --git a/source3/sam/idmap_ldap.c b/source3/sam/idmap_ldap.c
index d0010d8cd9..2901b1fc49 100644
--- a/source3/sam/idmap_ldap.c
+++ b/source3/sam/idmap_ldap.c
@@ -675,6 +675,7 @@ static void ldap_idmap_status(void)
static struct idmap_methods ldap_methods = {
ldap_idmap_init,
+ ldap_allocate_id,
ldap_get_sid_from_id,
ldap_get_id_from_sid,
ldap_set_mapping,
diff --git a/source3/sam/idmap_tdb.c b/source3/sam/idmap_tdb.c
index 18a082cb84..4643b7db59 100644
--- a/source3/sam/idmap_tdb.c
+++ b/source3/sam/idmap_tdb.c
@@ -45,6 +45,20 @@ static struct idmap_state {
gid_t gid_low, gid_high; /* Range of gids to allocate */
} idmap_state;
+/**********************************************************************
+ Return the TDB_CONTEXT* for winbindd_idmap. I **really** feel
+ dirty doing this, but not so dirty that I want to create another
+ tdb
+***********************************************************************/
+
+TDB_CONTEXT *idmap_tdb_handle( void )
+{
+ if ( idmap_tdb )
+ return idmap_tdb;
+
+ return NULL;
+}
+
/* Allocate either a user or group id from the pool */
static NTSTATUS db_allocate_id(unid_t *id, int id_type)
{
@@ -111,7 +125,7 @@ static NTSTATUS db_allocate_id(unid_t *id, int id_type)
}
(*id).gid = hwm;
- DEBUG(10,("db_allocate_id: ID_GROUPID (*id).uid = %d\n", (unsigned int)hwm));
+ DEBUG(10,("db_allocate_id: ID_GROUPID (*id).gid = %d\n", (unsigned int)hwm));
break;
default:
@@ -595,6 +609,7 @@ static void db_idmap_status(void)
static struct idmap_methods db_methods = {
db_idmap_init,
+ db_allocate_id,
db_get_sid_from_id,
db_get_id_from_sid,
db_set_mapping,