summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-03-06 10:41:42 -0500
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2008-03-06 10:41:42 -0500
commit914cd3e483bd83fb4d8e769b90d9136336ea51e9 (patch)
tree95f17eeb5c6ee299e57edd3d6686b492d136bfe4 /source3/param
parent5eb347193f7f52bfc672b83da6e45b59db31423c (diff)
downloadsamba-914cd3e483bd83fb4d8e769b90d9136336ea51e9.tar.gz
samba-914cd3e483bd83fb4d8e769b90d9136336ea51e9.tar.bz2
samba-914cd3e483bd83fb4d8e769b90d9136336ea51e9.zip
Eliminate global variable in_client and a plethora of extern declarations.
Derrell (This used to be commit b7f34e7ef2907b498a0645ce68f2773ed7d60cdc)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c25
-rw-r--r--source3/param/params.c4
2 files changed, 24 insertions, 5 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 25aa48b61b..833ca54084 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -54,7 +54,6 @@
#include "includes.h"
#include "libnet/libnet.h"
-bool in_client = False; /* Not in the client by default */
bool bLoaded = False;
extern enum protocol_types Protocol;
@@ -72,6 +71,7 @@ extern userdom_struct current_user_info;
#define HOMES_NAME "homes"
#endif
+static bool in_client = False; /* Not in the client by default */
static uint64_t conf_last_seqnum = 0;
static struct libnet_conf_ctx *conf_ctx = NULL;
@@ -5502,6 +5502,27 @@ void gfree_loadparm(void)
}
}
+
+/***************************************************************************
+ Allow client apps to specify that they are a client
+***************************************************************************/
+void lp_set_in_client(bool b)
+{
+ in_client = b;
+}
+
+
+/***************************************************************************
+ Determine if we're running in a client app
+***************************************************************************/
+bool lp_is_in_client(void)
+{
+ return in_client;
+}
+
+
+
+
/***************************************************************************
Load the services array from the services file. Return True on success,
False on failure.
@@ -5608,7 +5629,7 @@ bool lp_load(const char *pszFname,
/* Now we check bWINSsupport and set szWINSserver to 127.0.0.1 */
/* if bWINSsupport is true and we are in the client */
- if (in_client && Globals.bWINSsupport) {
+ if (lp_is_in_client() && Globals.bWINSsupport) {
lp_do_parameter(GLOBAL_SECTION_SNUM, "wins server", "127.0.0.1");
}
diff --git a/source3/param/params.c b/source3/param/params.c
index 44b44d99b6..e69715e4a3 100644
--- a/source3/param/params.c
+++ b/source3/param/params.c
@@ -80,8 +80,6 @@
#include "includes.h"
-extern bool in_client;
-
/* -------------------------------------------------------------------------- **
* Constants...
*/
@@ -519,7 +517,7 @@ static bool Parse( DATA_BLOB *buf, myFILE *InFile,
static myFILE *OpenConfFile( const char *FileName )
{
const char *func = "params.c:OpenConfFile() -";
- int lvl = in_client?1:0;
+ int lvl = lp_is_in_client() ? 1 : 0;
myFILE *ret;
ret = SMB_MALLOC_P(myFILE);