1 diff -uNr samba-3.0.0beta2.orig/source/Makefile.in samba-3.0.0beta2/source/Makefile.in
2 --- samba-3.0.0beta2.orig/source/Makefile.in 2003-07-02 23:26:46.000000000 -0500
3 +++ samba-3.0.0beta2/source/Makefile.in 2003-07-02 23:19:46.000000000 -0500
5 CONFIGDIR = @configdir@
6 VARDIR = @localstatedir@
10 # The permissions to give the executables
13 # the directory where lock files go
16 +# FHS directories; equal to LOCKDIR if not using --with-fhs
17 +CACHEDIR = @cachedir@
18 +STATEDIR = @statedir@
20 +# Where to look for (and install) codepage databases.
21 +CODEPAGEDIR = @codepagedir@
23 # the directory where pid files go
25 # man pages language(s)
27 PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
28 PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
29 -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
30 -PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
31 +PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\" -DCACHEDIR=\"$(CACHEDIR)\" -DSTATEDIR=\"$(STATEDIR)\"
32 PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)
34 # Note that all executable programs now provide for an optional executable suffix.
36 @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
38 installdat: installdirs
39 - @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
40 + @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(CODEPAGEDIR) $(srcdir)
42 installswat: installdirs
43 @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
44 diff -uNr samba-3.0.0beta2.orig/source/configure.in samba-3.0.0beta2/source/configure.in
45 --- samba-3.0.0beta2.orig/source/configure.in 2003-07-02 23:26:47.000000000 -0500
46 +++ samba-3.0.0beta2/source/configure.in 2003-07-02 23:19:02.000000000 -0500
49 [ --with-fhs Use FHS-compliant paths (default=no)],
50 configdir="${sysconfdir}/samba"
51 - lockdir="\${VARDIR}/cache/samba"
52 + lockdir="\${VARDIR}/run/samba"
53 piddir="\${VARDIR}/run/samba"
54 logfilebase="\${VARDIR}/log/samba"
55 privatedir="\${CONFIGDIR}/private"
56 libdir="\${prefix}/lib/samba"
57 - swatdir="\${DATADIR}/samba/swat",
58 + swatdir="\${DATADIR}/samba/swat"
59 + codepagedir="\${DATADIR}/samba"
60 + statedir="\${VARDIR}/lib/samba"
61 + cachedir="\${VARDIR}/cache/samba"
62 + AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths]),
63 configdir="\${LIBDIR}"
64 logfilebase="\${VARDIR}"
65 lockdir="\${VARDIR}/locks"
66 piddir="\${VARDIR}/locks"
67 privatedir="\${prefix}/private"
68 - swatdir="\${prefix}/swat")
69 + codepagedir="\${LIBDIR}"
70 + swatdir="\${prefix}/swat"
71 + statedir="\${LOCKDIR}"
72 + cachedir="\${LOCKDIR}")
74 #################################################
75 # set private directory location
80 +AC_SUBST(codepagedir)
84 dnl Unique-to-Samba variables we'll be playing with.
86 diff -uNr samba-3.0.0beta2.orig/source/dynconfig.c samba-3.0.0beta2/source/dynconfig.c
87 --- samba-3.0.0beta2.orig/source/dynconfig.c 2003-07-02 23:26:47.000000000 -0500
88 +++ samba-3.0.0beta2/source/dynconfig.c 2003-07-02 23:19:02.000000000 -0500
90 pstring dyn_LMHOSTSFILE = LMHOSTSFILE;
93 + * @brief Samba data directory.
95 + * @sa data_path() to get the path to a file inside the CODEPAGEDIR.
97 +pstring dyn_CODEPAGEDIR = CODEPAGEDIR;
100 * @brief Samba library directory.
102 * @sa lib_path() to get the path to a file inside the LIBDIR.
105 const pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
106 const pstring dyn_PRIVATE_DIR = PRIVATE_DIR;
109 +/* In non-FHS mode, these should be configurable using 'lock dir =';
110 + but in FHS mode, they are their own directory. Implement as wrapper
111 + functions so that everything can still be kept in dynconfig.c.
114 +char *dyn_STATEDIR(void)
116 +#ifdef FHS_COMPATIBLE
119 + return lp_lockdir();
123 +char *dyn_CACHEDIR(void)
125 +#ifdef FHS_COMPATIBLE
128 + return lp_lockdir();
131 diff -uNr samba-3.0.0beta2.orig/source/groupdb/mapping.c samba-3.0.0beta2/source/groupdb/mapping.c
132 --- samba-3.0.0beta2.orig/source/groupdb/mapping.c 2003-07-02 23:26:47.000000000 -0500
133 +++ samba-3.0.0beta2/source/groupdb/mapping.c 2003-07-02 23:19:02.000000000 -0500
136 if (tdb && local_pid == sys_getpid())
138 - tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
139 + tdb = tdb_open_log(state_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
141 DEBUG(0,("Failed to open group mapping database\n"));
143 diff -uNr samba-3.0.0beta2.orig/source/include/dynconfig.h samba-3.0.0beta2/source/include/dynconfig.h
144 --- samba-3.0.0beta2.orig/source/include/dynconfig.h 2003-07-02 23:26:47.000000000 -0500
145 +++ samba-3.0.0beta2/source/include/dynconfig.h 2003-07-02 23:19:02.000000000 -0500
147 extern pstring dyn_CONFIGFILE;
148 extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
149 extern pstring dyn_LIBDIR;
150 +extern pstring dyn_CODEPAGEDIR;
151 extern const fstring dyn_SHLIBEXT;
152 extern const pstring dyn_LOCKDIR;
153 extern const pstring dyn_PIDDIR;
154 extern const pstring dyn_SMB_PASSWD_FILE;
155 extern const pstring dyn_PRIVATE_DIR;
157 +char *dyn_STATEDIR(void);
158 +char *dyn_CACHEDIR(void);
159 diff -uNr samba-3.0.0beta2.orig/source/intl/lang_tdb.c samba-3.0.0beta2/source/intl/lang_tdb.c
160 --- samba-3.0.0beta2.orig/source/intl/lang_tdb.c 2003-07-02 23:26:47.000000000 -0500
161 +++ samba-3.0.0beta2/source/intl/lang_tdb.c 2003-07-02 23:19:02.000000000 -0500
163 /* if no lang then we don't translate */
164 if (!lang) return True;
166 - asprintf(&msg_path, "%s.msg", lib_path((const char *)lang));
167 + asprintf(&msg_path, "%s.msg", data_path((const char *)lang));
168 if (stat(msg_path, &st) != 0) {
169 /* the msg file isn't available */
175 - asprintf(&path, "%s%s.tdb", lock_path("lang_"), lang);
176 + asprintf(&path, "%s%s.tdb", state_path("lang_"), lang);
178 tdb = tdb_open_log(path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0644);
180 diff -uNr samba-3.0.0beta2.orig/source/lib/account_pol.c samba-3.0.0beta2/source/lib/account_pol.c
181 --- samba-3.0.0beta2.orig/source/lib/account_pol.c 2003-07-02 23:26:47.000000000 -0500
182 +++ samba-3.0.0beta2/source/lib/account_pol.c 2003-07-02 23:19:02.000000000 -0500
185 if (tdb && local_pid == sys_getpid())
187 - tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
188 + tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
190 DEBUG(0,("Failed to open account policy database\n"));
192 diff -uNr samba-3.0.0beta2.orig/source/lib/util.c samba-3.0.0beta2/source/lib/util.c
193 --- samba-3.0.0beta2.orig/source/lib/util.c 2003-07-02 23:26:47.000000000 -0500
194 +++ samba-3.0.0beta2/source/lib/util.c 2003-07-02 23:19:02.000000000 -0500
195 @@ -2252,6 +2252,61 @@
199 + * @brief Returns an absolute path to a file in the Samba data directory.
201 + * @param name File to find, relative to CODEPAGEDIR.
203 + * @retval Pointer to a static #pstring containing the full path.
206 +char *data_path(const char *name)
208 + static pstring fname;
209 + snprintf(fname, sizeof(fname), "%s/%s", dyn_CODEPAGEDIR, name);
213 +/*****************************************************************
214 +a useful function for returning a path in the Samba state directory
215 + *****************************************************************/
216 +char *state_path(char *name)
218 + static pstring fname;
220 + pstrcpy(fname,dyn_STATEDIR());
221 + trim_string(fname,"","/");
223 + if (!directory_exist(fname,NULL)) {
227 + pstrcat(fname,"/");
228 + pstrcat(fname,name);
233 +/*****************************************************************
234 +a useful function for returning a path in the Samba cache directory
235 + *****************************************************************/
236 +char *cache_path(char *name)
238 + static pstring fname;
240 + pstrcpy(fname,dyn_CACHEDIR());
241 + trim_string(fname,"","/");
243 + if (!directory_exist(fname,NULL)) {
247 + pstrcat(fname,"/");
248 + pstrcat(fname,name);
254 * @brief Returns the platform specific shared library extension.
256 * @retval Pointer to a static #fstring containing the extension.
257 diff -uNr samba-3.0.0beta2.orig/source/lib/util_unistr.c samba-3.0.0beta2/source/lib/util_unistr.c
258 --- samba-3.0.0beta2.orig/source/lib/util_unistr.c 2003-07-02 23:26:47.000000000 -0500
259 +++ samba-3.0.0beta2/source/lib/util_unistr.c 2003-07-02 23:19:02.000000000 -0500
261 if (initialised) return;
264 - upcase_table = map_file(lib_path("upcase.dat"), 0x20000);
265 - lowcase_table = map_file(lib_path("lowcase.dat"), 0x20000);
266 + upcase_table = map_file(data_path("upcase.dat"), 0x20000);
267 + lowcase_table = map_file(data_path("lowcase.dat"), 0x20000);
269 /* we would like Samba to limp along even if these tables are
275 - valid_file = map_file(lib_path("valid.dat"), 0x10000);
276 + valid_file = map_file(data_path("valid.dat"), 0x10000);
278 valid_table = valid_file;
280 diff -uNr samba-3.0.0beta2.orig/source/libsmb/samlogon_cache.c samba-3.0.0beta2/source/libsmb/samlogon_cache.c
281 --- samba-3.0.0beta2.orig/source/libsmb/samlogon_cache.c 2003-07-01 09:40:37.000000000 -0500
282 +++ samba-3.0.0beta2/source/libsmb/samlogon_cache.c 2003-07-02 23:19:02.000000000 -0500
284 BOOL netsamlogon_cache_init(void)
286 if (!netsamlogon_tdb) {
287 - netsamlogon_tdb = tdb_open_log(lock_path(NETSAMLOGON_TDB), 0,
288 + netsamlogon_tdb = tdb_open_log(cache_path(NETSAMLOGON_TDB), 0,
289 TDB_DEFAULT, O_RDWR | O_CREAT, 0600);
293 winbindd_cache.tdb open. Open the tdb if a NULL is passed. */
296 - tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
297 + tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
298 TDB_DEFAULT, O_RDWR, 0600);
300 DEBUG(5, ("netsamlogon_clear_cached_user: failed to open cache\n"));
301 diff -uNr samba-3.0.0beta2.orig/source/nmbd/nmbd_serverlistdb.c samba-3.0.0beta2/source/nmbd/nmbd_serverlistdb.c
302 --- samba-3.0.0beta2.orig/source/nmbd/nmbd_serverlistdb.c 2003-07-02 23:26:47.000000000 -0500
303 +++ samba-3.0.0beta2/source/nmbd/nmbd_serverlistdb.c 2003-07-02 23:19:02.000000000 -0500
308 - pstrcpy(fname,lp_lockdir());
309 + pstrcpy(fname,dyn_CACHEDIR());
310 trim_string(fname,NULL,"/");
312 pstrcat(fname,SERVER_LIST);
313 diff -uNr samba-3.0.0beta2.orig/source/nmbd/nmbd_winsserver.c samba-3.0.0beta2/source/nmbd/nmbd_winsserver.c
314 --- samba-3.0.0beta2.orig/source/nmbd/nmbd_winsserver.c 2003-07-02 23:26:47.000000000 -0500
315 +++ samba-3.0.0beta2/source/nmbd/nmbd_winsserver.c 2003-07-02 23:19:02.000000000 -0500
318 add_samba_names_to_subnet(wins_server_subnet);
320 - if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL)
321 + if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL)
323 DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
324 WINS_LIST, strerror(errno) ));
325 @@ -1836,7 +1836,7 @@
329 - slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST);
330 + slprintf(fname,sizeof(fname)-1,"%s/%s", dyn_STATEDIR(), WINS_LIST);
331 all_string_sub(fname,"//", "/", 0);
332 slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid());
334 diff -uNr samba-3.0.0beta2.orig/source/nsswitch/winbindd_cache.c samba-3.0.0beta2/source/nsswitch/winbindd_cache.c
335 --- samba-3.0.0beta2.orig/source/nsswitch/winbindd_cache.c 2003-07-02 23:26:47.000000000 -0500
336 +++ samba-3.0.0beta2/source/nsswitch/winbindd_cache.c 2003-07-02 23:19:02.000000000 -0500
341 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
342 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
343 TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0600);
346 diff -uNr samba-3.0.0beta2.orig/source/nsswitch/winbindd_util.c samba-3.0.0beta2/source/nsswitch/winbindd_util.c
347 --- samba-3.0.0beta2.orig/source/nsswitch/winbindd_util.c 2003-07-01 15:44:25.000000000 -0500
348 +++ samba-3.0.0beta2/source/nsswitch/winbindd_util.c 2003-07-02 23:19:02.000000000 -0500
350 SMB_STRUCT_STAT stbuf;
351 TDB_CONTEXT *idmap_tdb;
353 - pstrcpy(idmap_name, lock_path("winbindd_idmap.tdb"));
354 + pstrcpy(idmap_name, state_path("winbindd_idmap.tdb"));
356 if (!file_exist(idmap_name, &stbuf)) {
357 /* nothing to convert return */
358 diff -uNr samba-3.0.0beta2.orig/source/param/loadparm.c samba-3.0.0beta2/source/param/loadparm.c
359 --- samba-3.0.0beta2.orig/source/param/loadparm.c 2003-07-02 23:26:47.000000000 -0500
360 +++ samba-3.0.0beta2/source/param/loadparm.c 2003-07-02 23:19:02.000000000 -0500
362 char *szAddPrinterCommand;
363 char *szDeletePrinterCommand;
364 char *szOs2DriverMap;
365 +#ifdef FHS_COMPATIBLE
366 + char *szLockDirStub;
371 @@ -1055,8 +1058,13 @@
372 {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
373 {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
374 {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
375 +#ifdef FHS_COMPATIBLE
376 + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
377 + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
379 {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE},
380 {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
382 {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
384 {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER},
385 diff -uNr samba-3.0.0beta2.orig/source/passdb/pdb_tdb.c samba-3.0.0beta2/source/passdb/pdb_tdb.c
386 --- samba-3.0.0beta2.orig/source/passdb/pdb_tdb.c 2003-07-02 23:26:47.000000000 -0500
387 +++ samba-3.0.0beta2/source/passdb/pdb_tdb.c 2003-07-02 23:19:02.000000000 -0500
390 tdb_state->tdbsam_location = talloc_strdup(pdb_context->mem_ctx, location);
393 - get_private_directory(tdbfile);
394 - pstrcat(tdbfile, "/");
395 - pstrcat(tdbfile, PASSDB_FILE_NAME);
396 + char *tdbfile = state_path(PASSDB_FILE_NAME);
397 tdb_state->tdbsam_location = talloc_strdup(pdb_context->mem_ctx, tdbfile);
400 diff -uNr samba-3.0.0beta2.orig/source/passdb/privileges.c samba-3.0.0beta2/source/passdb/privileges.c
401 --- samba-3.0.0beta2.orig/source/passdb/privileges.c 2003-06-07 12:57:35.000000000 -0500
402 +++ samba-3.0.0beta2/source/passdb/privileges.c 2003-07-02 23:19:02.000000000 -0500
404 /* initialise the privilege database */
405 BOOL privilege_init(void)
407 - tdb = tdb_open_log(lock_path("privilege.tdb"), 0, TDB_DEFAULT,
408 + tdb = tdb_open_log(state_path("privilege.tdb"), 0, TDB_DEFAULT,
409 O_RDWR|O_CREAT, 0600);
411 DEBUG(0,("Failed to open privilege database\n"));
412 diff -uNr samba-3.0.0beta2.orig/source/passdb/secrets.c samba-3.0.0beta2/source/passdb/secrets.c
413 --- samba-3.0.0beta2.orig/source/passdb/secrets.c 2003-07-02 23:26:47.000000000 -0500
414 +++ samba-3.0.0beta2/source/passdb/secrets.c 2003-07-02 23:19:02.000000000 -0500
419 - pstrcpy(fname, lp_private_dir());
420 - pstrcat(fname,"/secrets.tdb");
421 + pstrcpy(fname, state_path("secrets.tdb"));
423 tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
425 diff -uNr samba-3.0.0beta2.orig/source/printing/nt_printing.c samba-3.0.0beta2/source/printing/nt_printing.c
426 --- samba-3.0.0beta2.orig/source/printing/nt_printing.c 2003-07-02 23:26:47.000000000 -0500
427 +++ samba-3.0.0beta2/source/printing/nt_printing.c 2003-07-02 23:19:02.000000000 -0500
428 @@ -287,28 +287,28 @@
431 tdb_close(tdb_drivers);
432 - tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
433 + tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
435 DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
436 - lock_path("ntdrivers.tdb"), strerror(errno) ));
437 + state_path("ntdrivers.tdb"), strerror(errno) ));
442 tdb_close(tdb_printers);
443 - tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
444 + tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
446 DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
447 - lock_path("ntprinters.tdb"), strerror(errno) ));
448 + state_path("ntprinters.tdb"), strerror(errno) ));
453 tdb_close(tdb_forms);
454 - tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
455 + tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
457 DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
458 - lock_path("ntforms.tdb"), strerror(errno) ));
459 + state_path("ntforms.tdb"), strerror(errno) ));
463 diff -uNr samba-3.0.0beta2.orig/source/printing/printing.c samba-3.0.0beta2/source/printing/printing.c
464 --- samba-3.0.0beta2.orig/source/printing/printing.c 2003-07-02 23:26:47.000000000 -0500
465 +++ samba-3.0.0beta2/source/printing/printing.c 2003-07-02 23:19:02.000000000 -0500
467 if (local_pid == sys_getpid())
470 - unlink(lock_path("printing.tdb"));
471 - pstrcpy(printing_path,lock_path("printing"));
472 + unlink(cache_path("printing.tdb"));
473 + pstrcpy(printing_path,cache_path("printing"));
474 mkdir(printing_path,0755);
476 local_pid = sys_getpid();
477 diff -uNr samba-3.0.0beta2.orig/source/printing/printing_db.c samba-3.0.0beta2/source/printing/printing_db.c
478 --- samba-3.0.0beta2.orig/source/printing/printing_db.c 2003-07-02 23:26:47.000000000 -0500
479 +++ samba-3.0.0beta2/source/printing/printing_db.c 2003-07-02 23:19:02.000000000 -0500
481 DLIST_ADD(print_db_head, p);
484 - pstrcpy(printdb_path, lock_path("printing/"));
485 + pstrcpy(printdb_path, cache_path("printing/"));
486 pstrcat(printdb_path, printername);
487 pstrcat(printdb_path, ".tdb");
489 diff -uNr samba-3.0.0beta2.orig/source/registry/reg_db.c samba-3.0.0beta2/source/registry/reg_db.c
490 --- samba-3.0.0beta2.orig/source/registry/reg_db.c 2003-07-02 23:26:47.000000000 -0500
491 +++ samba-3.0.0beta2/source/registry/reg_db.c 2003-07-02 23:19:02.000000000 -0500
492 @@ -131,13 +131,13 @@
493 * if we need to init the data in the registry
496 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
497 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
500 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
501 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
503 DEBUG(0,("init_registry: Failed to open registry %s (%s)\n",
504 - lock_path("registry.tdb"), strerror(errno) ));
505 + state_path("registry.tdb"), strerror(errno) ));
509 diff -uNr samba-3.0.0beta2.orig/source/rpc_server/srv_srvsvc_nt.c samba-3.0.0beta2/source/rpc_server/srv_srvsvc_nt.c
510 --- samba-3.0.0beta2.orig/source/rpc_server/srv_srvsvc_nt.c 2003-07-02 23:26:47.000000000 -0500
511 +++ samba-3.0.0beta2/source/rpc_server/srv_srvsvc_nt.c 2003-07-02 23:19:02.000000000 -0500
512 @@ -133,10 +133,10 @@
514 if (share_tdb && local_pid == sys_getpid())
516 - share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
517 + share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
519 DEBUG(0,("Failed to open share info database %s (%s)\n",
520 - lock_path("share_info.tdb"), strerror(errno) ));
521 + state_path("share_info.tdb"), strerror(errno) ));
525 diff -uNr samba-3.0.0beta2.orig/source/sam/idmap_tdb.c samba-3.0.0beta2/source/sam/idmap_tdb.c
526 --- samba-3.0.0beta2.orig/source/sam/idmap_tdb.c 2003-07-01 15:44:26.000000000 -0500
527 +++ samba-3.0.0beta2/source/sam/idmap_tdb.c 2003-07-02 23:19:02.000000000 -0500
529 BOOL tdb_is_new = False;
531 /* use the old database if present */
532 - tdbfile = strdup(lock_path("winbindd_idmap.tdb"));
533 + tdbfile = strdup(state_path("winbindd_idmap.tdb"));
535 DEBUG(0, ("idmap_init: out of memory!\n"));
536 return NT_STATUS_NO_MEMORY;
537 diff -uNr samba-3.0.0beta2.orig/source/smbd/lanman.c samba-3.0.0beta2/source/smbd/lanman.c
538 --- samba-3.0.0beta2.orig/source/smbd/lanman.c 2003-07-02 23:26:47.000000000 -0500
539 +++ samba-3.0.0beta2/source/smbd/lanman.c 2003-07-02 23:19:02.000000000 -0500
541 BOOL local_list_only;
544 - lines = file_lines_load(lock_path(SERVER_LIST), NULL);
545 + lines = file_lines_load(cache_path(SERVER_LIST), NULL);
547 - DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
548 + DEBUG(4,("Can't open %s - %s\n",cache_path(SERVER_LIST),strerror(errno)));
552 diff -uNr samba-3.0.0beta2.orig/source/wrepld/process.c samba-3.0.0beta2/source/wrepld/process.c
553 --- samba-3.0.0beta2.orig/source/wrepld/process.c 2003-07-02 23:26:47.000000000 -0500
554 +++ samba-3.0.0beta2/source/wrepld/process.c 2003-07-02 23:19:02.000000000 -0500
559 - tdb = tdb_open_log(lock_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
560 + tdb = tdb_open_log(state_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
562 DEBUG(2,("get_our_last_id: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) ));
568 - tdb = tdb_open_log(lock_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
569 + tdb = tdb_open_log(state_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
571 DEBUG(2,("send_entry_request: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) ));
573 --- samba_3_0/source/nsswitch/winbindd_acct.c.orig 2003-07-15 13:03:59.000000000 -0400
574 +++ samba_3_0/source/nsswitch/winbindd_acct.c 2003-07-15 13:04:42.000000000 -0400
577 /* Nope. Try to open it */
579 - if (!(account_tdb = tdb_open_log(lock_path("winbindd_idmap.tdb"), 0,
580 + if (!(account_tdb = tdb_open_log(state_path("winbindd_idmap.tdb"), 0,
581 TDB_DEFAULT, O_RDWR | O_CREAT, 0600)))
583 /* last chance -- maybe idmap has already opened it */