From 0ac2b380018bd50eaaf6d6bcfbb6e949b85a6601 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 6 Apr 2003 09:35:16 +0000 Subject: 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) --- source3/sam/idmap_winbind.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/sam/idmap_winbind.c') 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; } -- cgit