source: branches/samba-3.0/source/dynconfig.c@ 162

Last change on this file since 162 was 158, checked in by Paul Smedley, 17 years ago

Update source to 3.0.32

File size: 3.8 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 Copyright (C) 2001 by Martin Pool <mbp@samba.org>
4 Copyright (C) 2003 by Jim McDonough <jmcd@us.ibm.com>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21#include "includes.h"
22
23/**
24 * @file dynconfig.c
25 *
26 * @brief Global configurations, initialized to configured defaults.
27 *
28 * This file should be the only file that depends on path
29 * configuration (--prefix, etc), so that if ./configure is re-run,
30 * all programs will be appropriately updated. Everything else in
31 * Samba should import extern variables from here, rather than relying
32 * on preprocessor macros.
33 *
34 * Eventually some of these may become even more variable, so that
35 * they can for example consistently be set across the whole of Samba
36 * by command-line parameters, config file entries, or environment
37 * variables.
38 *
39 * @todo Perhaps eventually these should be merged into the parameter
40 * table? There's kind of a chicken-and-egg situation there...
41 **/
42
43char const *dyn_SBINDIR = SBINDIR,
44 *dyn_BINDIR = BINDIR,
45 *dyn_SWATDIR = SWATDIR;
46
47#ifdef __OS2__
48const char * getconfigfile()
49{
50 static pstring buffer = "";
51 if (!*buffer)
52 {
53 snprintf(buffer, 260, "%s/samba/smb.conf", getenv("ETC"));
54 }
55 return buffer;
56}
57
58const char * getlogbase()
59{
60 static pstring buffer = "";
61 if (!*buffer)
62 {
63 snprintf(buffer, 260, "%s/samba/log", getenv("ETC"));
64 }
65 return buffer;
66}
67
68const char * getlockdir()
69{
70 static pstring buffer = "";
71 if (!*buffer)
72 {
73 snprintf(buffer, 260, "%s/samba/lock", getenv("ETC"));
74 }
75 return buffer;
76}
77
78const char * getpiddir()
79{
80 static pstring buffer = "";
81 if (!*buffer)
82 {
83 snprintf(buffer, 260, "%s/samba/pid", getenv("ETC"));
84 }
85 return buffer;
86}
87
88const char * getprivatedir()
89{
90 static pstring buffer = "";
91 if (!*buffer)
92 {
93 snprintf(buffer, 260, "%s/samba/private", getenv("ETC"));
94 }
95 return buffer;
96}
97
98const char * getsmbpasswd()
99{
100 static pstring buffer = "";
101 if (!*buffer)
102 {
103 snprintf(buffer, 260, "%s/samba/private/smbpasswd", getenv("ETC"));
104 }
105 return buffer;
106}
107
108const char * getlmhosts()
109{
110 static pstring buffer = "";
111 if (!*buffer)
112 {
113 snprintf(buffer, 260, "%s/samba/lmhosts", getenv("ETC"));
114 }
115 return buffer;
116}
117
118/**
119 * @brief Samba library directory.
120 *
121 * @sa lib_path() to get the path to a file inside the LIBDIR.
122 **/
123pstring dyn_LIBDIR = LIBDIR;
124fstring dyn_SHLIBEXT = SHLIBEXT;
125
126
127#else
128
129pstring dyn_CONFIGFILE = CONFIGFILE; /**< Location of smb.conf file. **/
130
131/** Log file directory. **/
132pstring dyn_LOGFILEBASE = LOGFILEBASE;
133
134/** Statically configured LanMan hosts. **/
135pstring dyn_LMHOSTSFILE = LMHOSTSFILE;
136
137/**
138 * @brief Samba library directory.
139 *
140 * @sa lib_path() to get the path to a file inside the LIBDIR.
141 **/
142pstring dyn_LIBDIR = LIBDIR;
143fstring dyn_SHLIBEXT = SHLIBEXT;
144
145/**
146 * @brief Directory holding lock files.
147 *
148 * Not writable, but used to set a default in the parameter table.
149 **/
150pstring dyn_LOCKDIR = LOCKDIR;
151pstring dyn_PIDDIR = PIDDIR;
152
153pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
154pstring dyn_PRIVATE_DIR = PRIVATE_DIR;
155#endif /* __OS2__ */
Note: See TracBrowser for help on using the repository browser.