summaryrefslogtreecommitdiff
path: root/source3/sam/idmap_winbind.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2003-04-06 09:35:16 +0000
committerSimo Sorce <idra@samba.org>2003-04-06 09:35:16 +0000
commit0ac2b380018bd50eaaf6d6bcfbb6e949b85a6601 (patch)
tree99d701957698c8c4e8f7c99e4c83424b5009e088 /source3/sam/idmap_winbind.c
parent588b1978a19f8bb468165740dc293ae1a4e28951 (diff)
downloadsamba-0ac2b380018bd50eaaf6d6bcfbb6e949b85a6601.tar.gz
samba-0ac2b380018bd50eaaf6d6bcfbb6e949b85a6601.tar.bz2
samba-0ac2b380018bd50eaaf6d6bcfbb6e949b85a6601.zip
This commit make winbindd copy winbindd_idmap.tdb into idmap.tdb on the
first run if idmap.tdb is not found, and then eventually convert it to the new format. This is done to unify winbind and idmap databases and to make a backup of winbindd_idmap.tdb in case you want to downgrade (of course it will not be updated). This is needed because idmap.tdb contains also local mappings, not only foreign domains mappings. Added some other fixes/improvements Simo. (This used to be commit cf17261519fd8775500f9b9d6caa2bc462e04633)
Diffstat (limited to 'source3/sam/idmap_winbind.c')
-rw-r--r--source3/sam/idmap_winbind.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/sam/idmap_winbind.c b/source3/sam/idmap_winbind.c
index c2c46cfb57..d89c9e7bac 100644
--- a/source3/sam/idmap_winbind.c
+++ b/source3/sam/idmap_winbind.c
@@ -38,7 +38,6 @@ static NTSTATUS db_get_sid_from_id(DOM_SID *sid, unid_t id, int id_type)
struct winbindd_request request;
struct winbindd_response response;
int result, operation;
- fstring sid_str;
ZERO_STRUCT(request);
ZERO_STRUCT(response);
@@ -82,6 +81,8 @@ static NTSTATUS db_get_id_from_sid(unid_t *id, int *id_type, const DOM_SID *sid)
return NT_STATUS_INVALID_PARAMETER;
}
+ /* setup request */
+
ZERO_STRUCT(request);
ZERO_STRUCT(response);
@@ -96,6 +97,9 @@ static NTSTATUS db_get_id_from_sid(unid_t *id, int *id_type, const DOM_SID *sid)
return NT_STATUS_INVALID_PARAMETER;
}
+ sid_to_string(sid_str, sid);
+ fstrcpy(request.data.sid, sid_str);
+
/* Make The Request */
result = winbindd_request(operation, &request, &response);
@@ -118,7 +122,7 @@ static NTSTATUS db_set_mapping(DOM_SID *sid, unid_t id, int id_type) {
/*****************************************************************************
Initialise idmap database.
*****************************************************************************/
-static NTSTATUS db_init(const char *db_name) {
+static NTSTATUS db_init(void) {
return NT_STATUS_OK;
}