1 diff -uNr samba-2.2.5pre1.orig/source/Makefile.in samba-2.2.5pre1/source/Makefile.in
2 --- samba-2.2.5pre1.orig/source/Makefile.in Wed Jun 12 15:26:50 2002
3 +++ samba-2.2.5pre1/source/Makefile.in Wed Jun 12 15:30:29 2002
5 FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -DLOGFILEBASE=\"$(LOGFILEBASE)\"
6 FLAGS2 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
7 FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DSBINDIR=\"$(SBINDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\"
8 -FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DBINDIR=\"$(BINDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\"
9 +FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DBINDIR=\"$(BINDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\" -DVARDIR=\"$(VARDIR)\"
10 FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) -DHAVE_INCLUDES_H
11 FLAGS = $(ISA) $(FLAGS5) $(PASSWD_FLAGS)
12 FLAGS32 = $(ISA32) $(FLAGS5) $(PASSWD_FLAGS)
13 diff -uNr samba-2.2.5pre1.orig/source/acconfig.h samba-2.2.5pre1/source/acconfig.h
14 --- samba-2.2.5pre1.orig/source/acconfig.h Fri May 17 11:22:12 2002
15 +++ samba-2.2.5pre1/source/acconfig.h Wed Jun 12 15:30:29 2002
17 #undef HAVE_DEVICE_MAJOR_FN
18 #undef HAVE_DEVICE_MINOR_FN
19 #undef HAVE_MAKEDEV_FN
20 +#undef FHS_COMPATIBLE
21 #undef HAVE_GETGROUPS_TOO_MANY_EGIDS
22 #undef HAVE_PASSWD_PW_COMMENT
23 #undef HAVE_PASSWD_PW_AGE
24 diff -uNr samba-2.2.5pre1.orig/source/configure.in samba-2.2.5pre1/source/configure.in
25 --- samba-2.2.5pre1.orig/source/configure.in Wed Jun 12 15:28:30 2002
26 +++ samba-2.2.5pre1/source/configure.in Wed Jun 12 15:30:29 2002
28 [ --with-fhs Use FHS-compliant paths (default=no)],
29 codepagedir="\$(DATADIR)/samba/codepages"
30 configdir="${sysconfdir}/samba"
31 - lockdir="\${VARDIR}/cache/samba"
32 + lockdir="\${VARDIR}/run/samba"
33 piddir="\$(VARDIR)/run/samba"
34 logfilebase="\${VARDIR}/log/samba"
35 privatedir="\${CONFIGDIR}/private"
36 - swatdir="\${DATADIR}/samba/swat",
37 + swatdir="\${DATADIR}/samba/swat"
38 + AC_DEFINE(FHS_COMPATIBLE),
39 codepagedir="\$(LIBDIR)/codepages"
40 configdir="\$(LIBDIR)"
41 logfilebase="\$(VARDIR)"
42 diff -uNr samba-2.2.5pre1.orig/source/include/config.h.in samba-2.2.5pre1/source/include/config.h.in
43 --- samba-2.2.5pre1.orig/source/include/config.h.in Sat Jun 8 07:55:55 2002
44 +++ samba-2.2.5pre1/source/include/config.h.in Wed Jun 12 15:30:29 2002
46 #undef HAVE_DEVICE_MAJOR_FN
47 #undef HAVE_DEVICE_MINOR_FN
48 #undef HAVE_MAKEDEV_FN
49 +#undef FHS_COMPATIBLE
50 #undef HAVE_GETGROUPS_TOO_MANY_EGIDS
51 #undef HAVE_PASSWD_PW_COMMENT
52 #undef HAVE_PASSWD_PW_AGE
53 diff -uNr samba-2.2.5pre1.orig/source/include/local.h samba-2.2.5pre1/source/include/local.h
54 --- samba-2.2.5pre1.orig/source/include/local.h Tue Jan 15 10:02:37 2002
55 +++ samba-2.2.5pre1/source/include/local.h Wed Jun 12 15:30:29 2002
57 /* Max number of jobs per print queue. */
58 #define PRINT_MAX_JOBID 10000
60 +/* FHS-compatible directory defines */
61 +#ifdef FHS_COMPATIBLE
63 +#define CACHEDIR VARDIR "/cache/samba"
66 +#define STATEDIR VARDIR "/lib/samba"
71 +#define CACHEDIR lp_lockdir()
72 +#define STATEDIR lp_lockdir()
77 diff -uNr samba-2.2.5pre1.orig/source/lib/util.c samba-2.2.5pre1/source/lib/util.c
78 --- samba-2.2.5pre1.orig/source/lib/util.c Mon Jun 3 21:11:11 2002
79 +++ samba-2.2.5pre1/source/lib/util.c Wed Jun 12 15:30:29 2002
80 @@ -1862,6 +1862,46 @@
84 +/*****************************************************************
85 +a useful function for returning a path in the Samba state directory
86 + *****************************************************************/
87 +char *state_path(char *name)
89 + static pstring fname;
91 + pstrcpy(fname,STATEDIR);
92 + trim_string(fname,"","/");
94 + if (!directory_exist(fname,NULL)) {
99 + pstrcat(fname,name);
104 +/*****************************************************************
105 +a useful function for returning a path in the Samba cache directory
106 + *****************************************************************/
107 +char *cache_path(char *name)
109 + static pstring fname;
111 + pstrcpy(fname,CACHEDIR);
112 + trim_string(fname,"","/");
114 + if (!directory_exist(fname,NULL)) {
118 + pstrcat(fname,"/");
119 + pstrcat(fname,name);
124 /*******************************************************************
125 Given a filename - get its directory name
126 NB: Returned in static storage. Caveats:
127 diff -uNr samba-2.2.5pre1.orig/source/nmbd/nmbd_serverlistdb.c samba-2.2.5pre1/source/nmbd/nmbd_serverlistdb.c
128 --- samba-2.2.5pre1.orig/source/nmbd/nmbd_serverlistdb.c Mon Jan 21 10:35:19 2002
129 +++ samba-2.2.5pre1/source/nmbd/nmbd_serverlistdb.c Wed Jun 12 15:30:29 2002
134 - pstrcpy(fname,lp_lockdir());
135 + pstrcpy(fname,CACHEDIR);
136 trim_string(fname,NULL,"/");
138 pstrcat(fname,SERVER_LIST);
139 diff -uNr samba-2.2.5pre1.orig/source/nmbd/nmbd_winsserver.c samba-2.2.5pre1/source/nmbd/nmbd_winsserver.c
140 --- samba-2.2.5pre1.orig/source/nmbd/nmbd_winsserver.c Fri Mar 1 08:32:13 2002
141 +++ samba-2.2.5pre1/source/nmbd/nmbd_winsserver.c Wed Jun 12 15:30:29 2002
144 add_samba_names_to_subnet(wins_server_subnet);
146 - if((fp = sys_fopen(lock_path(WINS_LIST),"r")) == NULL)
147 + if((fp = sys_fopen(state_path(WINS_LIST),"r")) == NULL)
149 DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
150 WINS_LIST, strerror(errno) ));
151 diff -uNr samba-2.2.5pre1.orig/source/nsswitch/winbindd_cache.c samba-2.2.5pre1/source/nsswitch/winbindd_cache.c
152 --- samba-2.2.5pre1.orig/source/nsswitch/winbindd_cache.c Wed Jun 5 07:02:34 2002
153 +++ samba-2.2.5pre1/source/nsswitch/winbindd_cache.c Wed Jun 12 15:30:29 2002
156 if (opt_nocache) return;
158 - wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
159 + wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
160 TDB_DEFAULT, O_RDWR | O_CREAT | O_TRUNC, 0600);
163 diff -uNr samba-2.2.5pre1.orig/source/nsswitch/winbindd_idmap.c samba-2.2.5pre1/source/nsswitch/winbindd_idmap.c
164 --- samba-2.2.5pre1.orig/source/nsswitch/winbindd_idmap.c Wed May 1 11:56:29 2002
165 +++ samba-2.2.5pre1/source/nsswitch/winbindd_idmap.c Wed Jun 12 15:30:29 2002
166 @@ -427,14 +427,14 @@
170 - if (!(idmap_tdb = tdb_open_log(lock_path("winbindd_idmap.tdb"), 0,
171 + if (!(idmap_tdb = tdb_open_log(state_path("winbindd_idmap.tdb"), 0,
172 TDB_DEFAULT, O_RDWR | O_CREAT, 0600))) {
173 DEBUG(0, ("winbindd_idmap_init: Unable to open idmap database\n"));
177 /* possibly convert from an earlier version */
178 - if (!idmap_convert(lock_path("winbindd_idmap.tdb"))) {
179 + if (!idmap_convert(state_path("winbindd_idmap.tdb"))) {
180 DEBUG(0, ("winbindd_idmap_init: Unable to open idmap database\n"));
183 --- samba-2.2.5/source/param/loadparm.c.orig Tue Jun 18 21:13:45 2002
184 +++ samba-2.2.5/source/param/loadparm.c Tue Jun 18 23:24:14 2002
186 char *szAddPrinterCommand;
187 char *szDeletePrinterCommand;
188 char *szOs2DriverMap;
189 +#ifdef FHS_COMPATIBLE
190 + char *szLockDirStub;
195 @@ -1046,8 +1046,13 @@
196 {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
197 {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
198 {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
199 +#ifdef FHS_COMPATIBLE
200 + {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
201 + {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
203 {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0},
204 {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0},
206 {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, 0},
208 {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0},
209 diff -uNr samba-2.2.5pre1.orig/source/printing/nt_printing.c samba-2.2.5pre1/source/printing/nt_printing.c
210 --- samba-2.2.5pre1.orig/source/printing/nt_printing.c Thu Jun 6 08:15:02 2002
211 +++ samba-2.2.5pre1/source/printing/nt_printing.c Wed Jun 12 15:30:29 2002
212 @@ -262,24 +262,24 @@
213 if (tdb_drivers && tdb_printers && tdb_forms && local_pid == sys_getpid())
216 - tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
217 + tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
219 DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
220 - lock_path("ntdrivers.tdb"), strerror(errno) ));
221 + state_path("ntdrivers.tdb"), strerror(errno) ));
225 - tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
226 + tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
228 DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
229 - lock_path("ntprinters.tdb"), strerror(errno) ));
230 + state_path("ntprinters.tdb"), strerror(errno) ));
234 - tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
235 + tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
237 DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
238 - lock_path("ntforms.tdb"), strerror(errno) ));
239 + state_path("ntforms.tdb"), strerror(errno) ));
243 diff -uNr samba-2.2.5pre1.orig/source/printing/printing.c samba-2.2.5pre1/source/printing/printing.c
244 --- samba-2.2.5pre1.orig/source/printing/printing.c Fri Apr 19 14:05:01 2002
245 +++ samba-2.2.5pre1/source/printing/printing.c Wed Jun 12 15:30:30 2002
248 if (tdb && local_pid == sys_getpid())
250 - tdb = tdb_open_log(lock_path("printing.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
251 + tdb = tdb_open_log(cache_path("printing.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
253 DEBUG(0,("print_backend_init: Failed to open printing backend database %s.\n",
254 - lock_path("printing.tdb") ));
255 + cache_path("printing.tdb") ));
258 local_pid = sys_getpid();
259 diff -uNr samba-2.2.5pre1.orig/source/rpc_server/srv_srvsvc_nt.c samba-2.2.5pre1/source/rpc_server/srv_srvsvc_nt.c
260 --- samba-2.2.5pre1.orig/source/rpc_server/srv_srvsvc_nt.c Thu Jun 6 08:15:03 2002
261 +++ samba-2.2.5pre1/source/rpc_server/srv_srvsvc_nt.c Wed Jun 12 15:30:30 2002
262 @@ -127,10 +127,10 @@
264 if (share_tdb && local_pid == sys_getpid())
266 - share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
267 + share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
269 DEBUG(0,("Failed to open share info database %s (%s)\n",
270 - lock_path("share_info.tdb"), strerror(errno) ));
271 + state_path("share_info.tdb"), strerror(errno) ));
275 diff -uNr samba-2.2.5pre1.orig/source/smbd/lanman.c samba-2.2.5pre1/source/smbd/lanman.c
276 --- samba-2.2.5pre1.orig/source/smbd/lanman.c Mon Mar 18 17:55:49 2002
277 +++ samba-2.2.5pre1/source/smbd/lanman.c Wed Jun 12 15:30:30 2002
278 @@ -1109,9 +1109,9 @@
279 BOOL local_list_only;
282 - lines = file_lines_load(lock_path(SERVER_LIST), NULL, False);
283 + lines = file_lines_load(cache_path(SERVER_LIST), NULL, False);
285 - DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
286 + DEBUG(4,("Can't open %s - %s\n",cache_path(SERVER_LIST),strerror(errno)));
290 diff -ur samba-2.2.4+5pre1.orig/source/passdb/secrets.c samba-2.2.4+5pre1/source/passdb/secrets.c
291 --- samba-2.2.4+5pre1.orig/source/passdb/secrets.c Mon Mar 18 17:55:49 2002
292 +++ samba-2.2.4+5pre1/source/passdb/secrets.c Thu Jun 13 10:37:44 2002
297 - get_private_directory(fname);
298 - pstrcat(fname,"/secrets.tdb");
299 + pstrcpy(fname,state_path("secrets.tdb"));
301 tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);