From f4cc85c6c97e7a3e0b63eb4570ca24f1e950379a Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sun, 6 Apr 2003 17:22:41 +0000 Subject: Fix the handling of smb.conf in libsmbclient. The right thing to do is to try for the user's local one in ~/.smbc/smb.conf, and if that fails, try the one in dyn_CONFIGFILE, and if that fails, keep going with the defaults but log a message. (This used to be commit 15fa48d19d178cf8bf214ea02f6c7a4c38890f71) --- source3/libsmb/libsmbclient.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index a0223568f1..69c4d8f7a7 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -2688,13 +2688,16 @@ SMBCCTX * smbc_init_context(SMBCCTX * context) if (!lp_load(conf, True, False, False)) { /* - * Hmmm, what the hell do we do here ... we could not parse the - * config file ... We must return an error ... and keep info around - * about why we failed + * Well, if that failed, try the dyn_CONFIGFILE + * Which points to the standard locn, and if that + * fails, silently ignore it and use the internal + * defaults ... */ - - errno = ENOENT; /* FIXME: Figure out the correct error response */ - return NULL; + + if (!lp_load(dyn_CONFIGFILE, True, False, False)) { + DEBUG(5, ("Could not load either config file: %s or %s\n", + conf, dyn_CONFIGFILE)); + } } reopen_logs(); /* Get logging working ... */ -- cgit