param: Add errors for when an s3 context is used incorrectly
authorGarming Sam <garming@catalyst.net.nz>
Fri, 11 Jul 2014 02:01:33 +0000 (14:01 +1200)
committerMichael Adam <obnox@samba.org>
Thu, 31 Jul 2014 08:41:58 +0000 (10:41 +0200)
Change-Id: I176b4413769f41739639875ab874a3e340b6a184
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jul 31 10:41:58 CEST 2014 on sn-devel-104

lib/param/loadparm.c

index 2b73d40f6c3f35c794599abcf60eea3bd6e7caf5..480f970b02ec5c56b91653468de1ab2790e7d9f7 100644 (file)
@@ -574,6 +574,10 @@ struct loadparm_service *lpcfg_add_service(struct loadparm_context *lp_ctx,
        int num_to_alloc = lp_ctx->iNumServices + 1;
        struct parmlist_entry *data, *pdata;
 
+       if (lp_ctx->s3_fns != NULL) {
+               smb_panic("Add a service should not be called on an s3 loadparm ctx");
+       }
+
        if (pservice == NULL) {
                pservice = lp_ctx->sDefault;
        }
@@ -2296,6 +2300,11 @@ void lpcfg_killunused(struct loadparm_context *lp_ctx,
                   bool (*snumused) (struct smbsrv_connection *, int))
 {
        int i;
+
+       if (lp_ctx->s3_fns != NULL) {
+               smb_panic("Cannot be used from an s3 loadparm ctx");
+       }
+
        for (i = 0; i < lp_ctx->iNumServices; i++) {
                if (lp_ctx->services[i] == NULL)
                        continue;