LIBDIR and LOCKDIR are dynamically configured too.
authorMartin Pool <mbp@samba.org>
Mon, 19 Nov 2001 03:35:27 +0000 (03:35 +0000)
committerMartin Pool <mbp@samba.org>
Mon, 19 Nov 2001 03:35:27 +0000 (03:35 +0000)
(This used to be commit 868999ad3c82ad72f11d5b3208b0e42b1ed95096)

source3/Makefile.in
source3/dynconfig.c
source3/include/dynconfig.h
source3/include/local.h
source3/lib/util.c
source3/param/loadparm.c
source3/smbd/build_options.c

index 5716ac082649ea1e9b994cb6791ffdab7e26d4a7..a122226d0ccc43af3d30bd4d8f37654bc1963818 100644 (file)
@@ -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
index fd77e88309b6352d81d4ec7c16bf23c08c1a648d..34603fee86b9902a28cced0045a265565f016245 100644 (file)
@@ -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;
index c02ee86abf45c5c4453c1c174bcf592829bab996..3aba194ab230821de3a4b76ab3852b5056a2016a 100644 (file)
@@ -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; 
index 84f5a3d1dff5a4eb548637435a343db2ea273068..cec48850a9c758b88610668ca58d8dae444ffbfd 100644 (file)
 /* 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"
 
index 81e30aa8e3bdcfe4d911ac30ef986d9771de59d1..ea39d8a05b2f2bda9fbfa87917f752a857d43288 100644 (file)
@@ -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;
 }
 
index f1ee1803f3c091628a9e025d333b5969b4f717a7..931e07b37c10263605fef9e1d64b67bc4dd27790 100644 (file)
@@ -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);
index 8c22e95451d7fbf6a38395f8ef5043c96ccc9de3..7ddbd2433a3daa735f182f4c84af24ccb767891b 100644 (file)
@@ -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