summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_tdb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2003-04-27 12:47:41 +0000
committerSimo Sorce <idra@samba.org>2003-04-27 12:47:41 +0000
commit88e41f9e20c3498fe12190da71b9c154332a7cd8 (patch)
treee6b20b2eac63832c2046142a145aabc7969ed1c3 /source3/passdb/pdb_tdb.c
parente06940968abc20336e4eecc93ac2bdb1b1639855 (diff)
downloadsamba-88e41f9e20c3498fe12190da71b9c154332a7cd8.tar.gz
samba-88e41f9e20c3498fe12190da71b9c154332a7cd8.tar.bz2
samba-88e41f9e20c3498fe12190da71b9c154332a7cd8.zip
prepare to get _nua out of the door (but back in from the window ;-)
(This used to be commit 09eb02cba0747ae47aa4a76f4fac69af293a774a)
Diffstat (limited to 'source3/passdb/pdb_tdb.c')
-rw-r--r--source3/passdb/pdb_tdb.c39
1 files changed, 7 insertions, 32 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 3a1702a4e0..41c6bbd429 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -912,14 +912,7 @@ NTSTATUS pdb_init_tdbsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, con
{
NTSTATUS nt_status;
struct tdbsam_privates *tdb_state;
-
-#if 0 /* when made a module use this */
- tdbsam_debug_level = debug_add_class("tdbsam");
- if(tdbsam_debug_level == -1) {
- tdbsam_debug_level = DBGC_ALL;
- DEBUG(0, ("tdbsam: Couldn't register custom debugging class!\n"));
- }
-#endif
+ uint32 low_nua_uid, high_nua_uid;
if (!NT_STATUS_IS_OK(nt_status = make_pdb_methods(pdb_context->mem_ctx, pdb_method))) {
return nt_status;
@@ -959,41 +952,23 @@ NTSTATUS pdb_init_tdbsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, con
(*pdb_method)->free_private_data = free_private_data;
- return NT_STATUS_OK;
-}
-
-NTSTATUS pdb_init_tdbsam_nua(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, const char *location)
-{
- NTSTATUS nt_status;
- struct tdbsam_privates *tdb_state;
- uint32 low_nua_uid, high_nua_uid;
-
- if (!NT_STATUS_IS_OK(nt_status = pdb_init_tdbsam(pdb_context, pdb_method, location))) {
- return nt_status;
- }
+ if (lp_idmap_uid(&low_nua_uid, &high_nua_uid)) {
+ DEBUG(0, ("idmap uid range defined, non unix accounts enabled\n"));
- (*pdb_method)->name = "tdbsam_nua";
+ tdb_state->permit_non_unix_accounts = True;
- tdb_state = (*pdb_method)->private_data;
+ tdb_state->low_nua_rid=fallback_pdb_uid_to_user_rid(low_nua_uid);
- tdb_state->permit_non_unix_accounts = True;
+ tdb_state->high_nua_rid=fallback_pdb_uid_to_user_rid(high_nua_uid);
- if (!lp_non_unix_account_range(&low_nua_uid, &high_nua_uid)) {
- DEBUG(0, ("cannot use tdbsam_nua without 'non unix account range' in smb.conf!\n"));
- return NT_STATUS_UNSUCCESSFUL;
}
- tdb_state->low_nua_rid=fallback_pdb_uid_to_user_rid(low_nua_uid);
-
- tdb_state->high_nua_rid=fallback_pdb_uid_to_user_rid(high_nua_uid);
-
return NT_STATUS_OK;
}
int pdb_tdbsam_init(void)
{
- smb_register_passdb("tdbsam", pdb_init_tdbsam, PASSDB_INTERFACE_VERSION);
- smb_register_passdb("tdbsam_nua", pdb_init_tdbsam_nua, PASSDB_INTERFACE_VERSION);
+ smb_register_passdb("tdbsam", pdb_init_tdbsam, PASSDB_INTERFACE_VERSION);
return True;
}