smb_panic and pdb

Andreas Schneider asn at samba.org
Mon Oct 29 18:48:24 UTC 2018


On Monday, 29 October 2018 18:33:51 CET Andrew Bartlett wrote:
> On Mon, 2018-10-29 at 10:21 -0700, Jeremy Allison via samba-technical
> 
> wrote:
> > On Mon, Oct 29, 2018 at 07:38:55AM +0100, Andreas Schneider wrote:
> > > On Friday, 26 October 2018 21:29:23 CET Jeremy Allison wrote:
> > > > On Wed, Oct 24, 2018 at 05:13:04PM +0200, Andreas Schneider via samba-
> > > 
> > > technical wrote:
> > > > > Hello,
> > > > > 
> > > > > we have a retrace report which starts to glow. winbind is create a
> > > > > core
> > > > > file during a name lookup because it fails to load the pdb methods
> > > > > and
> > > > > calls smb_panic().
> > > > > 
> > > > > This is probably a configuration issue.
> > > > > 
> > > > > However how should we deal with that in a more graceful way and
> > > > > write what
> > > > > is wrong the the log file instead of core dumping?
> > > > > 
> > > > > This has been reported over 6000 times in the meantime. The
> > > > > backtrace is
> > > > > here:
> > > > > 
> > > > > https://retrace.fedoraproject.org/faf/reports/1577174/
> > > > 
> > > > The backtrace shows it printing a name of the backend
> > > > 
> > > > method it's trying and failing to find:
> > > >  224                 char *msg = NULL;
> > > >  225                 if (asprintf(&msg, "pdb_get_methods: "
> > > >  226                              "failed to get pdb methods for
> > > >  backend
> > > > 
> > > > %s\n", 227                              lp_passdb_backend()) > 0) {
> > > > 
> > > >  228                         smb_panic(msg);
> > > > 
> > > > Do you have a log file showing what the
> > > > name is ?
> > > > 
> > > > It'll be what the user configured in:
> > > > 
> > > > passdb backend = XXXXXX
> > > > 
> > > > so I'm guessing a miss-spelling here will
> > > > cause the smb_panic.
> > > > 
> > > > We should probably print the error message
> > > > here and exit more gracefully.
> > > 
> > > How do we do that, call exit_server_cleanly() instead or should we
> > > correctly return error codes in pdb functions?
> > 
> > Looking at return error codes from pdb functions means changing
> > more code, but is probably a better long term solution. For
> > the immediate fedora bug it's probably better to exit. Check
> > what happens in winbindd to exit_server_cleanly(), I think it
> > just calls exit(0) via the shim.
> 
> My suggestion is to have winbindd (and a few other key utilities) check
> this at startup when we prepare messaging etc by calling
> pdb_get_methods_reload() directly.
> 
> That could then print a clear, concise message to the user.

Oh, we already do, but don't check the return code ...


See attached patch.

-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-winbind-Check-return-code-of-initialize_password_.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20181029/8e5cb987/0001-s3-winbind-Check-return-code-of-initialize_password_.bin>


More information about the samba-technical mailing list