1 diff -uNr samba-3.0.10.orig/source/Makefile.in samba-3.0.10/source/Makefile.in
2 --- samba-3.0.10.orig/source/Makefile.in 2004-12-17 03:50:08.000000000 -0800
3 +++ samba-3.0.10/source/Makefile.in 2004-12-17 03:55:29.000000000 -0800
5 # the directory where lock files go
8 +# FHS directories; equal to LOCKDIR if not using --with-fhs
10 +STATEDIR = @statedir@
12 +# Where to look for (and install) codepage databases.
13 +CODEPAGEDIR = @codepagedir@
15 # the directory where pid files go
17 # man pages language(s)
19 PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
20 PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
21 -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
22 -PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
23 +PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\" -DCACHEDIR=\"$(CACHEDIR)\" -DSTATEDIR=\"$(STATEDIR)\"
24 PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)
26 # Note that all executable programs now provide for an optional executable suffix.
28 @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
30 installdat: installdirs
31 - @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
32 + @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(CODEPAGEDIR) $(srcdir)
34 installmsg: installdirs
35 @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir)
36 diff -uNr samba-3.0.10.orig/source/configure.in samba-3.0.10/source/configure.in
37 --- samba-3.0.10.orig/source/configure.in 2004-12-17 03:50:08.000000000 -0800
38 +++ samba-3.0.10/source/configure.in 2004-12-17 03:55:29.000000000 -0800
40 [ --with-fhs Use FHS-compliant paths (default=no)],
43 - lockdir="\${VARDIR}/lib/samba"
44 + lockdir="\${VARDIR}/run/samba"
45 piddir="\${VARDIR}/run"
46 mandir="\${prefix}/share/man"
47 logfilebase="\${VARDIR}/log/samba"
49 libdir="\${prefix}/lib/samba"
50 configdir="${sysconfdir}/samba"
51 swatdir="\${DATADIR}/samba/swat"
52 + codepagedir="\${DATADIR}/samba"
53 + statedir="\${VARDIR}/lib/samba"
54 + cachedir="\${VARDIR}/cache/samba"
55 + AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
63 +AC_SUBST(codepagedir)
67 dnl Unique-to-Samba variables we'll be playing with.
69 diff -uNr samba-3.0.10.orig/source/dynconfig.c samba-3.0.10/source/dynconfig.c
70 --- samba-3.0.10.orig/source/dynconfig.c 2004-12-17 03:50:08.000000000 -0800
71 +++ samba-3.0.10/source/dynconfig.c 2004-12-17 03:55:29.000000000 -0800
73 pstring dyn_LMHOSTSFILE = LMHOSTSFILE;
76 + * @brief Samba data directory.
78 + * @sa data_path() to get the path to a file inside the CODEPAGEDIR.
80 +pstring dyn_CODEPAGEDIR = CODEPAGEDIR;
83 * @brief Samba library directory.
85 * @sa lib_path() to get the path to a file inside the LIBDIR.
88 const pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
89 const pstring dyn_PRIVATE_DIR = PRIVATE_DIR;
92 +/* In non-FHS mode, these should be configurable using 'lock dir =';
93 + but in FHS mode, they are their own directory. Implement as wrapper
94 + functions so that everything can still be kept in dynconfig.c.
97 +char *dyn_STATEDIR(void)
99 +#ifdef FHS_COMPATIBLE
102 + return lp_lockdir();
106 +char *dyn_CACHEDIR(void)
108 +#ifdef FHS_COMPATIBLE
111 + return lp_lockdir();
114 diff -uNr samba-3.0.10.orig/source/groupdb/mapping.c samba-3.0.10/source/groupdb/mapping.c
115 --- samba-3.0.10.orig/source/groupdb/mapping.c 2004-12-17 03:50:08.000000000 -0800
116 +++ samba-3.0.10/source/groupdb/mapping.c 2004-12-17 03:55:29.000000000 -0800
121 - tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
122 + tdb = tdb_open_log(state_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
124 DEBUG(0,("Failed to open group mapping database\n"));
126 diff -uNr samba-3.0.10.orig/source/include/dynconfig.h samba-3.0.10/source/include/dynconfig.h
127 --- samba-3.0.10.orig/source/include/dynconfig.h 2004-12-17 03:50:08.000000000 -0800
128 +++ samba-3.0.10/source/include/dynconfig.h 2004-12-17 03:55:29.000000000 -0800
130 extern pstring dyn_CONFIGFILE;
131 extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
132 extern pstring dyn_LIBDIR;
133 +extern pstring dyn_CODEPAGEDIR;
134 extern const fstring dyn_SHLIBEXT;
135 extern const pstring dyn_LOCKDIR;
136 extern const pstring dyn_PIDDIR;
137 extern const pstring dyn_SMB_PASSWD_FILE;
138 extern const pstring dyn_PRIVATE_DIR;
140 +char *dyn_STATEDIR(void);
141 +char *dyn_CACHEDIR(void);
142 diff -uNr samba-3.0.10.orig/source/intl/lang_tdb.c samba-3.0.10/source/intl/lang_tdb.c
143 --- samba-3.0.10.orig/source/intl/lang_tdb.c 2004-12-17 03:50:08.000000000 -0800
144 +++ samba-3.0.10/source/intl/lang_tdb.c 2004-12-17 03:55:29.000000000 -0800
149 - asprintf(&msg_path, "%s.msg", lib_path((const char *)lang));
150 + asprintf(&msg_path, "%s.msg", data_path((const char *)lang));
151 if (stat(msg_path, &st) != 0) {
152 /* the msg file isn't available */
153 DEBUG(10, ("lang_tdb_init: %s: %s\n", msg_path,
154 diff -uNr samba-3.0.10.orig/source/lib/account_pol.c samba-3.0.10/source/lib/account_pol.c
155 --- samba-3.0.10.orig/source/lib/account_pol.c 2004-12-17 03:50:08.000000000 -0800
156 +++ samba-3.0.10/source/lib/account_pol.c 2004-12-17 03:55:29.000000000 -0800
161 - tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
162 + tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
164 DEBUG(0,("Failed to open account policy database\n"));
166 diff -uNr samba-3.0.10.orig/source/lib/util.c samba-3.0.10/source/lib/util.c
167 --- samba-3.0.10.orig/source/lib/util.c 2004-12-17 03:50:08.000000000 -0800
168 +++ samba-3.0.10/source/lib/util.c 2004-12-17 03:55:29.000000000 -0800
169 @@ -2362,6 +2362,61 @@
173 + * @brief Returns an absolute path to a file in the Samba data directory.
175 + * @param name File to find, relative to CODEPAGEDIR.
177 + * @retval Pointer to a static #pstring containing the full path.
180 +char *data_path(const char *name)
182 + static pstring fname;
183 + snprintf(fname, sizeof(fname), "%s/%s", dyn_CODEPAGEDIR, name);
187 +/*****************************************************************
188 +a useful function for returning a path in the Samba state directory
189 + *****************************************************************/
190 +char *state_path(char *name)
192 + static pstring fname;
194 + pstrcpy(fname,dyn_STATEDIR());
195 + trim_string(fname,"","/");
197 + if (!directory_exist(fname,NULL)) {
201 + pstrcat(fname,"/");
202 + pstrcat(fname,name);
207 +/*****************************************************************
208 +a useful function for returning a path in the Samba cache directory
209 + *****************************************************************/
210 +char *cache_path(char *name)
212 + static pstring fname;
214 + pstrcpy(fname,dyn_CACHEDIR());
215 + trim_string(fname,"","/");
217 + if (!directory_exist(fname,NULL)) {
221 + pstrcat(fname,"/");
222 + pstrcat(fname,name);
228 * @brief Returns the platform specific shared library extension.
230 * @retval Pointer to a static #fstring containing the extension.
231 diff -uNr samba-3.0.10.orig/source/lib/util_unistr.c samba-3.0.10/source/lib/util_unistr.c
232 --- samba-3.0.10.orig/source/lib/util_unistr.c 2004-12-17 03:50:08.000000000 -0800
233 +++ samba-3.0.10/source/lib/util_unistr.c 2004-12-17 03:55:29.000000000 -0800
235 if (initialised) return;
238 - upcase_table = map_file(lib_path("upcase.dat"), 0x20000);
239 - lowcase_table = map_file(lib_path("lowcase.dat"), 0x20000);
240 + upcase_table = map_file(data_path("upcase.dat"), 0x20000);
241 + lowcase_table = map_file(data_path("lowcase.dat"), 0x20000);
243 /* we would like Samba to limp along even if these tables are
249 - valid_file = map_file(lib_path("valid.dat"), 0x10000);
250 + valid_file = map_file(data_path("valid.dat"), 0x10000);
252 valid_table = valid_file;
254 diff -uNr samba-3.0.10.orig/source/libsmb/samlogon_cache.c samba-3.0.10/source/libsmb/samlogon_cache.c
255 --- samba-3.0.10.orig/source/libsmb/samlogon_cache.c 2004-12-17 03:50:08.000000000 -0800
256 +++ samba-3.0.10/source/libsmb/samlogon_cache.c 2004-12-17 03:55:29.000000000 -0800
258 BOOL netsamlogon_cache_init(void)
260 if (!netsamlogon_tdb) {
261 - netsamlogon_tdb = tdb_open_log(lock_path(NETSAMLOGON_TDB), 0,
262 + netsamlogon_tdb = tdb_open_log(cache_path(NETSAMLOGON_TDB), 0,
263 TDB_DEFAULT, O_RDWR | O_CREAT, 0600);
267 winbindd_cache.tdb open. Open the tdb if a NULL is passed. */
270 - tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
271 + tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
272 TDB_DEFAULT, O_RDWR, 0600);
274 DEBUG(5, ("netsamlogon_clear_cached_user: failed to open cache\n"));
275 diff -uNr samba-3.0.10.orig/source/nmbd/nmbd_serverlistdb.c samba-3.0.10/source/nmbd/nmbd_serverlistdb.c
276 --- samba-3.0.10.orig/source/nmbd/nmbd_serverlistdb.c 2004-12-17 03:50:09.000000000 -0800
277 +++ samba-3.0.10/source/nmbd/nmbd_serverlistdb.c 2004-12-17 03:55:29.000000000 -0800
282 - pstrcpy(fname,lp_lockdir());
283 + pstrcpy(fname,dyn_CACHEDIR());
284 trim_char(fname,'\0' ,'/');
286 pstrcat(fname,SERVER_LIST);
287 diff -uNr samba-3.0.10.orig/source/nmbd/nmbd_winsserver.c samba-3.0.10/source/nmbd/nmbd_winsserver.c
288 --- samba-3.0.10.orig/source/nmbd/nmbd_winsserver.c 2004-12-17 03:50:09.000000000 -0800
289 +++ samba-3.0.10/source/nmbd/nmbd_winsserver.c 2004-12-17 03:55:30.000000000 -0800
292 add_samba_names_to_subnet(wins_server_subnet);
294 - if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL) {
295 + if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL) {
296 DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
297 WINS_LIST, strerror(errno) ));
299 @@ -1810,7 +1810,7 @@
303 - slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST);
304 + slprintf(fname,sizeof(fname)-1,"%s/%s", dyn_STATEDIR(), WINS_LIST);
305 all_string_sub(fname,"//", "/", 0);
306 slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid());
308 diff -uNr samba-3.0.20b.orig/source/passdb/login_cache.c samba-3.0.20b/source/passdb/login_cache.c
309 --- samba-3.0.20b.orig/source/passdb/login_cache.c
310 +++ samba-3.0.20b/source/passdb/login_cache.c
312 /* skip file open if it's already opened */
313 if (cache) return True;
315 - asprintf(&cache_fname, "%s/%s", lp_lockdir(), LOGIN_CACHE_FILE);
316 + asprintf(&cache_fname, "%s/%s", dyn_CACHEDIR(), LOGIN_CACHE_FILE);
318 DEBUG(5, ("Opening cache file at %s\n", cache_fname));
320 diff -uNr samba-3.0.20b.orig/source/nsswitch/winbindd_cache.c samba-3.0.20b/source/nsswitch/winbindd_cache.c
321 --- samba-3.0.20b.orig/source/nsswitch/winbindd_cache.c
322 +++ samba-3.0.20b/source/nsswitch/winbindd_cache.c
327 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
328 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
329 TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0600);
332 @@ -1471,7 +1471,7 @@
333 if (wcache->tdb != NULL)
336 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
337 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
338 TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0600);
340 if (wcache->tdb == NULL) {
341 diff -uNr samba-3.0.10.orig/source/nsswitch/winbindd_util.c samba-3.0.10/source/nsswitch/winbindd_util.c
342 --- samba-3.0.10.orig/source/nsswitch/winbindd_util.c 2004-12-17 03:50:09.000000000 -0800
343 +++ samba-3.0.10/source/nsswitch/winbindd_util.c 2004-12-17 03:55:30.000000000 -0800
345 SMB_STRUCT_STAT stbuf;
346 TDB_CONTEXT *idmap_tdb;
348 - pstrcpy(idmap_name, lock_path("winbindd_idmap.tdb"));
349 + pstrcpy(idmap_name, state_path("winbindd_idmap.tdb"));
351 if (!file_exist(idmap_name, &stbuf)) {
352 /* nothing to convert return */
353 diff -uNr samba-3.0.10.orig/source/param/loadparm.c samba-3.0.10/source/param/loadparm.c
354 --- samba-3.0.10.orig/source/param/loadparm.c 2004-12-17 03:50:09.000000000 -0800
355 +++ samba-3.0.10/source/param/loadparm.c 2004-12-17 03:55:30.000000000 -0800
357 char *szAddPrinterCommand;
358 char *szDeletePrinterCommand;
359 char *szOs2DriverMap;
360 +#ifdef FHS_COMPATIBLE
361 + char *szLockDirStub;
366 @@ -1105,8 +1108,13 @@
367 {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
368 {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
369 {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
370 +#ifdef FHS_COMPATIBLE
371 + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
372 + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
374 {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED},
375 {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE},
377 {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED},
379 {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED},
380 diff -uNr samba-3.0.10.orig/source/passdb/pdb_tdb.c samba-3.0.10/source/passdb/pdb_tdb.c
381 --- samba-3.0.10.orig/source/passdb/pdb_tdb.c 2004-12-17 03:50:09.000000000 -0800
382 +++ samba-3.0.10/source/passdb/pdb_tdb.c 2004-12-17 03:55:30.000000000 -0800
385 tdb_state->tdbsam_location = talloc_strdup(pdb_context->mem_ctx, location);
388 - get_private_directory(tdbfile);
389 - pstrcat(tdbfile, "/");
390 - pstrcat(tdbfile, PASSDB_FILE_NAME);
391 + char *tdbfile = state_path(PASSDB_FILE_NAME);
392 tdb_state->tdbsam_location = talloc_strdup(pdb_context->mem_ctx, tdbfile);
395 diff -uNr samba-3.0.10.orig/source/passdb/secrets.c samba-3.0.10/source/passdb/secrets.c
396 --- samba-3.0.10.orig/source/passdb/secrets.c 2004-12-17 03:50:09.000000000 -0800
397 +++ samba-3.0.10/source/passdb/secrets.c 2004-12-17 03:55:30.000000000 -0800
402 - pstrcpy(fname, lp_private_dir());
403 - pstrcat(fname,"/secrets.tdb");
404 + pstrcpy(fname, state_path("secrets.tdb"));
406 tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
408 diff -uNr samba-3.0.10.orig/source/printing/nt_printing.c samba-3.0.10/source/printing/nt_printing.c
409 --- samba-3.0.10.orig/source/printing/nt_printing.c 2004-12-17 03:50:09.000000000 -0800
410 +++ samba-3.0.10/source/printing/nt_printing.c 2004-12-17 03:55:31.000000000 -0800
411 @@ -298,28 +298,28 @@
414 tdb_close(tdb_drivers);
415 - tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
416 + tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
418 DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
419 - lock_path("ntdrivers.tdb"), strerror(errno) ));
420 + state_path("ntdrivers.tdb"), strerror(errno) ));
425 tdb_close(tdb_printers);
426 - tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
427 + tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
429 DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
430 - lock_path("ntprinters.tdb"), strerror(errno) ));
431 + state_path("ntprinters.tdb"), strerror(errno) ));
436 tdb_close(tdb_forms);
437 - tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
438 + tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
440 DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
441 - lock_path("ntforms.tdb"), strerror(errno) ));
442 + state_path("ntforms.tdb"), strerror(errno) ));
446 diff -uNr samba-3.0.10.orig/source/printing/printing.c samba-3.0.10/source/printing/printing.c
447 --- samba-3.0.10.orig/source/printing/printing.c 2004-12-17 03:50:09.000000000 -0800
448 +++ samba-3.0.10/source/printing/printing.c 2004-12-17 03:55:31.000000000 -0800
450 int services = lp_numservices();
453 - unlink(lock_path("printing.tdb"));
454 - pstrcpy(printing_path,lock_path("printing"));
455 + unlink(cache_path("printing.tdb"));
456 + pstrcpy(printing_path,cache_path("printing"));
457 mkdir(printing_path,0755);
459 /* handle a Samba upgrade */
460 diff -uNr samba-3.0.10.orig/source/printing/printing_db.c samba-3.0.10/source/printing/printing_db.c
461 --- samba-3.0.10.orig/source/printing/printing_db.c 2004-12-17 03:50:09.000000000 -0800
462 +++ samba-3.0.10/source/printing/printing_db.c 2004-12-17 03:55:31.000000000 -0800
464 DLIST_ADD(print_db_head, p);
467 - pstrcpy(printdb_path, lock_path("printing/"));
468 + pstrcpy(printdb_path, cache_path("printing/"));
469 pstrcat(printdb_path, printername);
470 pstrcat(printdb_path, ".tdb");
472 diff -uNr samba-3.0.10.orig/source/registry/reg_db.c samba-3.0.10/source/registry/reg_db.c
473 --- samba-3.0.10.orig/source/registry/reg_db.c 2004-12-17 03:50:09.000000000 -0800
474 +++ samba-3.0.10/source/registry/reg_db.c 2004-12-17 03:55:31.000000000 -0800
475 @@ -198,12 +198,12 @@
479 - if ( !(tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
480 + if ( !(tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
482 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
483 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
485 DEBUG(0,("init_registry: Failed to open registry %s (%s)\n",
486 - lock_path("registry.tdb"), strerror(errno) ));
487 + state_path("registry.tdb"), strerror(errno) ));
491 diff -uNr samba-3.0.10.orig/source/rpc_server/srv_srvsvc_nt.c samba-3.0.10/source/rpc_server/srv_srvsvc_nt.c
492 --- samba-3.0.10.orig/source/rpc_server/srv_srvsvc_nt.c 2004-12-17 03:50:09.000000000 -0800
493 +++ samba-3.0.10/source/rpc_server/srv_srvsvc_nt.c 2004-12-17 03:55:31.000000000 -0800
494 @@ -133,10 +133,10 @@
496 if (share_tdb && local_pid == sys_getpid())
498 - share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
499 + share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
501 DEBUG(0,("Failed to open share info database %s (%s)\n",
502 - lock_path("share_info.tdb"), strerror(errno) ));
503 + state_path("share_info.tdb"), strerror(errno) ));
507 diff -uNr samba-3.0.10.orig/source/sam/idmap_tdb.c samba-3.0.10/source/sam/idmap_tdb.c
508 --- samba-3.0.10.orig/source/sam/idmap_tdb.c 2004-12-17 03:50:09.000000000 -0800
509 +++ samba-3.0.10/source/sam/idmap_tdb.c 2004-12-17 03:55:31.000000000 -0800
511 BOOL tdb_is_new = False;
513 /* use the old database if present */
514 - tdbfile = SMB_STRDUP(lock_path("winbindd_idmap.tdb"));
515 + tdbfile = SMB_STRDUP(state_path("winbindd_idmap.tdb"));
517 DEBUG(0, ("idmap_init: out of memory!\n"));
518 return NT_STATUS_NO_MEMORY;
519 diff -uNr samba-3.0.10.orig/source/smbd/lanman.c samba-3.0.10/source/smbd/lanman.c
520 --- samba-3.0.10.orig/source/smbd/lanman.c 2004-12-17 03:50:10.000000000 -0800
521 +++ samba-3.0.10/source/smbd/lanman.c 2004-12-17 03:55:31.000000000 -0800
523 BOOL local_list_only;
526 - lines = file_lines_load(lock_path(SERVER_LIST), NULL);
527 + lines = file_lines_load(cache_path(SERVER_LIST), NULL);
529 - DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
530 + DEBUG(4,("Can't open %s - %s\n",cache_path(SERVER_LIST),strerror(errno)));
534 diff -uNr samba-3.0.10.orig/source/utils/net_idmap.c samba-3.0.10/source/utils/net_idmap.c
535 --- samba-3.0.10.orig/source/utils/net_idmap.c 2004-12-17 03:50:10.000000000 -0800
536 +++ samba-3.0.10/source/utils/net_idmap.c 2004-12-17 03:55:32.000000000 -0800
538 return NT_STATUS_UNSUCCESSFUL;
541 - tdbfile = SMB_STRDUP(lock_path("winbindd_idmap.tdb"));
542 + tdbfile = SMB_STRDUP(state_path("winbindd_idmap.tdb"));
544 DEBUG(0, ("idmap_init: out of memory!\n"));
545 return NT_STATUS_NO_MEMORY;
546 diff -uNr samba-3.0.10.orig/source/wrepld/process.c samba-3.0.10/source/wrepld/process.c
547 --- samba-3.0.10.orig/source/wrepld/process.c 2004-12-17 03:50:10.000000000 -0800
548 +++ samba-3.0.10/source/wrepld/process.c 2004-12-17 03:55:32.000000000 -0800
553 - tdb = tdb_open_log(lock_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
554 + tdb = tdb_open_log(state_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
556 DEBUG(2,("get_our_last_id: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) ));
562 - tdb = tdb_open_log(lock_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
563 + tdb = tdb_open_log(state_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
565 DEBUG(2,("send_entry_request: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) ));
567 diff -uNr samba-3.0.11.orig/source/printing/nt_printing.c samba-3.0.11/source/printing/nt_printing.c
568 --- samba-3.0.11.orig/source/printing/nt_printing.c 2005-03-23 02:51:08.000000000 -0800
569 +++ samba-3.0.11/source/printing/nt_printing.c 2005-03-23 02:54:33.000000000 -0800
570 @@ -2065,7 +2065,7 @@
571 close_all_print_db();
573 if (geteuid() == 0) {
574 - pstrcpy(printdb_path, lock_path("printing/"));
575 + pstrcpy(printdb_path, cache_path("printing/"));
576 pstrcat(printdb_path, sharename);
577 pstrcat(printdb_path, ".tdb");