summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2003-04-02 10:36:02 +0000
committerSimo Sorce <idra@samba.org>2003-04-02 10:36:02 +0000
commita557af96e9f232e2fa012850e0725fde353521bd (patch)
tree7057a2e03df773832c512c2cbda2399b190c19d8 /source3/nsswitch
parent66806b53dcf8957b1bc1b6477abbeda2a072a197 (diff)
downloadsamba-a557af96e9f232e2fa012850e0725fde353521bd.tar.gz
samba-a557af96e9f232e2fa012850e0725fde353521bd.tar.bz2
samba-a557af96e9f232e2fa012850e0725fde353521bd.zip
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)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd.h2
-rw-r--r--source3/nsswitch/winbindd_idmap.c55
-rw-r--r--source3/nsswitch/winbindd_idmap_tdb.c4
-rw-r--r--source3/nsswitch/winbindd_util.c4
4 files changed, 32 insertions, 33 deletions
diff --git a/source3/nsswitch/winbindd.h b/source3/nsswitch/winbindd.h
index d98ac28ab1..192b058871 100644
--- a/source3/nsswitch/winbindd.h
+++ b/source3/nsswitch/winbindd.h
@@ -203,7 +203,7 @@ typedef struct {
} CLI_POLICY_HND;
/* Filled out by IDMAP backends */
-struct idmap_methods {
+struct winbindd_idmap_methods {
/* Called when backend is first loaded */
BOOL (*init)(void);
diff --git a/source3/nsswitch/winbindd_idmap.c b/source3/nsswitch/winbindd_idmap.c
index de547cde41..4b4d9eb8d2 100644
--- a/source3/nsswitch/winbindd_idmap.c
+++ b/source3/nsswitch/winbindd_idmap.c
@@ -24,33 +24,33 @@
static struct {
const char *name;
/* Function to create a member of the idmap_methods list */
- BOOL (*reg_meth)(struct idmap_methods **methods);
- struct idmap_methods *methods;
-} builtin_idmap_functions[] = {
+ BOOL (*reg_meth)(struct winbindd_idmap_methods **methods);
+ struct winbindd_idmap_methods *methods;
+} builtin_winbindd_idmap_functions[] = {
{ "tdb", winbind_idmap_reg_tdb, NULL },
/* { "ldap", winbind_idmap_reg_ldap, NULL },*/
{ NULL, NULL, NULL }
};
/* singleton pattern: uberlazy evaluation */
-static struct idmap_methods *impl;
+static struct winbindd_idmap_methods *impl;
-static struct idmap_methods *get_impl(const char *name)
+static struct winbindd_idmap_methods *get_impl(const char *name)
{
int i = 0;
- struct idmap_methods *ret = NULL;
+ struct winbindd_idmap_methods *ret = NULL;
- while (builtin_idmap_functions[i].name &&
- strcmp(builtin_idmap_functions[i].name, name)) {
+ while (builtin_winbindd_idmap_functions[i].name &&
+ strcmp(builtin_winbindd_idmap_functions[i].name, name)) {
i++;
}
- if (builtin_idmap_functions[i].name) {
- if (!builtin_idmap_functions[i].methods) {
- builtin_idmap_functions[i].reg_meth(&builtin_idmap_functions[i].methods);
+ if (builtin_winbindd_idmap_functions[i].name) {
+ if (!builtin_winbindd_idmap_functions[i].methods) {
+ builtin_winbindd_idmap_functions[i].reg_meth(&builtin_winbindd_idmap_functions[i].methods);
}
- ret = builtin_idmap_functions[i].methods;
+ ret = builtin_winbindd_idmap_functions[i].methods;
}
return ret;
@@ -62,13 +62,13 @@ BOOL winbindd_idmap_init(void)
BOOL ret = False;
DEBUG(3, ("winbindd_idmap_init: using '%s' as backend\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
if (!impl) {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
}
@@ -87,10 +87,10 @@ BOOL winbindd_idmap_get_uid_from_sid(DOM_SID *sid, uid_t *uid)
BOOL ret = False;
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
if (!impl) {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
}
@@ -107,10 +107,10 @@ BOOL winbindd_idmap_get_gid_from_sid(DOM_SID *sid, gid_t *gid)
BOOL ret = False;
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
if (!impl) {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
}
@@ -127,10 +127,10 @@ BOOL winbindd_idmap_get_sid_from_uid(uid_t uid, DOM_SID *sid)
BOOL ret = False;
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
if (!impl) {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
}
@@ -147,14 +147,14 @@ BOOL winbindd_idmap_get_sid_from_gid(gid_t gid, DOM_SID *sid)
BOOL ret = False;
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
}
if (impl) {
ret = impl->get_sid_from_gid(gid, sid);
} else {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
return ret;
@@ -166,14 +166,14 @@ BOOL winbindd_idmap_close(void)
BOOL ret = False;
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
}
if (impl) {
ret = impl->close();
} else {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
return ret;
@@ -183,14 +183,13 @@ BOOL winbindd_idmap_close(void)
void winbindd_idmap_status(void)
{
if (!impl) {
- impl = get_impl(lp_idmap_backend());
+ impl = get_impl(lp_winbind_backend());
}
if (impl) {
impl->status();
} else {
DEBUG(0, ("winbindd_idmap_init: could not load backend '%s'\n",
- lp_idmap_backend()));
+ lp_winbind_backend()));
}
}
-
diff --git a/source3/nsswitch/winbindd_idmap_tdb.c b/source3/nsswitch/winbindd_idmap_tdb.c
index 911b3b41d2..b47b7ed07d 100644
--- a/source3/nsswitch/winbindd_idmap_tdb.c
+++ b/source3/nsswitch/winbindd_idmap_tdb.c
@@ -419,7 +419,7 @@ static void tdb_idmap_status(void)
/* Display complete mapping of users and groups to rids */
}
-struct idmap_methods tdb_idmap_methods = {
+struct winbindd_idmap_methods tdb_idmap_methods = {
tdb_idmap_init,
tdb_get_sid_from_uid,
@@ -433,7 +433,7 @@ struct idmap_methods tdb_idmap_methods = {
tdb_idmap_status
};
-BOOL winbind_idmap_reg_tdb(struct idmap_methods **meth)
+BOOL winbind_idmap_reg_tdb(struct winbindd_idmap_methods **meth)
{
*meth = &tdb_idmap_methods;
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index b033380206..ac0b317b42 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -380,12 +380,12 @@ BOOL winbindd_param_init(void)
{
/* Parse winbind uid and winbind_gid parameters */
- if (!lp_winbind_uid(&server_state.uid_low, &server_state.uid_high)) {
+ if (!lp_idmap_uid(&server_state.uid_low, &server_state.uid_high)) {
DEBUG(0, ("winbind uid range missing or invalid\n"));
return False;
}
- if (!lp_winbind_gid(&server_state.gid_low, &server_state.gid_high)) {
+ if (!lp_idmap_gid(&server_state.gid_low, &server_state.gid_high)) {
DEBUG(0, ("winbind gid range missing or invalid\n"));
return False;
}