param: allow fallback to s3 do_section in lib/param
authorGarming Sam <garming@catalyst.net.nz>
Thu, 27 Feb 2014 21:16:05 +0000 (10:16 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 7 Jul 2014 21:32:36 +0000 (23:32 +0200)
This means that pm_process will eventually only call one do_section
method.

Change-Id: I81ffd0d61783df3e6c267f06210d4180a291ab4c
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
lib/param/loadparm.c

index d030d0b3eba46f69270f788f0c648f759e96f49e..bda014319ccfcc9526bae6c5d9545f828c2e1b4a 100644 (file)
@@ -1899,8 +1899,15 @@ static bool do_section(const char *pszSectionName, void *userdata)
 {
        struct loadparm_context *lp_ctx = (struct loadparm_context *)userdata;
        bool bRetval;
-       bool isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) ||
+       bool isglobal;
+
+       if (lp_ctx->s3_fns != NULL) {
+               return lp_ctx->s3_fns->do_section(pszSectionName, lp_ctx);
+       }
+
+       isglobal = ((strwicmp(pszSectionName, GLOBAL_NAME) == 0) ||
                         (strwicmp(pszSectionName, GLOBAL_NAME2) == 0));
+
        bRetval = false;
 
        /* if we've just struck a global section, note the fact. */