1 Index: samba-3.0.21c/source/Makefile.in
2 ===================================================================
3 --- samba-3.0.21c.orig/source/Makefile.in 2006-02-25 11:57:11.584360975 +0100
4 +++ samba-3.0.21c/source/Makefile.in 2006-02-25 11:58:15.760412374 +0100
6 # the directory where lock files go
9 +# FHS directories; equal to LOCKDIR if not using --with-fhs
10 +CACHEDIR = @cachedir@
11 +STATEDIR = @statedir@
13 +# Where to look for (and install) codepage databases.
14 +CODEPAGEDIR = @codepagedir@
16 # the directory where pid files go
20 PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
21 PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
22 -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
23 -PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
24 +PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\" -DCACHEDIR=\"$(CACHEDIR)\" -DSTATEDIR=\"$(STATEDIR)\"
25 PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)
27 # Note that all executable programs now provide for an optional executable suffix.
29 @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
31 installdat: installdirs
32 - @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
33 + @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(CODEPAGEDIR) $(srcdir)
35 installmsg: installdirs
36 @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir)
37 Index: samba-3.0.21c/source/configure.in
38 ===================================================================
39 --- samba-3.0.21c.orig/source/configure.in 2006-02-25 11:57:11.585360773 +0100
40 +++ samba-3.0.21c/source/configure.in 2006-02-25 11:58:15.771410155 +0100
42 [ --with-fhs Use FHS-compliant paths (default=no)],
45 - lockdir="\${VARDIR}/lib/samba"
46 + lockdir="\${VARDIR}/run/samba"
47 piddir="\${VARDIR}/run"
48 mandir="\${prefix}/share/man"
49 logfilebase="\${VARDIR}/log/samba"
51 libdir="\${prefix}/lib/samba"
52 configdir="${sysconfdir}/samba"
53 swatdir="\${DATADIR}/samba/swat"
54 + codepagedir="\${DATADIR}/samba"
55 + statedir="\${VARDIR}/lib/samba"
56 + cachedir="\${VARDIR}/cache/samba"
57 + AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
65 +AC_SUBST(codepagedir)
69 dnl Unique-to-Samba variables we'll be playing with.
71 Index: samba-3.0.21c/source/dynconfig.c
72 ===================================================================
73 --- samba-3.0.21c.orig/source/dynconfig.c 2006-02-25 11:57:11.586360572 +0100
74 +++ samba-3.0.21c/source/dynconfig.c 2006-02-25 11:58:15.772409953 +0100
76 pstring dyn_LMHOSTSFILE = LMHOSTSFILE;
79 + * @brief Samba data directory.
81 + * @sa data_path() to get the path to a file inside the CODEPAGEDIR.
83 +pstring dyn_CODEPAGEDIR = CODEPAGEDIR;
86 * @brief Samba library directory.
88 * @sa lib_path() to get the path to a file inside the LIBDIR.
91 const pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
92 const pstring dyn_PRIVATE_DIR = PRIVATE_DIR;
95 +/* In non-FHS mode, these should be configurable using 'lock dir =';
96 + but in FHS mode, they are their own directory. Implement as wrapper
97 + functions so that everything can still be kept in dynconfig.c.
100 +char *dyn_STATEDIR(void)
102 +#ifdef FHS_COMPATIBLE
105 + return lp_lockdir();
109 +char *dyn_CACHEDIR(void)
111 +#ifdef FHS_COMPATIBLE
114 + return lp_lockdir();
117 Index: samba-3.0.21c/source/groupdb/mapping.c
118 ===================================================================
119 --- samba-3.0.21c.orig/source/groupdb/mapping.c 2006-02-25 11:57:11.587360370 +0100
120 +++ samba-3.0.21c/source/groupdb/mapping.c 2006-02-25 11:58:15.776409146 +0100
125 - tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
126 + tdb = tdb_open_log(state_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
128 DEBUG(0,("Failed to open group mapping database\n"));
130 Index: samba-3.0.21c/source/include/dynconfig.h
131 ===================================================================
132 --- samba-3.0.21c.orig/source/include/dynconfig.h 2006-02-25 11:57:11.588360168 +0100
133 +++ samba-3.0.21c/source/include/dynconfig.h 2006-02-25 11:58:15.777408944 +0100
135 extern pstring dyn_CONFIGFILE;
136 extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
137 extern pstring dyn_LIBDIR;
138 +extern pstring dyn_CODEPAGEDIR;
139 extern const fstring dyn_SHLIBEXT;
140 extern const pstring dyn_LOCKDIR;
141 extern const pstring dyn_PIDDIR;
142 extern const pstring dyn_SMB_PASSWD_FILE;
143 extern const pstring dyn_PRIVATE_DIR;
145 +char *dyn_STATEDIR(void);
146 +char *dyn_CACHEDIR(void);
147 Index: samba-3.0.21c/source/intl/lang_tdb.c
148 ===================================================================
149 --- samba-3.0.21c.orig/source/intl/lang_tdb.c 2006-02-25 11:57:11.589359967 +0100
150 +++ samba-3.0.21c/source/intl/lang_tdb.c 2006-02-25 11:58:15.779408541 +0100
155 - asprintf(&msg_path, "%s.msg", lib_path((const char *)lang));
156 + asprintf(&msg_path, "%s.msg", data_path((const char *)lang));
157 if (stat(msg_path, &st) != 0) {
158 /* the msg file isn't available */
159 DEBUG(10, ("lang_tdb_init: %s: %s\n", msg_path,
160 Index: samba-3.0.21c/source/lib/util.c
161 ===================================================================
162 --- samba-3.0.21c.orig/source/lib/util.c 2006-02-25 11:57:11.590359765 +0100
163 +++ samba-3.0.21c/source/lib/util.c 2006-02-25 11:58:15.784407532 +0100
164 @@ -2410,6 +2410,61 @@
168 + * @brief Returns an absolute path to a file in the Samba data directory.
170 + * @param name File to find, relative to CODEPAGEDIR.
172 + * @retval Pointer to a static #pstring containing the full path.
175 +char *data_path(const char *name)
177 + static pstring fname;
178 + snprintf(fname, sizeof(fname), "%s/%s", dyn_CODEPAGEDIR, name);
182 +/*****************************************************************
183 +a useful function for returning a path in the Samba state directory
184 + *****************************************************************/
185 +char *state_path(char *name)
187 + static pstring fname;
189 + pstrcpy(fname,dyn_STATEDIR());
190 + trim_string(fname,"","/");
192 + if (!directory_exist(fname,NULL)) {
196 + pstrcat(fname,"/");
197 + pstrcat(fname,name);
202 +/*****************************************************************
203 +a useful function for returning a path in the Samba cache directory
204 + *****************************************************************/
205 +char *cache_path(char *name)
207 + static pstring fname;
209 + pstrcpy(fname,dyn_CACHEDIR());
210 + trim_string(fname,"","/");
212 + if (!directory_exist(fname,NULL)) {
216 + pstrcat(fname,"/");
217 + pstrcat(fname,name);
223 * @brief Returns the platform specific shared library extension.
225 * @retval Pointer to a static #fstring containing the extension.
226 Index: samba-3.0.21c/source/lib/util_unistr.c
227 ===================================================================
228 --- samba-3.0.21c.orig/source/lib/util_unistr.c 2006-02-25 11:57:11.591359563 +0100
229 +++ samba-3.0.21c/source/lib/util_unistr.c 2006-02-25 11:58:15.787406927 +0100
234 - upcase_table = map_file(lib_path("upcase.dat"), 0x20000);
235 - lowcase_table = map_file(lib_path("lowcase.dat"), 0x20000);
236 + upcase_table = map_file(data_path("upcase.dat"), 0x20000);
237 + lowcase_table = map_file(data_path("lowcase.dat"), 0x20000);
239 /* we would like Samba to limp along even if these tables are
245 - valid_file = map_file(lib_path("valid.dat"), 0x10000);
246 + valid_file = map_file(data_path("valid.dat"), 0x10000);
248 valid_table = valid_file;
250 Index: samba-3.0.21c/source/libsmb/samlogon_cache.c
251 ===================================================================
252 --- samba-3.0.21c.orig/source/libsmb/samlogon_cache.c 2006-02-25 11:57:11.593359160 +0100
253 +++ samba-3.0.21c/source/libsmb/samlogon_cache.c 2006-02-25 11:58:15.788406725 +0100
255 BOOL netsamlogon_cache_init(void)
257 if (!netsamlogon_tdb) {
258 - netsamlogon_tdb = tdb_open_log(lock_path(NETSAMLOGON_TDB), 0,
259 + netsamlogon_tdb = tdb_open_log(cache_path(NETSAMLOGON_TDB), 0,
260 TDB_DEFAULT, O_RDWR | O_CREAT, 0600);
264 winbindd_cache.tdb open. Open the tdb if a NULL is passed. */
267 - tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
268 + tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
269 TDB_DEFAULT, O_RDWR, 0600);
271 DEBUG(5, ("netsamlogon_clear_cached_user: failed to open cache\n"));
272 Index: samba-3.0.21c/source/nmbd/nmbd_serverlistdb.c
273 ===================================================================
274 --- samba-3.0.21c.orig/source/nmbd/nmbd_serverlistdb.c 2006-02-25 11:57:11.594358958 +0100
275 +++ samba-3.0.21c/source/nmbd/nmbd_serverlistdb.c 2006-02-25 11:58:15.790406322 +0100
280 - pstrcpy(fname,lp_lockdir());
281 + pstrcpy(fname,dyn_CACHEDIR());
282 trim_char(fname,'\0' ,'/');
284 pstrcat(fname,SERVER_LIST);
285 Index: samba-3.0.21c/source/nmbd/nmbd_winsserver.c
286 ===================================================================
287 --- samba-3.0.21c.orig/source/nmbd/nmbd_winsserver.c 2006-02-25 11:57:11.603357143 +0100
288 +++ samba-3.0.21c/source/nmbd/nmbd_winsserver.c 2006-02-25 11:58:15.795405313 +0100
291 add_samba_names_to_subnet(wins_server_subnet);
293 - if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL) {
294 + if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL) {
295 DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
296 WINS_LIST, strerror(errno) ));
298 @@ -1838,7 +1838,7 @@
302 - slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST);
303 + slprintf(fname,sizeof(fname)-1,"%s/%s", dyn_STATEDIR(), WINS_LIST);
304 all_string_sub(fname,"//", "/", 0);
305 slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid());
307 Index: samba-3.0.21c/source/passdb/login_cache.c
308 ===================================================================
309 --- samba-3.0.21c.orig/source/passdb/login_cache.c 2006-02-25 11:57:11.604356941 +0100
310 +++ samba-3.0.21c/source/passdb/login_cache.c 2006-02-25 11:58:15.797404910 +0100
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 Index: samba-3.0.21c/source/nsswitch/winbindd_cache.c
321 ===================================================================
322 --- samba-3.0.21c.orig/source/nsswitch/winbindd_cache.c 2006-02-25 11:57:11.606356537 +0100
323 +++ samba-3.0.21c/source/nsswitch/winbindd_cache.c 2006-02-25 11:58:15.800404304 +0100
328 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
329 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
330 TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0600);
333 @@ -1472,7 +1472,7 @@
334 if (wcache->tdb != NULL)
337 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
338 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
339 TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0600);
341 if (wcache->tdb == NULL) {
342 Index: samba-3.0.21c/source/nsswitch/winbindd_util.c
343 ===================================================================
344 --- samba-3.0.21c.orig/source/nsswitch/winbindd_util.c 2006-02-25 11:57:11.607356336 +0100
345 +++ samba-3.0.21c/source/nsswitch/winbindd_util.c 2006-02-25 11:58:15.803403699 +0100
346 @@ -1172,7 +1172,7 @@
347 SMB_STRUCT_STAT stbuf;
348 TDB_CONTEXT *idmap_tdb;
350 - pstrcpy(idmap_name, lock_path("winbindd_idmap.tdb"));
351 + pstrcpy(idmap_name, state_path("winbindd_idmap.tdb"));
353 if (!file_exist(idmap_name, &stbuf)) {
354 /* nothing to convert return */
355 Index: samba-3.0.21c/source/param/loadparm.c
356 ===================================================================
357 --- samba-3.0.21c.orig/source/param/loadparm.c 2006-02-25 11:57:11.608356134 +0100
358 +++ samba-3.0.21c/source/param/loadparm.c 2006-02-25 11:58:15.994365168 +0100
360 char *szAddPrinterCommand;
361 char *szDeletePrinterCommand;
362 char *szOs2DriverMap;
363 +#ifdef FHS_COMPATIBLE
364 + char *szLockDirStub;
369 @@ -1174,8 +1177,13 @@
370 {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
371 {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
372 {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_ADVANCED},
373 +#ifdef FHS_COMPATIBLE
374 + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
375 + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
377 {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_ADVANCED},
378 {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, FLAG_HIDE},
380 {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, FLAG_ADVANCED},
382 {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, FLAG_ADVANCED},
383 Index: samba-3.0.21c/source/passdb/pdb_tdb.c
384 ===================================================================
385 --- samba-3.0.21c.orig/source/passdb/pdb_tdb.c 2006-02-25 11:57:11.605356739 +0100
386 +++ samba-3.0.21c/source/passdb/pdb_tdb.c 2006-02-25 11:58:15.997364563 +0100
389 tdb_state->tdbsam_location = talloc_strdup(pdb_context->mem_ctx, location);
392 - get_private_directory(tdbfile);
393 - pstrcat(tdbfile, "/");
394 - pstrcat(tdbfile, PASSDB_FILE_NAME);
395 + char *tdbfile = state_path(PASSDB_FILE_NAME);
396 tdb_state->tdbsam_location = talloc_strdup(pdb_context->mem_ctx, tdbfile);
399 Index: samba-3.0.21c/source/passdb/secrets.c
400 ===================================================================
401 --- samba-3.0.21c.orig/source/passdb/secrets.c 2006-02-25 11:57:11.605356739 +0100
402 +++ samba-3.0.21c/source/passdb/secrets.c 2006-02-25 11:58:15.999364159 +0100
407 - pstrcpy(fname, lp_private_dir());
408 - pstrcat(fname,"/secrets.tdb");
409 + pstrcpy(fname, state_path("secrets.tdb"));
411 tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
413 Index: samba-3.0.21c/source/printing/nt_printing.c
414 ===================================================================
415 --- samba-3.0.21c.orig/source/printing/nt_printing.c 2006-02-25 11:57:11.609355932 +0100
416 +++ samba-3.0.21c/source/printing/nt_printing.c 2006-02-25 11:58:16.008362344 +0100
417 @@ -530,28 +530,28 @@
420 tdb_close(tdb_drivers);
421 - tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
422 + tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
424 DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
425 - lock_path("ntdrivers.tdb"), strerror(errno) ));
426 + state_path("ntdrivers.tdb"), strerror(errno) ));
431 tdb_close(tdb_printers);
432 - tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
433 + tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
435 DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
436 - lock_path("ntprinters.tdb"), strerror(errno) ));
437 + state_path("ntprinters.tdb"), strerror(errno) ));
442 tdb_close(tdb_forms);
443 - tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
444 + tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
446 DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
447 - lock_path("ntforms.tdb"), strerror(errno) ));
448 + state_path("ntforms.tdb"), strerror(errno) ));
452 @@ -2325,7 +2325,7 @@
453 close_all_print_db();
455 if (geteuid() == 0) {
456 - pstrcpy(printdb_path, lock_path("printing/"));
457 + pstrcpy(printdb_path, cache_path("printing/"));
458 pstrcat(printdb_path, sharename);
459 pstrcat(printdb_path, ".tdb");
461 Index: samba-3.0.21c/source/printing/printing.c
462 ===================================================================
463 --- samba-3.0.21c.orig/source/printing/printing.c 2006-02-25 11:57:11.627352301 +0100
464 +++ samba-3.0.21c/source/printing/printing.c 2006-02-25 11:58:16.013361335 +0100
466 int services = lp_numservices();
469 - unlink(lock_path("printing.tdb"));
470 - pstrcpy(printing_path,lock_path("printing"));
471 + unlink(cache_path("printing.tdb"));
472 + pstrcpy(printing_path,cache_path("printing"));
473 mkdir(printing_path,0755);
475 /* handle a Samba upgrade */
476 Index: samba-3.0.21c/source/printing/printing_db.c
477 ===================================================================
478 --- samba-3.0.21c.orig/source/printing/printing_db.c 2006-02-25 11:57:11.628352100 +0100
479 +++ samba-3.0.21c/source/printing/printing_db.c 2006-02-25 11:58:16.015360931 +0100
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 Index: samba-3.0.21c/source/rpc_server/srv_srvsvc_nt.c
490 ===================================================================
491 --- samba-3.0.21c.orig/source/rpc_server/srv_srvsvc_nt.c 2006-02-25 11:57:11.630351696 +0100
492 +++ samba-3.0.21c/source/rpc_server/srv_srvsvc_nt.c 2006-02-25 11:58:16.019360125 +0100
493 @@ -158,10 +158,10 @@
495 if (share_tdb && local_pid == sys_getpid())
497 - share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
498 + share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
500 DEBUG(0,("Failed to open share info database %s (%s)\n",
501 - lock_path("share_info.tdb"), strerror(errno) ));
502 + state_path("share_info.tdb"), strerror(errno) ));
506 Index: samba-3.0.21c/source/sam/idmap_tdb.c
507 ===================================================================
508 --- samba-3.0.21c.orig/source/sam/idmap_tdb.c 2006-02-25 11:57:11.631351494 +0100
509 +++ samba-3.0.21c/source/sam/idmap_tdb.c 2006-02-25 11:58:16.022359519 +0100
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 Index: samba-3.0.21c/source/smbd/lanman.c
520 ===================================================================
521 --- samba-3.0.21c.orig/source/smbd/lanman.c 2006-02-25 11:57:11.633351091 +0100
522 +++ samba-3.0.21c/source/smbd/lanman.c 2006-02-25 11:58:16.028358309 +0100
523 @@ -1040,9 +1040,9 @@
524 BOOL local_list_only;
527 - lines = file_lines_load(lock_path(SERVER_LIST), NULL);
528 + lines = file_lines_load(cache_path(SERVER_LIST), NULL);
530 - DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
531 + DEBUG(4,("Can't open %s - %s\n",cache_path(SERVER_LIST),strerror(errno)));
535 Index: samba-3.0.21c/source/utils/net_idmap.c
536 ===================================================================
537 --- samba-3.0.21c.orig/source/utils/net_idmap.c 2006-02-25 11:57:11.633351091 +0100
538 +++ samba-3.0.21c/source/utils/net_idmap.c 2006-02-25 11:58:16.071349634 +0100
540 return NT_STATUS_UNSUCCESSFUL;
543 - tdbfile = SMB_STRDUP(lock_path("winbindd_idmap.tdb"));
544 + tdbfile = SMB_STRDUP(state_path("winbindd_idmap.tdb"));
546 DEBUG(0, ("idmap_init: out of memory!\n"));
547 return NT_STATUS_NO_MEMORY;
548 Index: samba-3.0.21c/source/wrepld/process.c
549 ===================================================================
550 --- samba-3.0.21c.orig/source/wrepld/process.c 2006-02-25 11:57:11.634350889 +0100
551 +++ samba-3.0.21c/source/wrepld/process.c 2006-02-25 11:58:16.073349231 +0100
556 - tdb = tdb_open_log(lock_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
557 + tdb = tdb_open_log(state_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
559 DEBUG(2,("get_our_last_id: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) ));
565 - tdb = tdb_open_log(lock_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
566 + tdb = tdb_open_log(state_path(WINS_LIST), 0, TDB_DEFAULT, O_RDONLY, 0600);
568 DEBUG(2,("send_entry_request: Can't open wins database file %s. Error was %s\n", WINS_LIST, strerror(errno) ));
570 Index: samba-3.0.21c/source/registry/reg_db.c
571 ===================================================================
572 --- samba-3.0.21c.orig/source/registry/reg_db.c 2006-02-25 11:57:11.635350688 +0100
573 +++ samba-3.0.21c/source/registry/reg_db.c 2006-02-25 11:58:16.076348626 +0100
574 @@ -205,12 +205,12 @@
578 - if ( !(tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
579 + if ( !(tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600)) )
581 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
582 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
584 DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
585 - lock_path("registry.tdb"), strerror(errno) ));
586 + state_path("registry.tdb"), strerror(errno) ));
590 @@ -252,11 +252,11 @@
594 - tdb_reg = tdb_open_log(lock_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
595 + tdb_reg = tdb_open_log(state_path("registry.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
597 result = ntstatus_to_werror( map_nt_error_from_unix( errno ) );
598 DEBUG(0,("regdb_open: Failed to open %s! (%s)\n",
599 - lock_path("registry.tdb"), strerror(errno) ));
600 + state_path("registry.tdb"), strerror(errno) ));
604 Index: samba-3.0.21c/source/lib/account_pol.c
605 ===================================================================
606 --- samba-3.0.21c.orig/source/lib/account_pol.c 2006-02-25 11:57:11.592359361 +0100
607 +++ samba-3.0.21c/source/lib/account_pol.c 2006-02-25 11:58:16.078348222 +0100
612 - tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
613 + tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
615 DEBUG(0,("Failed to open account policy database\n"));
617 Index: samba-3.0.21c/source/registry/reg_perfcount.c
618 ===================================================================
619 --- samba-3.0.21c.orig/source/registry/reg_perfcount.c 2006-02-25 11:57:11.636350486 +0100
620 +++ samba-3.0.21c/source/registry/reg_perfcount.c 2006-02-25 11:58:16.081347617 +0100
623 fstr_sprintf( path, "%s/%s", PERFCOUNTDIR, dbname );
625 - pstrcpy( fname, lock_path( path ) );
626 + pstrcpy( fname, state_path( path ) );
632 void perfcount_init_keys( void )
634 - char *p = lock_path(PERFCOUNTDIR);
635 + char *p = state_path(PERFCOUNTDIR);
637 /* no registry keys; just create the perfmon directory */
639 Index: samba-3.0.21c/source/rpc_server/srv_eventlog_lib.c
640 ===================================================================
641 --- samba-3.0.21c.orig/source/rpc_server/srv_eventlog_lib.c 2006-02-25 11:57:11.630351696 +0100
642 +++ samba-3.0.21c/source/rpc_server/srv_eventlog_lib.c 2006-02-25 11:58:16.083347214 +0100
647 - char *eventlogdir = lock_path( "eventlog" );
648 + char *eventlogdir = state_path( "eventlog" );
650 pstr_sprintf( path, "%s/%s.tdb", eventlogdir, name );
654 /* make sure that the eventlog dir exists */
656 - eventlogdir = lock_path( "eventlog" );
657 + eventlogdir = state_path( "eventlog" );
658 if ( !directory_exist( eventlogdir, NULL ) )
659 mkdir( eventlogdir, 0755 );