summaryrefslogtreecommitdiffstats
path: root/packaging/Debian/debian/patches/fhs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/Debian/debian/patches/fhs.patch')
-rw-r--r--packaging/Debian/debian/patches/fhs.patch303
1 files changed, 303 insertions, 0 deletions
diff --git a/packaging/Debian/debian/patches/fhs.patch b/packaging/Debian/debian/patches/fhs.patch
new file mode 100644
index 00000000000..bb28990a210
--- /dev/null
+++ b/packaging/Debian/debian/patches/fhs.patch
@@ -0,0 +1,303 @@
+diff -uNr samba-2.2.5pre1.orig/source/Makefile.in samba-2.2.5pre1/source/Makefile.in
+--- samba-2.2.5pre1.orig/source/Makefile.in Wed Jun 12 15:26:50 2002
++++ samba-2.2.5pre1/source/Makefile.in Wed Jun 12 15:30:29 2002
+@@ -83,7 +83,7 @@
+ FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper $(CPPFLAGS) -DLOGFILEBASE=\"$(LOGFILEBASE)\"
+ FLAGS2 = -DCONFIGFILE=\"$(CONFIGFILE)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\"
+ FLAGS3 = -DSWATDIR=\"$(SWATDIR)\" -DSBINDIR=\"$(SBINDIR)\" -DLOCKDIR=\"$(LOCKDIR)\" -DCODEPAGEDIR=\"$(CODEPAGEDIR)\"
+-FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DBINDIR=\"$(BINDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\"
++FLAGS4 = -DDRIVERFILE=\"$(DRIVERFILE)\" -DBINDIR=\"$(BINDIR)\" -DPIDDIR=\"$(PIDDIR)\" -DLIBDIR=\"$(LIBDIR)\" -DVARDIR=\"$(VARDIR)\"
+ FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4) -DHAVE_INCLUDES_H
+ FLAGS = $(ISA) $(FLAGS5) $(PASSWD_FLAGS)
+ FLAGS32 = $(ISA32) $(FLAGS5) $(PASSWD_FLAGS)
+diff -uNr samba-2.2.5pre1.orig/source/acconfig.h samba-2.2.5pre1/source/acconfig.h
+--- samba-2.2.5pre1.orig/source/acconfig.h Fri May 17 11:22:12 2002
++++ samba-2.2.5pre1/source/acconfig.h Wed Jun 12 15:30:29 2002
+@@ -177,6 +177,7 @@
+ #undef HAVE_DEVICE_MAJOR_FN
+ #undef HAVE_DEVICE_MINOR_FN
+ #undef HAVE_MAKEDEV_FN
++#undef FHS_COMPATIBLE
+ #undef HAVE_GETGROUPS_TOO_MANY_EGIDS
+ #undef HAVE_PASSWD_PW_COMMENT
+ #undef HAVE_PASSWD_PW_AGE
+diff -uNr samba-2.2.5pre1.orig/source/configure.in samba-2.2.5pre1/source/configure.in
+--- samba-2.2.5pre1.orig/source/configure.in Wed Jun 12 15:28:30 2002
++++ samba-2.2.5pre1/source/configure.in Wed Jun 12 15:30:29 2002
+@@ -12,11 +12,12 @@
+ [ --with-fhs Use FHS-compliant paths (default=no)],
+ codepagedir="\$(DATADIR)/samba/codepages"
+ configdir="${sysconfdir}/samba"
+- lockdir="\${VARDIR}/cache/samba"
++ lockdir="\${VARDIR}/run/samba"
+ piddir="\$(VARDIR)/run/samba"
+ logfilebase="\${VARDIR}/log/samba"
+ privatedir="\${CONFIGDIR}/private"
+- swatdir="\${DATADIR}/samba/swat",
++ swatdir="\${DATADIR}/samba/swat"
++ AC_DEFINE(FHS_COMPATIBLE),
+ codepagedir="\$(LIBDIR)/codepages"
+ configdir="\$(LIBDIR)"
+ logfilebase="\$(VARDIR)"
+diff -uNr samba-2.2.5pre1.orig/source/include/config.h.in samba-2.2.5pre1/source/include/config.h.in
+--- samba-2.2.5pre1.orig/source/include/config.h.in Sat Jun 8 07:55:55 2002
++++ samba-2.2.5pre1/source/include/config.h.in Wed Jun 12 15:30:29 2002
+@@ -243,6 +243,7 @@
+ #undef HAVE_DEVICE_MAJOR_FN
+ #undef HAVE_DEVICE_MINOR_FN
+ #undef HAVE_MAKEDEV_FN
++#undef FHS_COMPATIBLE
+ #undef HAVE_GETGROUPS_TOO_MANY_EGIDS
+ #undef HAVE_PASSWD_PW_COMMENT
+ #undef HAVE_PASSWD_PW_AGE
+diff -uNr samba-2.2.5pre1.orig/source/include/local.h samba-2.2.5pre1/source/include/local.h
+--- samba-2.2.5pre1.orig/source/include/local.h Tue Jan 15 10:02:37 2002
++++ samba-2.2.5pre1/source/include/local.h Wed Jun 12 15:30:29 2002
+@@ -189,4 +189,20 @@
+ /* Allocation roundup. */
+ #define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000
+
++/* FHS-compatible directory defines */
++#ifdef FHS_COMPATIBLE
++#ifndef CACHEDIR
++#define CACHEDIR VARDIR "/cache/samba"
++#endif
++#ifndef STATEDIR
++#define STATEDIR VARDIR "/lib/samba"
++#endif
++
++#else
++
++#define CACHEDIR lp_lockdir()
++#define STATEDIR lp_lockdir()
++
++#endif
++
+ #endif
+diff -uNr samba-2.2.5pre1.orig/source/lib/util.c samba-2.2.5pre1/source/lib/util.c
+--- samba-2.2.5pre1.orig/source/lib/util.c Mon Jun 3 21:11:11 2002
++++ samba-2.2.5pre1/source/lib/util.c Wed Jun 12 15:30:29 2002
+@@ -1860,6 +1860,46 @@
+ return fname;
+ }
+
++/*****************************************************************
++a useful function for returning a path in the Samba state directory
++ *****************************************************************/
++char *state_path(char *name)
++{
++ static pstring fname;
++
++ pstrcpy(fname,STATEDIR);
++ trim_string(fname,"","/");
++
++ if (!directory_exist(fname,NULL)) {
++ mkdir(fname,0755);
++ }
++
++ pstrcat(fname,"/");
++ pstrcat(fname,name);
++
++ return fname;
++}
++
++/*****************************************************************
++a useful function for returning a path in the Samba cache directory
++ *****************************************************************/
++char *cache_path(char *name)
++{
++ static pstring fname;
++
++ pstrcpy(fname,CACHEDIR);
++ trim_string(fname,"","/");
++
++ if (!directory_exist(fname,NULL)) {
++ mkdir(fname,0755);
++ }
++
++ pstrcat(fname,"/");
++ pstrcat(fname,name);
++
++ return fname;
++}
++
+ /*******************************************************************
+ Given a filename - get its directory name
+ NB: Returned in static storage. Caveats:
+diff -uNr samba-2.2.5pre1.orig/source/nmbd/nmbd_serverlistdb.c samba-2.2.5pre1/source/nmbd/nmbd_serverlistdb.c
+--- samba-2.2.5pre1.orig/source/nmbd/nmbd_serverlistdb.c Mon Jan 21 10:35:19 2002
++++ samba-2.2.5pre1/source/nmbd/nmbd_serverlistdb.c Wed Jun 12 15:30:29 2002
+@@ -348,7 +348,7 @@
+
+ updatecount++;
+
+- pstrcpy(fname,lp_lockdir());
++ pstrcpy(fname,CACHEDIR);
+ trim_string(fname,NULL,"/");
+ pstrcat(fname,"/");
+ pstrcat(fname,SERVER_LIST);
+diff -uNr samba-2.2.5pre1.orig/source/nmbd/nmbd_winsserver.c samba-2.2.5pre1/source/nmbd/nmbd_winsserver.c
+--- samba-2.2.5pre1.orig/source/nmbd/nmbd_winsserver.c Fri Mar 1 08:32:13 2002
++++ samba-2.2.5pre1/source/nmbd/nmbd_winsserver.c Wed Jun 12 15:30:29 2002
+@@ -178,7 +178,7 @@
+
+ add_samba_names_to_subnet(wins_server_subnet);
+
+- if((fp = sys_fopen(lock_path(WINS_LIST),"r")) == NULL)
++ if((fp = sys_fopen(state_path(WINS_LIST),"r")) == NULL)
+ {
+ DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
+ WINS_LIST, strerror(errno) ));
+diff -uNr samba-2.2.5pre1.orig/source/nsswitch/winbindd_cache.c samba-2.2.5pre1/source/nsswitch/winbindd_cache.c
+--- samba-2.2.5pre1.orig/source/nsswitch/winbindd_cache.c Wed Jun 5 07:02:34 2002
++++ samba-2.2.5pre1/source/nsswitch/winbindd_cache.c Wed Jun 12 15:30:29 2002
+@@ -50,7 +50,7 @@
+ }
+ if (opt_nocache) return;
+
+- wcache->tdb = tdb_open_log(lock_path("winbindd_cache.tdb"), 5000,
++ wcache->tdb = tdb_open_log(cache_path("winbindd_cache.tdb"), 5000,
+ TDB_DEFAULT, O_RDWR | O_CREAT | O_TRUNC, 0600);
+
+ if (!wcache->tdb) {
+diff -uNr samba-2.2.5pre1.orig/source/nsswitch/winbindd_idmap.c samba-2.2.5pre1/source/nsswitch/winbindd_idmap.c
+--- samba-2.2.5pre1.orig/source/nsswitch/winbindd_idmap.c Wed May 1 11:56:29 2002
++++ samba-2.2.5pre1/source/nsswitch/winbindd_idmap.c Wed Jun 12 15:30:29 2002
+@@ -427,14 +427,14 @@
+ {
+ /* Open tdb cache */
+
+- if (!(idmap_tdb = tdb_open_log(lock_path("winbindd_idmap.tdb"), 0,
++ if (!(idmap_tdb = tdb_open_log(state_path("winbindd_idmap.tdb"), 0,
+ TDB_DEFAULT, O_RDWR | O_CREAT, 0600))) {
+ DEBUG(0, ("winbindd_idmap_init: Unable to open idmap database\n"));
+ return False;
+ }
+
+ /* possibly convert from an earlier version */
+- if (!idmap_convert(lock_path("winbindd_idmap.tdb"))) {
++ if (!idmap_convert(state_path("winbindd_idmap.tdb"))) {
+ DEBUG(0, ("winbindd_idmap_init: Unable to open idmap database\n"));
+ return False;
+ }
+diff -uNr samba-2.2.5pre1.orig/source/param/loadparm.c samba-2.2.5pre1/source/param/loadparm.c
+--- samba-2.2.5pre1.orig/source/param/loadparm.c Thu May 30 23:13:00 2002
++++ samba-2.2.5pre1/source/param/loadparm.c Wed Jun 12 15:30:29 2002
+@@ -107,6 +107,9 @@
+ char *szAddPrinterCommand;
+ char *szDeletePrinterCommand;
+ char *szOs2DriverMap;
++#ifdef FHS_COMPATIBLE
++ char *szLockDirStub;
++#endif
+ char *szLockDir;
+ char *szPidDir;
+ char *szRootdir;
+@@ -1025,8 +1028,13 @@
+ {"config file", P_STRING, P_GLOBAL, &Globals.szConfigFile, NULL, NULL, FLAG_HIDE},
+ {"preload", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
+ {"auto services", P_STRING, P_GLOBAL, &Globals.szAutoServices, NULL, NULL, FLAG_DOS_STRING},
++#ifdef FHS_COMPATIBLE
++ {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
++ {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDirStub, NULL, NULL, 0},
++#else
+ {"lock dir", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0},
+ {"lock directory", P_STRING, P_GLOBAL, &Globals.szLockDir, NULL, NULL, 0},
++#endif
+ {"pid directory", P_STRING, P_GLOBAL, &Globals.szPidDir, NULL, NULL, 0},
+ #ifdef WITH_UTMP
+ {"utmp directory", P_STRING, P_GLOBAL, &Globals.szUtmpDir, NULL, NULL, 0},
+diff -uNr samba-2.2.5pre1.orig/source/printing/nt_printing.c samba-2.2.5pre1/source/printing/nt_printing.c
+--- samba-2.2.5pre1.orig/source/printing/nt_printing.c Thu Jun 6 08:15:02 2002
++++ samba-2.2.5pre1/source/printing/nt_printing.c Wed Jun 12 15:30:29 2002
+@@ -263,24 +263,24 @@
+ if (tdb_drivers && tdb_printers && tdb_forms && local_pid == sys_getpid())
+ return True;
+
+- tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_drivers = tdb_open_log(state_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb_drivers) {
+ DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n",
+- lock_path("ntdrivers.tdb"), strerror(errno) ));
++ state_path("ntdrivers.tdb"), strerror(errno) ));
+ return False;
+ }
+
+- tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_printers = tdb_open_log(state_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb_printers) {
+ DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n",
+- lock_path("ntprinters.tdb"), strerror(errno) ));
++ state_path("ntprinters.tdb"), strerror(errno) ));
+ return False;
+ }
+
+- tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb_forms = tdb_open_log(state_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb_forms) {
+ DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n",
+- lock_path("ntforms.tdb"), strerror(errno) ));
++ state_path("ntforms.tdb"), strerror(errno) ));
+ return False;
+ }
+
+diff -uNr samba-2.2.5pre1.orig/source/printing/printing.c samba-2.2.5pre1/source/printing/printing.c
+--- samba-2.2.5pre1.orig/source/printing/printing.c Fri Apr 19 14:05:01 2002
++++ samba-2.2.5pre1/source/printing/printing.c Wed Jun 12 15:30:30 2002
+@@ -55,10 +55,10 @@
+
+ if (tdb && local_pid == sys_getpid())
+ return True;
+- tdb = tdb_open_log(lock_path("printing.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ tdb = tdb_open_log(cache_path("printing.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!tdb) {
+ DEBUG(0,("print_backend_init: Failed to open printing backend database %s.\n",
+- lock_path("printing.tdb") ));
++ cache_path("printing.tdb") ));
+ return False;
+ }
+ local_pid = sys_getpid();
+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
+--- samba-2.2.5pre1.orig/source/rpc_server/srv_srvsvc_nt.c Thu Jun 6 08:15:03 2002
++++ samba-2.2.5pre1/source/rpc_server/srv_srvsvc_nt.c Wed Jun 12 15:30:30 2002
+@@ -127,10 +127,10 @@
+
+ if (share_tdb && local_pid == sys_getpid())
+ return True;
+- share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
++ share_tdb = tdb_open_log(state_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ if (!share_tdb) {
+ DEBUG(0,("Failed to open share info database %s (%s)\n",
+- lock_path("share_info.tdb"), strerror(errno) ));
++ state_path("share_info.tdb"), strerror(errno) ));
+ return False;
+ }
+
+diff -uNr samba-2.2.5pre1.orig/source/smbd/lanman.c samba-2.2.5pre1/source/smbd/lanman.c
+--- samba-2.2.5pre1.orig/source/smbd/lanman.c Mon Mar 18 17:55:49 2002
++++ samba-2.2.5pre1/source/smbd/lanman.c Wed Jun 12 15:30:30 2002
+@@ -1109,9 +1109,9 @@
+ BOOL local_list_only;
+ int i;
+
+- lines = file_lines_load(lock_path(SERVER_LIST), NULL, False);
++ lines = file_lines_load(cache_path(SERVER_LIST), NULL, False);
+ if (!lines) {
+- DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
++ DEBUG(4,("Can't open %s - %s\n",cache_path(SERVER_LIST),strerror(errno)));
+ return(0);
+ }
+
+diff -ur samba-2.2.4+5pre1.orig/source/passdb/secrets.c samba-2.2.4+5pre1/source/passdb/secrets.c
+--- samba-2.2.4+5pre1.orig/source/passdb/secrets.c Mon Mar 18 17:55:49 2002
++++ samba-2.2.4+5pre1/source/passdb/secrets.c Thu Jun 13 10:37:44 2002
+@@ -34,8 +34,7 @@
+ if (tdb)
+ return True;
+
+- get_private_directory(fname);
+- pstrcat(fname,"/secrets.tdb");
++ pstrcpy(fname,state_path("secrets.tdb"));
+
+ tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+