Password Backends - anymore info out there?

Paul Griffith paulg at cs.yorku.ca
Mon Jan 10 14:26:52 GMT 2005


On Fri, Jan 07, 2005 at 08:23:46PM +0100, Jelmer Vernooij wrote:
> Hi,
> 
> On Fri, Jan 07, 2005 at 03:01:05PM -0500, Paul Griffith wrote about 'Re: Password Backends - anymore info out there?':
> 
> > Hmmm....
> 
> > Looking at your code and the examples I made a plug-in, but Samba is
> > unable to load the plug-in.
> 
> > [2005/01/07 13:33:23, 2, effective(0, 0), real(0, 0)]
> > passdb/pdb_interface.c:make_pdb_methods_name(654)
> >   No builtin backend found, trying to load plugin
> > [2005/01/07 13:33:23, 5, effective(0, 0), real(0, 0)]
> > lib/module.c:smb_probe_module(101)
> >   Probing module 'pdb_udb'
> > [2005/01/07 13:33:23, 5, effective(0, 0), real(0, 0)]
> > lib/module.c:smb_probe_module(112)
> >   Probing module 'pdb_udb': Trying to load from
> >   /usr/local/samba/lib/pdb/pdb_udb.so
> > [2005/01/07 13:33:23, 2, effective(0, 0), real(0, 0)]
> > lib/module.c:do_smb_load_module(63)
> >   Module '/usr/local/samba/lib/pdb/pdb_udb.so' loaded
> > [2005/01/07 13:33:23, 0, effective(0, 0), real(0, 0)]
> > passdb/pdb_interface.c:make_pdb_methods_name(664)
> >   No builtin nor plugin backend for pdb_udb found
> > [2005/01/07 13:33:23, 1, effective(0, 0), real(0, 0)]
> > passdb/pdb_interface.c:make_pdb_context_list(765)
> >   Loading pdb_udb failed!
> 
> > It looks like make_pdb_methods_name in  source/passdb/pb_interface.c 
> > is failing to find the entry to the backend. 
> 
> > In my pdb_udb.c file I have:
> 
> > NTSTATUS pdb_udb_init(void)
> > {
> >    return smb_register_passdb(PASSDB_INTERFACE_VERSION, "udb",udb_init);
> > }
> That should be either "pdb_udb"  or you should specify "passdb backend
> = udb"  below.
> 
> Cheers,
> 
> Jelmer


I must be doing something wrong. I get the same error message as
above. Do I need to change 

(*pdb_method)->name = "udb"; to (*pdb_method)->name = "pdb_udb"; ???


Here is what I now have in pdb_udb.c:

static NTSTATUS udb_init(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, const char *location)
{
        NTSTATUS nt_status;

        if (!NT_STATUS_IS_OK(nt_status = make_pdb_methods(pdb_context->mem_ctx, pdb_method))) {
                return nt_status;
        }

        (*pdb_method)->name = "udb";

        /* Functions your pdb module doesn't provide should not be
           set, make_pdb_methods() already provide suitable defaults
           for missing functions */

        (*pdb_method)->setsampwent = udb_setsampwent;
        (*pdb_method)->endsampwent = udb_endsampwent;
        (*pdb_method)->getsampwent = udb_getsampwent;
        (*pdb_method)->getsampwnam = udb_getsampwnam;
        (*pdb_method)->getsampwsid = udb_getsampwsid;
        (*pdb_method)->add_sam_account = udb_add_sam_account;
        (*pdb_method)->update_sam_account = udb_update_sam_account;
        (*pdb_method)->delete_sam_account = udb_delete_sam_account;

        /* (*pdb_method)->private_data = smb_xstrdup(location); */

        udb_debug_level = debug_add_class("udb");
        if (udb_debug_level == -1) {
            udb_debug_level = DBGC_ALL;
            DEBUG(0, ("udb: Couldn't register custom debugging class!\n"));
        } else DEBUG(0, ("udb: Debug class number of 'udb': %d\n", udb_debug_level));

        DEBUG(0, ("Initializing udb\n"));
        if (location)
           DEBUG(0, ("Location: %s\n", location));

        return NT_STATUS_OK;
}


NTSTATUS pdb_udb(void)
{
   return smb_register_passdb(PASSDB_INTERFACE_VERSION,"pdb_udb",udb_init);
}


and a very simple smb.conf
[global]
netbios name = JAZZY
workgroup = PAULWG
display charset = ascii
security = user
domain logons = yes
domain master = yes
passdb backend = pdb_udb
debug level = 10 passdb:10 
debug uid = yes
max log size = 0
max connections = 0
server string = Test Samba %v Server
encrypt passwords = yes
hosts allow = 130.xx.xx.xx/255.255.255.0
guest account = nobody
interfaces = 130.xx.xx.xx/255.255.255.0 
wins support = no
wins server = 130.xx.xx.xx



Thanks
Paul



More information about the samba-technical mailing list