From 44e601b5ad635ba29088fd4c747627dee8d62112 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 28 Jan 2006 12:15:24 +0000 Subject: r13206: This patch finally re-adds a -k option that works reasonably. From here we can add tests to Samba for kerberos, forcing it on and off. In the process, I also remove the dependency of credentials on GENSEC. This also picks up on the idea of bringing 'set_boolean' into general code from jpeach's cifsdd patch. Andrew Bartlett (This used to be commit 1ac7976ea6e3ad6184c911de5df624c44e7c5228) --- source4/param/loadparm.c | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'source4/param') diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index a92bc68371..bd01581eae 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -912,7 +912,6 @@ FN_GLOBAL_INTEGER(lp_client_signing, &Globals.client_signing) /* local prototypes */ static int map_parameter(const char *pszParmName); -static BOOL set_boolean(BOOL *pb, const char *pszParmValue); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, @@ -1004,7 +1003,7 @@ static BOOL lp_bool(const char *s) return False; } - if (!set_boolean(&ret,s)) { + if (!set_boolean(s, &ret)) { DEBUG(0,("lp_bool(%s): value is not boolean!\n",s)); return False; } @@ -1373,34 +1372,6 @@ void *lp_parm_ptr(int snum, struct parm_struct *parm) return ((char *)ServicePtrs[snum]) + PTR_DIFF(parm->ptr, &sDefault); } -/*************************************************************************** - Set a boolean variable from the text value stored in the passed string. - Returns True in success, False if the passed string does not correctly - represent a boolean. -***************************************************************************/ - -static BOOL set_boolean(BOOL *pb, const char *pszParmValue) -{ - BOOL bRetval; - - bRetval = True; - if (strwicmp(pszParmValue, "yes") == 0 || - strwicmp(pszParmValue, "true") == 0 || - strwicmp(pszParmValue, "1") == 0) - *pb = True; - else if (strwicmp(pszParmValue, "no") == 0 || - strwicmp(pszParmValue, "False") == 0 || - strwicmp(pszParmValue, "0") == 0) - *pb = False; - else { - DEBUG(0, - ("ERROR: Badly formed boolean in configuration file: \"%s\".\n", - pszParmValue)); - bRetval = False; - } - return (bRetval); -} - /*************************************************************************** Find a service by name. Otherwise works like get_service. ***************************************************************************/ @@ -1841,7 +1812,10 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue switch (parm_table[parmnum].type) { case P_BOOL: - set_boolean(parm_ptr, pszParmValue); + if (!set_boolean(pszParmValue, parm_ptr)) { + DEBUG(0,("lp_do_parameter(%s): value is not boolean!\n", pszParmValue)); + return False; + } break; case P_INTEGER: -- cgit