summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-11-19 03:35:27 +0000
committerMartin Pool <mbp@samba.org>2001-11-19 03:35:27 +0000
commitcaef2d2884fb202bd6184f9a676ecff94c7ab600 (patch)
treed092a13a127929ef7255bbc2e69a9dd36c2f00fe /source3
parent4ea31fb67595ae8705701bd9fb8d8a993c4013fb (diff)
downloadsamba-caef2d2884fb202bd6184f9a676ecff94c7ab600.tar.gz
samba-caef2d2884fb202bd6184f9a676ecff94c7ab600.tar.xz
samba-caef2d2884fb202bd6184f9a676ecff94c7ab600.zip
LIBDIR and LOCKDIR are dynamically configured too.
(This used to be commit 868999ad3c82ad72f11d5b3208b0e42b1ed95096)
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in12
-rw-r--r--source3/dynconfig.c17
-rw-r--r--source3/include/dynconfig.h1
-rw-r--r--source3/include/local.h5
-rw-r--r--source3/lib/util.c13
-rw-r--r--source3/param/loadparm.c2
-rw-r--r--source3/smbd/build_options.c4
7 files changed, 36 insertions, 18 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 5716ac08264..a122226d0cc 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -72,15 +72,17 @@ man_langs = "@manlangs@"
PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
FLAGS1 = $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -I. -I$(srcdir)
FLAGS2 =
-FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\"
-FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\" -DLIBDIR=\"$(LIBDIR)\"
-FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) -DHAVE_INCLUDES_H
+FLAGS3 =
+FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DFORMSFILE=\"$(FORMSFILE)\" -DNTDRIVERSDIR=\"$(NTDRIVERSDIR)\"
+FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
FLAGS = $(ISA) $(FLAGS5) $(PASSWD_FLAGS)
FLAGS32 = $(ISA32) $(FLAGS5) $(PASSWD_FLAGS)
PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DSBINDIR=\"$(SBINDIR)\"
-PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
-PATH_FLAGS = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
+PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\"
+PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
+PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\"
+PATH_FLAGS = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" -DLOGFILEBASE=\"$(LOGFILEBASE)\"
WINBIND_PROGS = bin/wbinfo
WINBIND_SPROGS = bin/winbindd
diff --git a/source3/dynconfig.c b/source3/dynconfig.c
index fd77e88309b..34603fee86b 100644
--- a/source3/dynconfig.c
+++ b/source3/dynconfig.c
@@ -34,6 +34,9 @@
* they can for example consistently be set across the whole of Samba
* by command-line parameters, config file entries, or environment
* variables.
+ *
+ * @todo Perhaps eventually these should be merged into the parameter
+ * table? There's kind of a chicken-and-egg situation there...
**/
char const *dyn_SBINDIR = SBINDIR,
@@ -45,3 +48,17 @@ pstring dyn_CONFIGFILE = CONFIGFILE; /**< Location of smb.conf file. **/
pstring dyn_LOGFILEBASE; /**< Log file directory. **/
pstring dyn_LMHOSTSFILE; /**< Statically configured LanMan hosts. **/
+
+/**
+ * @brief Samba library directory.
+ *
+ * @sa lib_path() to get the path to a file inside the LIBDIR.
+ **/
+pstring dyn_LIBDIR;
+
+/**
+ * @brief Directory holding lock files.
+ *
+ * Not writable, but used to set a default in the parameter table.
+ **/
+const pstring dyn_LOCKDIR;
diff --git a/source3/include/dynconfig.h b/source3/include/dynconfig.h
index c02ee86abf4..3aba194ab23 100644
--- a/source3/include/dynconfig.h
+++ b/source3/include/dynconfig.h
@@ -29,3 +29,4 @@ extern char const *dyn_SBINDIR,
extern pstring dyn_CONFIGFILE;
extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
+extern pstring dyn_LIBDIR, dyn_LOCKDIR;
diff --git a/source3/include/local.h b/source3/include/local.h
index 84f5a3d1dff..cec48850a9c 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -72,11 +72,6 @@
/* wchar separators for lists */
#define LIST_SEP_W wchar_list_sep
-#ifndef LOCKDIR
-/* this should have been set in the Makefile */
-#define LOCKDIR "/tmp/samba"
-#endif
-
/* this is where browse lists are kept in the lock dir */
#define SERVER_LIST "browse.dat"
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 81e30aa8e3b..ea39d8a05b2 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1782,13 +1782,18 @@ char *lock_path(char *name)
return fname;
}
-/*****************************************************************
-a useful function for returning a path in the Samba lib directory
- *****************************************************************/
+
+/**
+ * @brief Returns an absolute path to a file in the Samba lib directory.
+ *
+ * @param name File to find, relative to LIBDIR.
+ *
+ * @retval Pointer to a static #pstring containing the full path.
+ **/
char *lib_path(char *name)
{
static pstring fname;
- snprintf(fname, sizeof(fname), "%s/%s", LIBDIR, name);
+ snprintf(fname, sizeof(fname), "%s/%s", dyn_LIBDIR, name);
return fname;
}
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index f1ee1803f3c..931e07b37c1 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1199,7 +1199,7 @@ static void init_globals(void)
string_set(&Globals.szWorkGroup, WORKGROUP);
string_set(&Globals.szPasswdProgram, "");
string_set(&Globals.szPrintcapname, PRINTCAP_NAME);
- string_set(&Globals.szLockDir, LOCKDIR);
+ string_set(&Globals.szLockDir, dyn_LOCKDIR);
string_set(&Globals.szSocketAddress, "0.0.0.0");
pstrcpy(s, "Samba ");
pstrcat(s, VERSION);
diff --git a/source3/smbd/build_options.c b/source3/smbd/build_options.c
index 8c22e95451d..7ddbd2433a3 100644
--- a/source3/smbd/build_options.c
+++ b/source3/smbd/build_options.c
@@ -194,9 +194,7 @@ void build_options(BOOL screen)
#endif
output(screen," SBINDIR: %s\n", dyn_SBINDIR);
output(screen," BINDIR: %s\n", dyn_BINDIR);
-#ifdef LOCKDIR
- output(screen," LOCKDIR: %s\n",LOCKDIR);
-#endif
+ output(screen," LOCKDIR: %s\n",dyn_LOCKDIR);
#ifdef DRIVERFILE
output(screen," DRIVERFILE: %s\n",DRIVERFILE);
#endif