[s3]libsmbconf: fall back to file backend when no valid backend was found
authorMichael Adam <obnox@samba.org>
Tue, 21 Oct 2008 21:20:57 +0000 (23:20 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 27 Oct 2008 12:02:39 +0000 (13:02 +0100)
Interpret the source string as a file name when it contains
a ':' sign but the initial part is not a known backend.
This might occur even implicitly when "%T" is used in an
include file name (even though this is not realistic..).

Michael

source3/lib/smbconf/smbconf_init.c

index 8d5bca190283c7010d54e0b766133173647fe632..a362a663afd600ca4f7193c0ed6af7b4a850d43d 100644 (file)
@@ -79,11 +79,12 @@ WERROR smbconf_init(TALLOC_CTX *mem_ctx, struct smbconf_ctx **conf_ctx,
        } else {
                /*
                 * Separator was specified but this is not a known backend.
-                * Can't handle this.
+                * As a last resort, try to interpret the original source
+                * string as a file name that contains a ":" sign.
+                * This may occur with an include directive like this:
+                * 'include = /path/to/file.%T'
                 */
-               DEBUG(1, ("smbconf_init: ERROR - unknown backend '%s' given\n",
-                         backend));
-               werr = WERR_INVALID_PARAM;
+               werr = smbconf_init_txt(mem_ctx, conf_ctx, source);
        }
 
 done: