Fix the handling of smb.conf in libsmbclient.
authorRichard Sharpe <sharpe@samba.org>
Sun, 6 Apr 2003 17:22:41 +0000 (17:22 +0000)
committerRichard Sharpe <sharpe@samba.org>
Sun, 6 Apr 2003 17:22:41 +0000 (17:22 +0000)
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

index a0223568f1f80648d0df6f8e30c47d1e96b0a2e8..69c4d8f7a77cd1ab5f075e48e06763fbb7369d67 100644 (file)
@@ -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 ... */