summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-01-28 12:15:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:33 -0500
commit44e601b5ad635ba29088fd4c747627dee8d62112 (patch)
treedb7939e1e24dfd0b4e2fdc3a9bb5a447e4922e81 /source4/param
parent210d3c1dc760af8e21fbfd5b23e87a1c937051d4 (diff)
downloadsamba-44e601b5ad635ba29088fd4c747627dee8d62112.tar.gz
samba-44e601b5ad635ba29088fd4c747627dee8d62112.tar.bz2
samba-44e601b5ad635ba29088fd4c747627dee8d62112.zip
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)
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c36
1 files changed, 5 insertions, 31 deletions
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;
}
@@ -1374,34 +1373,6 @@ void *lp_parm_ptr(int snum, struct parm_struct *parm)
}
/***************************************************************************
- 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: