From 64e49aa3c5392fd0ba5fc33ea21eff87c548995e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 7 Mar 2003 23:47:59 +0000 Subject: initial work for the new idmpa interface (This used to be commit 8338e74ac4e5f31150c96f459a67e52090dc6013) --- source3/include/idmap.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source3/include/idmap.h (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h new file mode 100644 index 0000000000..0d358d3fbe --- /dev/null +++ b/source3/include/idmap.h @@ -0,0 +1,49 @@ +/* + Unix SMB/CIFS implementation. + + Idmap headers + + Copyright (C) Anthony Liguori 2003 + Copyright (C) Simo Sorce 2003 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#define ID_USERID 1 +#define ID_GROUPID 2 +#define ID_OTHER 3 + +typedef union id_t { + uid_t uid; + gid_t gid; +} id_t; + +/* Filled out by IDMAP backends */ +struct idmap_methods { + + /* Called when backend is first loaded */ + NTSTATUS (*init)(void); + + NTSTATUS (*get_sid_from_id)(DOM_SID *sid, id_t id, int id_type); + NTSTATUS (*get_id_from_sid)(id_t *id, int *id_type, DOM_SID *sid); + + /* Called when backend is unloaded */ + NTSTATUS (*close)(void); + + /* Called to dump backend status */ + void (*status)(void); +}; + -- cgit From 4a1d2ddd48c1c06b1874ff473275d22a0038c2c8 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 8 Mar 2003 00:49:18 +0000 Subject: some more code (not tested yet) (This used to be commit 0d6cec90c13731827abcbc61974efc993e794003) --- source3/include/idmap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 0d358d3fbe..5a1f4fafc3 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */ +#define ID_EMPTY 0 #define ID_USERID 1 #define ID_GROUPID 2 #define ID_OTHER 3 -- cgit From bebdbcd248ccb3021d0b94f360fc3cf8ba9e90a6 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 8 Mar 2003 17:29:40 +0000 Subject: more on idmap two layers structure with - local tdb cache - remote idmap repository compiles (This used to be commit 8fb4e210bc7564ed491d121c20d598ba0bfbddff) --- source3/include/idmap.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 5a1f4fafc3..fd7646a324 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -22,24 +22,30 @@ Boston, MA 02111-1307, USA. */ -#define ID_EMPTY 0 -#define ID_USERID 1 -#define ID_GROUPID 2 -#define ID_OTHER 3 +#define ID_EMPTY 0x00 +#define ID_USERID 0x01 +#define ID_GROUPID 0x02 +#define ID_OTHER 0x04 -typedef union id_t { +#define ID_TYPEMASK 0x0f + +#define ID_NOMAP 0x10 +#define ID_CACHE 0x20 + +typedef union unid_t { uid_t uid; gid_t gid; -} id_t; +} unid_t; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)(void); + NTSTATUS (*init)(const char *init_str); - NTSTATUS (*get_sid_from_id)(DOM_SID *sid, id_t id, int id_type); - NTSTATUS (*get_id_from_sid)(id_t *id, int *id_type, DOM_SID *sid); + NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, DOM_SID *sid); + NTSTATUS (*set_mapping)(DOM_SID *sid, unid_t id, int id_type); /* Called when backend is unloaded */ NTSTATUS (*close)(void); -- cgit From a557af96e9f232e2fa012850e0725fde353521bd Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 2 Apr 2003 10:36:02 +0000 Subject: THE Idmap patch :-) includes a --with-idmap=no switch to disable idmap usage if you find problems. cosmetic fixes and param aliases to separate winbind from idamp roles. A temporarily remote idmap winbind compatibility backend. As I have time I will further change code to not call directly winbind (partly done but not tested) and a specilized module will be built in place for the current glue hack. The patch has been tested locally in my limited time, the patch is simple and clear and should not reserve problems, if any just disable it. As usual, comments and fisex are welcome :-) Simo. (This used to be commit 02781320476ed1b7ee5d943fa36f9a66ab67f208) --- source3/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index fd7646a324..2cc31e9ed2 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -44,7 +44,7 @@ struct idmap_methods { NTSTATUS (*init)(const char *init_str); NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); - NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, DOM_SID *sid); + NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); NTSTATUS (*set_mapping)(DOM_SID *sid, unid_t id, int id_type); /* Called when backend is unloaded */ -- cgit 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/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 2cc31e9ed2..a7cab74149 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -41,7 +41,7 @@ typedef union unid_t { struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)(const char *init_str); + NTSTATUS (*init)(void); NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); -- cgit From df883f35b28a4991470bd081f63a378225bdf827 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 6 Apr 2003 16:01:18 +0000 Subject: fix commit (This used to be commit ad1a2ab0d6330a0b0fbce7b30ec5f6f502133921) --- source3/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index a7cab74149..1e56519453 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -45,7 +45,7 @@ struct idmap_methods { NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); - NTSTATUS (*set_mapping)(DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); /* Called when backend is unloaded */ NTSTATUS (*close)(void); -- cgit From 2018fcd277f7cc2212f3eda574faf14aed4819e8 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sun, 11 May 2003 23:44:26 +0000 Subject: Add new files needed for VFS fixes. 1. idmap.h is used for unid_t only, agreed by Simo 2. sysquotas.h is used to add quota support to VFS layer and is needed for future NT quota commit 3. vfs_macros.h provides convenient macros to access VFS API. (This used to be commit 1dd578635913c8340cfc565d7e0c8c5086070084) --- source3/include/idmap.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 1e56519453..47114f5469 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -37,15 +37,16 @@ typedef union unid_t { gid_t gid; } unid_t; +struct DOM_SID; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ NTSTATUS (*init)(void); - NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); - NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); - NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*get_sid_from_id)(struct DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const struct DOM_SID *sid); + NTSTATUS (*set_mapping)(const struct DOM_SID *sid, unid_t id, int id_type); /* Called when backend is unloaded */ NTSTATUS (*close)(void); -- cgit From c823b191ab476fc2583d6d6aaa1e2edb09cbb88e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 May 2003 18:12:31 +0000 Subject: And finally IDMAP in 3_0 We really need idmap_ldap to have a good solution with ldapsam, porting it from the prvious code is beeing made, the code is really simple to do so I am confident it is not a problem to commit this code in. Not committing it would have been worst. I really would have been able to finish also the group code, maybe we can put it into a followin release after 3.0.0 even if it may be an upgrade problem. The code has been tested and seem to work right, more testing is needed for corner cases. Currently winbind pdc (working only for users and not for groups) is disabled as I was not able to make a complete group code replacement that works somewhat in a week (I have a complete patch, but there are bugs) Simo. (This used to be commit 0e58085978f984436815114a2ec347cf7899a89d) --- source3/include/idmap.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 47114f5469..5d8e31a163 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -32,21 +32,15 @@ #define ID_NOMAP 0x10 #define ID_CACHE 0x20 -typedef union unid_t { - uid_t uid; - gid_t gid; -} unid_t; - -struct DOM_SID; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ NTSTATUS (*init)(void); - NTSTATUS (*get_sid_from_id)(struct DOM_SID *sid, unid_t id, int id_type); - NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const struct DOM_SID *sid); - NTSTATUS (*set_mapping)(const struct DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); + NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); /* Called when backend is unloaded */ NTSTATUS (*close)(void); -- cgit From 69b50029f4472d29e823e2b541a59a420ab706cb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 29 May 2003 19:08:40 +0000 Subject: Add smb_register_idmap(). Based on a patch from metze (This used to be commit 7e352f5c62c4889bdf2662dded1e74a354890dc7) --- source3/include/idmap.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 5d8e31a163..1267ac27bc 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -22,6 +22,9 @@ Boston, MA 02111-1307, USA. */ +#define SMB_IDMAP_INTERFACE_VERSION 1 + + #define ID_EMPTY 0x00 #define ID_USERID 0x01 #define ID_GROUPID 0x02 -- cgit From 711f8d0a13c6854f8c552a9561571d26fa5e9884 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 6 Jun 2003 13:48:39 +0000 Subject: * break out more common code used between pdb_ldap and idmap_ldap * remove 'winbind uid' and 'winbind gid' parameters (replaced by current idmap parameter) * create the sambaUnixIdPool entries automatically in the 'ldap idmap suffix' * add new 'ldap idmap suffix' and 'ldap group suffix' parametrer * "idmap backend = ldap" now accepts 'ldap:ldap://server/' format (parameters are passed to idmap init() function (This used to be commit 1665926281ed2be3c5affca551c9d458d013fc7f) --- source3/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 1267ac27bc..4b38128c2f 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -39,7 +39,7 @@ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)(void); + NTSTATUS (*init)( char *params ); NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); -- cgit From 8d31403fe831684daaa45d2784c36ab14e3a822a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 26 Jun 2003 23:48:46 +0000 Subject: Add include guards around idmap.h, change ID_NOMAP to ID_QUERY_ONLY and ID_CACHE to ID_CACHE_SAVE. Added locking around tdb writes & deletes for multi-process access. Jeremy. (This used to be commit 5b998cdc1d552234236862f6a2bbae703b0c146e) --- source3/include/idmap.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 4b38128c2f..5a5e87c141 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -1,3 +1,5 @@ +#ifndef _IDMAP_H_ +#define _IDMAP_H_ /* Unix SMB/CIFS implementation. @@ -32,8 +34,8 @@ #define ID_TYPEMASK 0x0f -#define ID_NOMAP 0x10 -#define ID_CACHE 0x20 +#define ID_QUERY_ONLY 0x10 +#define ID_CACHE_SAVE 0x20 /* Filled out by IDMAP backends */ struct idmap_methods { @@ -51,4 +53,4 @@ struct idmap_methods { /* Called to dump backend status */ void (*status)(void); }; - +#endif /* _IDMAP_H_ */ -- cgit From a12556742f5728788575777463f40f6c46ceb5da Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 30 Jun 2003 22:07:47 +0000 Subject: Merge of Volkers patch to make the logic clearer (with my mod). Jeremy. (This used to be commit 1714eb6bef627ebcfb6db03e58fdd02ea502c6e1) --- source3/include/idmap.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 5a5e87c141..47f396e637 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -35,7 +35,6 @@ #define ID_TYPEMASK 0x0f #define ID_QUERY_ONLY 0x10 -#define ID_CACHE_SAVE 0x20 /* Filled out by IDMAP backends */ struct idmap_methods { -- cgit From 16ff7b26f6b9d288cbd1d39e075b637e24da13a6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 9 Jul 2003 16:44:47 +0000 Subject: 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) --- source3/include/idmap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 47f396e637..7da3718d19 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */ -#define SMB_IDMAP_INTERFACE_VERSION 1 +#define SMB_IDMAP_INTERFACE_VERSION 2 #define ID_EMPTY 0x00 @@ -42,6 +42,7 @@ struct idmap_methods { /* Called when backend is first loaded */ NTSTATUS (*init)( char *params ); + NTSTATUS (*allocate_id)(unid_t *id, int id_type); NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); -- cgit From 03d5867d529f126da368ebda70bf2d997aa602e0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 11 Jul 2003 05:33:40 +0000 Subject: moving more code around. * move rid allocation into IDMAP. See comments in _api_samr_create_user() * add winbind delete user/group functions I'm checking this in to sync up with everyone. But I'm going to split the add a separate winbindd_allocate_rid() function for systems that have an 'add user script' but need idmap to give them a RID. Life would be so much simplier without 'enable rid algorithm'. The current RID allocation is horrible due to this one fact. Tested idmap_tdb but not idmap_ldap yet. Will do that tomorrow. Nothing has changed in the way a samba domain is represented, stored, or search in the directory so things should be ok with previous installations. going to bed now. (This used to be commit 0463045cc7ff177fab44b25faffad5bf7140244d) --- source3/include/idmap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 7da3718d19..ae7e4e5101 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -42,6 +42,7 @@ struct idmap_methods { /* Called when backend is first loaded */ NTSTATUS (*init)( char *params ); + NTSTATUS (*allocate_rid)(uint32 *rid, int rid_type); NTSTATUS (*allocate_id)(unid_t *id, int id_type); NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); -- cgit From f210ee9b99b3b6ac0234680f1af83fd783ef9af4 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 1 Aug 2003 14:47:39 +0000 Subject: Fix copyright statements for various pieces of Anthony Liguori's work. (This used to be commit 15d2bc47854df75f8b2644ccbc887d0357d9cd27) --- source3/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index ae7e4e5101..783a5f56fb 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -5,7 +5,7 @@ Idmap headers - Copyright (C) Anthony Liguori 2003 + Copyright (C) Jim McDonough 2003 Copyright (C) Simo Sorce 2003 This library is free software; you can redistribute it and/or -- cgit From 9f2e6167d22cc06fa94495574fc29d6bcbb1dd8a Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Fri, 1 Aug 2003 15:21:20 +0000 Subject: Update my copyrights according to my agreement with IBM (This used to be commit c9b209be2b17c2e4677cc30b46b1074f48878f43) --- source3/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 783a5f56fb..20b1015285 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -5,7 +5,7 @@ Idmap headers - Copyright (C) Jim McDonough 2003 + Copyright (C) Jim McDonough 2003 Copyright (C) Simo Sorce 2003 This library is free software; you can redistribute it and/or -- cgit From fed660877c16562265327c6093ea645cf4176b5c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Jun 2005 22:10:34 +0000 Subject: r7415: * big change -- volker's new async winbindd from trunk (This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8) --- source3/include/idmap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 20b1015285..7205058ee8 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -35,6 +35,7 @@ #define ID_TYPEMASK 0x0f #define ID_QUERY_ONLY 0x10 +#define ID_CACHE_ONLY 0x20 /* Filled out by IDMAP backends */ struct idmap_methods { -- cgit From 3a8af94424c8d60dd80f6b57806ef0b79465badc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 3 Jul 2005 12:05:07 +0000 Subject: r8093: Next round. Now it compiles with --enable-socket-wrapper. Volker (This used to be commit 25cbcfba30f534f3fb31627ba43421c42ccd5b0f) --- source3/include/idmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 7205058ee8..c81b94a718 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -50,7 +50,7 @@ struct idmap_methods { NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); /* Called when backend is unloaded */ - NTSTATUS (*close)(void); + NTSTATUS (*close_fn)(void); /* Called to dump backend status */ void (*status)(void); -- cgit From 0af1500fc0bafe61019f1b2ab1d9e1d369221240 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 3 Feb 2006 22:19:41 +0000 Subject: r13316: Let the carnage begin.... Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f) --- source3/include/idmap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index c81b94a718..474982f292 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -24,6 +24,9 @@ Boston, MA 02111-1307, USA. */ +/* idmap version determines auto-conversion */ +#define IDMAP_VERSION 2 + #define SMB_IDMAP_INTERFACE_VERSION 2 @@ -43,7 +46,6 @@ struct idmap_methods { /* Called when backend is first loaded */ NTSTATUS (*init)( char *params ); - NTSTATUS (*allocate_rid)(uint32 *rid, int rid_type); NTSTATUS (*allocate_id)(unid_t *id, int id_type); NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/include/idmap.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 474982f292..ee248ef26f 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -24,32 +24,32 @@ Boston, MA 02111-1307, USA. */ -/* idmap version determines auto-conversion */ -#define IDMAP_VERSION 2 +/* idmap version determines auto-conversion - this is the database + structure version specifier. */ -#define SMB_IDMAP_INTERFACE_VERSION 2 +#define IDMAP_VERSION 2 +/* The interface version specifier. + Updated to 3 for enum types by JRA. */ -#define ID_EMPTY 0x00 -#define ID_USERID 0x01 -#define ID_GROUPID 0x02 -#define ID_OTHER 0x04 +#define SMB_IDMAP_INTERFACE_VERSION 3 -#define ID_TYPEMASK 0x0f +enum idmap_type { ID_USERID, ID_GROUPID }; -#define ID_QUERY_ONLY 0x10 -#define ID_CACHE_ONLY 0x20 +#define IDMAP_FLAG_NONE 0x0 +#define IDMAP_FLAG_QUERY_ONLY 0x1 /* Don't ever allocate, just query. */ +#define IDMAP_FLAG_CACHE_ONLY 0x2 /* Only look in our local cache, not remote. */ /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)( char *params ); + NTSTATUS (*init)( const char *params ); - NTSTATUS (*allocate_id)(unid_t *id, int id_type); - NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type); - NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid); - NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type); + NTSTATUS (*allocate_id)(unid_t *id, enum idmap_type id_type); + NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, enum idmap_type id_type, int flags); + NTSTATUS (*get_id_from_sid)(unid_t *id, enum idmap_type *id_type, const DOM_SID *sid, int flags); + NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, enum idmap_type id_type); /* Called when backend is unloaded */ NTSTATUS (*close_fn)(void); -- cgit From 4225f9a4bd5eece4d57820bbabb7b882610aa7cc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 12 Dec 2006 14:52:13 +0000 Subject: r20116: Start merging in the work done to create the new idmap subsystem. Simo. (This used to be commit 50cd8bffeeed2cac755f75fc3d76fe41c451976b) --- source3/include/idmap.h | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index ee248ef26f..069aaa73a3 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -32,29 +32,49 @@ /* The interface version specifier. Updated to 3 for enum types by JRA. */ -#define SMB_IDMAP_INTERFACE_VERSION 3 +/* Updated to 4, completely new interface, SSS */ -enum idmap_type { ID_USERID, ID_GROUPID }; +#define SMB_IDMAP_INTERFACE_VERSION 4 -#define IDMAP_FLAG_NONE 0x0 -#define IDMAP_FLAG_QUERY_ONLY 0x1 /* Don't ever allocate, just query. */ -#define IDMAP_FLAG_CACHE_ONLY 0x2 /* Only look in our local cache, not remote. */ +struct idmap_domain { + DOM_SID *sid; + const char *name; + BOOL default_domain; + BOOL readonly; + void *private_data; + struct idmap_methods *methods; +}; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)( const char *params ); + NTSTATUS (*init)(struct idmap_domain *dom, const char *compat_params); + + NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids); + NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids); + NTSTATUS (*set_mapping)(struct idmap_domain *dom, const struct id_map *map); + NTSTATUS (*remove_mapping)(struct idmap_domain *dom, const struct id_map *map); - NTSTATUS (*allocate_id)(unid_t *id, enum idmap_type id_type); - NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, enum idmap_type id_type, int flags); - NTSTATUS (*get_id_from_sid)(unid_t *id, enum idmap_type *id_type, const DOM_SID *sid, int flags); - NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, enum idmap_type id_type); + /* Called to dump backends data */ + /* NOTE: caller must use talloc_free to free maps when done */ + NTSTATUS (*dump_data)(struct idmap_domain *dom, struct id_map **maps, int *num_maps); /* Called when backend is unloaded */ - NTSTATUS (*close_fn)(void); + NTSTATUS (*close_fn)(struct idmap_domain *dom); +}; + +struct idmap_alloc_methods { - /* Called to dump backend status */ - void (*status)(void); + /* Called when backend is first loaded */ + NTSTATUS (*init)(const char *compat_params); + + NTSTATUS (*allocate_id)(struct unixid *id); + NTSTATUS (*get_id_hwm)(struct unixid *id); + NTSTATUS (*set_id_hwm)(struct unixid *id); + + /* Called when backend is unloaded */ + NTSTATUS (*close_fn)(void); }; + #endif /* _IDMAP_H_ */ -- cgit From 37cc3e3d62a5bfad80a666839b8b0b78472ac11d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 22 Jan 2007 16:54:02 +0000 Subject: r20951: Remove the DOM_SID field in the struct idmap_domain and bounce domain SID lookups through the struct winbindd_domain *domain_list by searching by name. Refactor the order lookup when searching for the correct idmap_domain to a single function and remove the requirement that the default domain be listed first in the config file. I would still like to make the idmap_domain array a linked list and remove the existing code which makes use of indexes into the list. Basic testing with tdb pans out ok. (This used to be commit e6c300829ff08dd354f6e9460d396261681e4809) --- source3/include/idmap.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 069aaa73a3..80bd541a23 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -37,7 +37,6 @@ #define SMB_IDMAP_INTERFACE_VERSION 4 struct idmap_domain { - DOM_SID *sid; const char *name; BOOL default_domain; BOOL readonly; -- cgit From 01be4914b37f7e5887f3ecd4ecc53fbd846fc22e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 18 Apr 2007 21:10:37 +0000 Subject: r22343: Commit to 3_0 as well after adapting the patch. (tdb_delete_bystring instead of tdb_delete is used here) (This used to be commit ee40cead097ed2c005f5f80b24c9f681e054849a) --- source3/include/idmap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 80bd541a23..472358a230 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -42,13 +42,15 @@ struct idmap_domain { BOOL readonly; void *private_data; struct idmap_methods *methods; + BOOL initialized; + const char *params; }; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)(struct idmap_domain *dom, const char *compat_params); + NTSTATUS (*init)(struct idmap_domain *dom); NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids); NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids); -- cgit From 36da6cb5847df2754e8f9223e0784da6013c572b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 19 Apr 2007 22:26:09 +0000 Subject: r22390: Patchset sent to samba-technical to address the winbind loop when allocating a new id for a SID: auth_util.patch Revert create_local_token() to the 3.0.24 codebase idmap_type.patch Have the caller fillin the id_map.xid.type field when resolving a SID so that if we allocate a new id, we know what type to use winbindd_api.patch Remove the WINBINDD_SIDS_TO_XIDS calls from the public winbindd interface for the 3.0.25 release idmap_rid.patch Cleanup the idmap_rid backend to not call back into winbindd to resolve the SID in order to verify it's type. (This used to be commit 3b24dae9e73b244540a68b631b428a4d0f57440b) --- source3/include/idmap.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 472358a230..f4926f1e5c 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -52,8 +52,14 @@ struct idmap_methods { /* Called when backend is first loaded */ NTSTATUS (*init)(struct idmap_domain *dom); + /* Map an array of uids/gids to SIDs. The caller specifies + the uid/gid and type. Gets back the SID. */ NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids); + + /* Map an arry of SIDs to uids/gids. The caller sets the SID + and type and gets back a uid or gid. */ NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids); + NTSTATUS (*set_mapping)(struct idmap_domain *dom, const struct id_map *map); NTSTATUS (*remove_mapping)(struct idmap_domain *dom, const struct id_map *map); -- cgit From fd881dad3fb03888b79cc84f287c093d163475c7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:31:50 +0000 Subject: r23794: convert more code from LGPLv2+ to LGPLv3+ (This used to be commit f3df6cd87e1927f41e95af51d750a71278282e15) --- source3/include/idmap.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index f4926f1e5c..41f5006118 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -11,17 +11,15 @@ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + You should have received a copy of the GNU Library General Public License + along with this program. If not, see . */ /* idmap version determines auto-conversion - this is the database -- cgit From 28b9d61076912adbc0c6571c71688aa6831506bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 04:04:46 +0000 Subject: r23800: LGPL is now called GNU Lesser General Public License not GNU Library General Public License (This used to be commit 727a6cf2cba8da6b40610409b264e86e6908eb0c) --- source3/include/idmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 41f5006118..bc5e2eeb01 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -9,7 +9,7 @@ Copyright (C) Simo Sorce 2003 This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public + modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. @@ -18,7 +18,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. - You should have received a copy of the GNU Library General Public License + You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/include/idmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index bc5e2eeb01..e059ab2337 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -36,11 +36,11 @@ struct idmap_domain { const char *name; - BOOL default_domain; - BOOL readonly; + bool default_domain; + bool readonly; void *private_data; struct idmap_methods *methods; - BOOL initialized; + bool initialized; const char *params; }; -- cgit From 340ab6a256802a22c11b7f707748397249075b65 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 13 Jul 2008 12:07:40 +0200 Subject: idmap rewrite (This used to be commit 30a180f2fce8cf6a3e5548f6bba453272ba70b33) --- source3/include/idmap.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source3/include/idmap.h') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index e059ab2337..95c3e4c0c2 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -36,19 +36,15 @@ struct idmap_domain { const char *name; - bool default_domain; - bool readonly; - void *private_data; struct idmap_methods *methods; - bool initialized; - const char *params; + void *private_data; }; /* Filled out by IDMAP backends */ struct idmap_methods { /* Called when backend is first loaded */ - NTSTATUS (*init)(struct idmap_domain *dom); + NTSTATUS (*init)(struct idmap_domain *dom, const char *params); /* Map an array of uids/gids to SIDs. The caller specifies the uid/gid and type. Gets back the SID. */ -- cgit