From e17c241711487cd2d203b50fceda83f745b97dc4 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Fri, 11 Jul 2014 14:01:33 +1200 Subject: [PATCH] param: Add errors for when an s3 context is used incorrectly Change-Id: I176b4413769f41739639875ab874a3e340b6a184 Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Thu Jul 31 10:41:58 CEST 2014 on sn-devel-104 --- lib/param/loadparm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 2b73d40f6c3..480f970b02e 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -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; -- 2.11.4.GIT