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])
62 AC_SUBST(pammodulesdir)
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 pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
89 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
122 - tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
123 + tdb = tdb_open_log(state_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
125 DEBUG(0,("Failed to open group mapping database\n"));
127 diff -uNr samba-3.0.10.orig/source/include/dynconfig.h samba-3.0.10/source/include/dynconfig.h
128 --- samba-3.0.10.orig/source/include/dynconfig.h 2004-12-17 03:50:08.000000000 -0800
129 +++ samba-3.0.10/source/include/dynconfig.h 2004-12-17 03:55:29.000000000 -0800
131 extern pstring dyn_CONFIGFILE;
132 extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
133 extern pstring dyn_LIBDIR;
134 +extern pstring dyn_CODEPAGEDIR;
135 extern fstring dyn_SHLIBEXT;
136 extern pstring dyn_LOCKDIR;
137 extern pstring dyn_PIDDIR;
138 extern pstring dyn_SMB_PASSWD_FILE;
139 extern pstring dyn_PRIVATE_DIR;
141 +char *dyn_STATEDIR(void);
142 +char *dyn_CACHEDIR(void);
143 diff -uNr samba-3.0.10.orig/source/intl/lang_tdb.c samba-3.0.10/source/intl/lang_tdb.c
144 --- samba-3.0.10.orig/source/intl/lang_tdb.c 2004-12-17 03:50:08.000000000 -0800
145 +++ samba-3.0.10/source/intl/lang_tdb.c 2004-12-17 03:55:29.000000000 -0800
150 - asprintf(&msg_path, "%s.msg", lib_path((const char *)lang));
151 + asprintf(&msg_path, "%s.msg", data_path((const char *)lang));
152 if (stat(msg_path, &st) != 0) {
153 /* the msg file isn't available */
154 DEBUG(10, ("lang_tdb_init: %s: %s\n", msg_path,
155 diff -uNr samba-3.0.21.orig/source/lib/account_pol.c samba-3.0.21/source/lib/account_pol.c
156 --- samba-3.0.21.orig/source/lib/account_pol.c 2005-12-20 15:28:38.000000000 +0000
157 +++ samba-3.0.21/source/lib/account_pol.c 2005-12-23 11:41:08.000000000 +0000
162 - tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
163 + tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
165 DEBUG(0,("Failed to open account policy database\n"));
167 diff -uNr samba-3.0.10.orig/source/lib/util.c samba-3.0.10/source/lib/util.c
168 --- samba-3.0.10.orig/source/lib/util.c 2004-12-17 03:50:08.000000000 -0800
169 +++ samba-3.0.10/source/lib/util.c 2004-12-17 03:55:29.000000000 -0800
170 @@ -2362,6 +2362,61 @@
174 + * @brief Returns an absolute path to a file in the Samba data directory.
176 + * @param name File to find, relative to CODEPAGEDIR.
178 + * @retval Pointer to a static #pstring containing the full path.
181 +char *data_path(const char *name)
183 + static pstring fname;
184 + snprintf(fname, sizeof(fname), "%s/%s", dyn_CODEPAGEDIR, name);
188 +/*****************************************************************
189 +a useful function for returning a path in the Samba state directory
190 + *****************************************************************/
191 +char *state_path(char *name)
193 + static pstring fname;
195 + pstrcpy(fname,dyn_STATEDIR());
196 + trim_string(fname,"","/");
198 + if (!directory_exist(fname,NULL)) {
202 + pstrcat(fname,"/");
203 + pstrcat(fname,name);
208 +/*****************************************************************
209 +a useful function for returning a path in the Samba cache directory
210 + *****************************************************************/
211 +char *cache_path(char *name)
213 + static pstring fname;
215 + pstrcpy(fname,dyn_CACHEDIR());
216 + trim_string(fname,"","/");
218 + if (!directory_exist(fname,NULL)) {
222 + pstrcat(fname,"/");
223 + pstrcat(fname,name);
229 * @brief Returns the platform specific shared library extension.
231 * @retval Pointer to a static #fstring containing the extension.
232 diff -uNr samba-3.0.10.orig/source/lib/util_unistr.c samba-3.0.10/source/lib/util_unistr.c
233 --- samba-3.0.10.orig/source/lib/util_unistr.c 2004-12-17 03:50:08.000000000 -0800
234 +++ samba-3.0.10/source/lib/util_unistr.c 2004-12-17 03:55:29.000000000 -0800
239 - upcase_table = map_file(lib_path("upcase.dat"), 0x20000);
240 + upcase_table = map_file(data_path("upcase.dat"), 0x20000);
241 upcase_table_use_unmap = ( upcase_table != NULL );
243 - lowcase_table = map_file(lib_path("lowcase.dat"), 0x20000);
244 + lowcase_table = map_file(data_path("lowcase.dat"), 0x20000);
245 lowcase_table_use_unmap = ( lowcase_table != NULL );
247 #ifdef HAVE_SETLOCALE
248 /* Get the name of the current locale. */
253 - valid_file = map_file(lib_path("valid.dat"), 0x10000);
254 + valid_file = map_file(data_path("valid.dat"), 0x10000);
256 valid_table = valid_file;
258 diff -uNr samba-3.0.10.orig/source/libsmb/samlogon_cache.c samba-3.0.10/source/libsmb/samlogon_cache.c
259 --- samba-3.0.10.orig/source/libsmb/samlogon_cache.c 2004-12-17 03:50:08.000000000 -0800
260 +++ samba-3.0.10/source/libsmb/samlogon_cache.c 2004-12-17 03:55:29.000000000 -0800
262 BOOL netsamlogon_cache_init(void)
264 if (!netsamlogon_tdb) {
265 - netsamlogon_tdb = tdb_open_log(lock_path(NETSAMLOGON_TDB), 0,
266 + netsamlogon_tdb = tdb_open_log(cache_path(NETSAMLOGON_TDB), 0,
267 TDB_DEFAULT, O_RDWR | O_CREAT, 0600);
271 winbindd_cache.tdb open. Open the tdb if a NULL is passed. */
274 - tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
275 + tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
276 TDB_DEFAULT, O_RDWR, 0600);
278 DEBUG(5, ("netsamlogon_clear_cached_user: failed to open cache\n"));
279 diff -uNr samba-3.0.10.orig/source/nmbd/nmbd_serverlistdb.c samba-3.0.10/source/nmbd/nmbd_serverlistdb.c
280 --- samba-3.0.10.orig/source/nmbd/nmbd_serverlistdb.c 2004-12-17 03:50:09.000000000 -0800
281 +++ samba-3.0.10/source/nmbd/nmbd_serverlistdb.c 2004-12-17 03:55:29.000000000 -0800
286 - pstrcpy(fname,lp_lockdir());
287 + pstrcpy(fname,dyn_CACHEDIR());
288 trim_char(fname,'\0' ,'/');
290 pstrcat(fname,SERVER_LIST);
291 diff -uNr samba-3.0.10.orig/source/nmbd/nmbd_winsserver.c samba-3.0.10/source/nmbd/nmbd_winsserver.c
292 --- samba-3.0.10.orig/source/nmbd/nmbd_winsserver.c 2004-12-17 03:50:09.000000000 -0800
293 +++ samba-3.0.10/source/nmbd/nmbd_winsserver.c 2004-12-17 03:55:30.000000000 -0800
296 add_samba_names_to_subnet(wins_server_subnet);
298 - if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL) {
299 + if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL) {
300 DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
301 WINS_LIST, strerror(errno) ));
303 @@ -1810,7 +1810,7 @@
307 - slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST);
308 + slprintf(fname,sizeof(fname)-1,"%s/%s", dyn_STATEDIR(), WINS_LIST);
309 all_string_sub(fname,"//", "/", 0);
310 slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid());
312 diff -uNr samba-3.0.23.orig/source/nsswitch/winbindd_cache.c samba-3.0.23/source/nsswitch/winbindd_cache.c
313 --- samba-3.0.23.orig/source/nsswitch/winbindd_cache.c 2006-07-15 09:50:09.000000000 -0400
314 +++ samba-3.0.23/source/nsswitch/winbindd_cache.c 2006-07-15 09:55:30.000000000 -0400
318 /* when working offline we must not clear the cache on restart */
319 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"),
320 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"),
321 WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE,
322 TDB_DEFAULT /*TDB_CLEAR_IF_FIRST*/, O_RDWR|O_CREAT, 0600);
324 diff -uNr samba-3.0.10.orig/source/nsswitch/winbindd_util.c samba-3.0.10/source/nsswitch/winbindd_util.c
325 --- samba-3.0.10.orig/source/nsswitch/winbindd_util.c 2004-12-17 03:50:09.000000000 -0800
326 +++ samba-3.0.10/source/nsswitch/winbindd_util.c 2004-12-17 03:55:30.000000000 -0800
328 SMB_STRUCT_STAT stbuf;
329 TDB_CONTEXT *idmap_tdb;
331 - pstrcpy(idmap_name, lock_path("winbindd_idmap.tdb"));
332 + pstrcpy(idmap_name, state_path("winbindd_idmap.tdb"));
334 if (!file_exist(idmap_name, &stbuf)) {
335 /* nothing to convert return */
336 diff -uNr samba-3.0.10.orig/source/param/loadparm.c samba-3.0.10/source/param/loadparm.c
337 --- samba-3.0.10.orig/source/param/loadparm.c 2004-12-17 03:50:09.000000000 -0800
338 +++ samba-3.0.10/source/param/loadparm.c 2004-12-17 03:55:30.000000000 -0800
340 char *szAddPrinterCommand;
341 char *szDeletePrinterCommand;
342 char *szOs2DriverMap;
343 +#ifdef FHS_COMPATIBLE
344 + char *szLockDirStub;
349 @@ -1105,8 +1108,13 @@
350 {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
351 {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
352 {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
353 +#ifdef FHS_COMPATIBLE
354 + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
355 + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
357 {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED},
358 {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE},
360 {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED},
362 {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED},
363 diff -uNr samba-3.0.23.orig/source/passdb/pdb_tdb.c samba-3.0.23/source/passdb/pdb_tdb.c
364 --- samba-3.0.23.orig/source/passdb/pdb_tdb.c 2006-07-15 09:50:09.000000000 -0400
365 +++ samba-3.0.23/source/passdb/pdb_tdb.c 2006-07-15 09:55:30.000000000 -0400
366 @@ -1598,7 +1598,7 @@
367 /* save the path for later */
370 - pstr_sprintf( tdbfile, "%s/%s", lp_private_dir(), PASSDB_FILE_NAME );
371 + pstr_sprintf( tdbfile, "%s", state_path(PASSDB_FILE_NAME) );
374 pstrcpy( tdbsam_filename, pfile );
375 diff -uNr samba-3.0.10.orig/source/passdb/secrets.c samba-3.0.10/source/passdb/secrets.c
376 --- samba-3.0.10.orig/source/passdb/secrets.c 2004-12-17 03:50:09.000000000 -0800
377 +++ samba-3.0.10/source/passdb/secrets.c 2004-12-17 03:55:30.000000000 -0800
382 - pstrcpy(fname, lp_private_dir());
383 - pstrcat(fname,"/secrets.tdb");
384 + pstrcpy(fname, state_path("secrets.tdb"));
386 tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
388 diff -uNr samba-3.0.10.orig/source/printing/nt_printing.c samba-3.0.10/source/printing/nt_printing.c
389 --- samba-3.0.10.orig/source/printing/nt_printing.c 2004-12-17 03:50:09.000000000 -0800
390 +++ samba-3.0.10/source/printing/nt_printing.c 2004-12-17 03:55:31.000000000 -0800
391 @@ -298,28 +298,28 @@
394 tdb_close(tdb_drivers);
395 - tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
396 + tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
398 DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
399 - lock_path("ntdrivers.tdb"), strerror(errno) ));
400 + state_path("ntdrivers.tdb"), strerror(errno) ));
405 tdb_close(tdb_printers);
406 - tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
407 + tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
409 DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
410 - lock_path("ntprinters.tdb"), strerror(errno) ));
411 + state_path("ntprinters.tdb"), strerror(errno) ));
416 tdb_close(tdb_forms);
417 - tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
418 + tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
420 DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
421 - lock_path("ntforms.tdb"), strerror(errno) ));
422 + state_path("ntforms.tdb"), strerror(errno) ));
426 diff -uNr samba-3.0.10.orig/source/printing/printing.c samba-3.0.10/source/printing/printing.c
427 --- samba-3.0.10.orig/source/printing/printing.c 2004-12-17 03:50:09.000000000 -0800
428 +++ samba-3.0.10/source/printing/printing.c 2004-12-17 03:55:31.000000000 -0800
430 int services = lp_numservices();
433 - unlink(lock_path("printing.tdb"));
434 - pstrcpy(printing_path,lock_path("printing"));
435 + unlink(cache_path("printing.tdb"));
436 + pstrcpy(printing_path,cache_path("printing"));
437 mkdir(printing_path,0755);
439 /* handle a Samba upgrade */
440 diff -uNr samba-3.0.10.orig/source/printing/printing_db.c samba-3.0.10/source/printing/printing_db.c
441 --- samba-3.0.10.orig/source/printing/printing_db.c 2004-12-17 03:50:09.000000000 -0800
442 +++ samba-3.0.10/source/printing/printing_db.c 2004-12-17 03:55:31.000000000 -0800
444 DLIST_ADD(print_db_head, p);
447 - pstrcpy(printdb_path, lock_path("printing/"));
448 + pstrcpy(printdb_path, cache_path("printing/"));
449 pstrcat(printdb_path, printername);
450 pstrcat(printdb_path, ".tdb");
452 diff -uNr samba-3.0.21.orig/source/registry/reg_db.c samba-3.0.21/source/registry/reg_db.c
453 --- samba-3.0.21.orig/source/registry/reg_db.c 2005-10-18 02:45:06.000000000 +0000
454 +++ samba-3.0.21/source/registry/reg_db.c 2005-12-23 11:48:19.000000000 +0000
455 @@ -205,12 +205,12 @@
459 - if ( !(tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
460 + if ( !(tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
462 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
463 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
465 DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
466 - lock_path("registry.tdb"), strerror(errno) ));
467 + state_path("registry.tdb"), strerror(errno) ));
471 @@ -252,11 +252,11 @@
475 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
476 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
478 result = ntstatus_to_werror( map_nt_error_from_unix( errno ) );
479 DEBUG(0,("regdb_open: Failed to open %s! (%s)\n",
480 - lock_path("registry.tdb"), strerror(errno) ));
481 + state_path("registry.tdb"), strerror(errno) ));
485 diff -uNr samba-3.0.23.orig/source/lib/sharesec.c samba-3.0.23/source/lib/sharesec.c
486 --- samba-3.0.23.orig/source/lib/sharesec.c 2006-07-15 09:50:09.000000000 -0400
487 +++ samba-3.0.23/source/lib/sharesec.c 2006-07-15 09:55:31.000000000 -0400
492 - share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
493 + share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
495 DEBUG(0,("Failed to open share info database %s (%s)\n",
496 - lock_path("share_info.tdb"), strerror(errno) ));
497 + state_path("share_info.tdb"), strerror(errno) ));
501 diff -uNr samba-3.0.10.orig/source/sam/idmap_tdb.c samba-3.0.10/source/sam/idmap_tdb.c
502 --- samba-3.0.10.orig/source/sam/idmap_tdb.c 2004-12-17 03:50:09.000000000 -0800
503 +++ samba-3.0.10/source/sam/idmap_tdb.c 2004-12-17 03:55:31.000000000 -0800
505 BOOL tdb_is_new = False;
507 /* use the old database if present */
508 - tdbfile = SMB_STRDUP(lock_path("winbindd_idmap.tdb"));
509 + tdbfile = SMB_STRDUP(state_path("winbindd_idmap.tdb"));
511 DEBUG(0, ("idmap_init: out of memory!\n"));
512 return NT_STATUS_NO_MEMORY;
513 diff -uNr samba-3.0.23.orig/source/smbd/lanman.c samba-3.0.23/source/smbd/lanman.c
514 --- samba-3.0.23.orig/source/smbd/lanman.c 2006-07-15 09:50:10.000000000 -0400
515 +++ samba-3.0.23/source/smbd/lanman.c 2006-07-15 09:55:31.000000000 -0400
516 @@ -1052,9 +1052,9 @@
517 BOOL local_list_only;
520 - lines = file_lines_load(lock_path(SERVER_LIST), NULL, 0);
521 + lines = file_lines_load(cache_path(SERVER_LIST), NULL, 0);
523 - DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
524 + DEBUG(4,("Can't open %s - %s\n",cache_path(SERVER_LIST),strerror(errno)));
528 diff -uNr samba-3.0.10.orig/source/utils/net_idmap.c samba-3.0.10/source/utils/net_idmap.c
529 --- samba-3.0.10.orig/source/utils/net_idmap.c 2004-12-17 03:50:10.000000000 -0800
530 +++ samba-3.0.10/source/utils/net_idmap.c 2004-12-17 03:55:32.000000000 -0800
532 return NT_STATUS_UNSUCCESSFUL;
535 - tdbfile = SMB_STRDUP(lock_path("winbindd_idmap.tdb"));
536 + tdbfile = SMB_STRDUP(state_path("winbindd_idmap.tdb"));
538 DEBUG(0, ("idmap_init: out of memory!\n"));
539 return NT_STATUS_NO_MEMORY;
540 diff -uNr samba-3.0.11.orig/source/printing/nt_printing.c samba-3.0.11/source/printing/nt_printing.c
541 --- samba-3.0.11.orig/source/printing/nt_printing.c 2005-03-23 02:51:08.000000000 -0800
542 +++ samba-3.0.11/source/printing/nt_printing.c 2005-03-23 02:54:33.000000000 -0800
543 @@ -2065,7 +2065,7 @@
544 close_all_print_db();
546 if (geteuid() == 0) {
547 - pstrcpy(printdb_path, lock_path("printing/"));
548 + pstrcpy(printdb_path, cache_path("printing/"));
549 pstrcat(printdb_path, sharename);
550 pstrcat(printdb_path, ".tdb");