diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-06 22:36:01 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-06 22:38:44 +0100 |
commit | ee9dff71e1a3e6749b946e19e15ef1c077a021cf (patch) | |
tree | f9326cc91fdc135767ea1099821f4d008c8c4d34 /source4/param | |
parent | e95101da589fa33553a4a8ec7986ab1a64f32ebc (diff) | |
download | samba-ee9dff71e1a3e6749b946e19e15ef1c077a021cf.tar.gz samba-ee9dff71e1a3e6749b946e19e15ef1c077a021cf.tar.bz2 samba-ee9dff71e1a3e6749b946e19e15ef1c077a021cf.zip |
When loading the default configuration, allow the configuration file to be
missing.
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/loadparm.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index ab7d209d10..2d9af33325 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -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); } /** |