When loading the default configuration, allow the configuration file to be
authorJelmer Vernooij <jelmer@samba.org>
Tue, 6 Jan 2009 21:36:01 +0000 (22:36 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 6 Jan 2009 21:38:44 +0000 (22:38 +0100)
missing.

source4/param/loadparm.c

index ab7d209d102593b87ca07f384a2ee0aab960a67e..2d9af333259d1b61218e232064e476af073d69ea 100644 (file)
@@ -2429,10 +2429,19 @@ const char *lp_configfile(struct loadparm_context *lp_ctx)
 
 bool lp_load_default(struct loadparm_context *lp_ctx)
 {
+    const char *path;
     if (getenv("SMB_CONF_PATH"))
-        return lp_load(lp_ctx, getenv("SMB_CONF_PATH"));
+        path = getenv("SMB_CONF_PATH");
     else
-        return lp_load(lp_ctx, dyn_CONFIGFILE);
+        path = dyn_CONFIGFILE;
+
+    if (!file_exist(path)) {
+           /* We allow the default smb.conf file to not exist, 
+            * basically the equivalent of an empty file. */
+           return true;
+    }
+
+    return lp_load(lp_ctx, path);
 }
 
 /**