+++ /dev/null
-Description: Prepare the sources to better respect FHS
- This patch was historically very long but most parts have
- been integrated upstream.
- .
- The last remaining bit is the location of "private files
- We historically have them in /var/lib/samba while upstream
- has them in /etc/samba
- .
- We need to provide a migraiton path and go back to the "normal"
- file layout
-Author: Eloy A. Paris <peloy@debian.org>
-Bug-Debian: http://bugs.debian.org/49011
-Forwarded: not-needed
-
-
-Index: samba/source3/passdb/pdb_tdb.c
-===================================================================
---- samba.orig/source3/passdb/pdb_tdb.c
-+++ samba/source3/passdb/pdb_tdb.c
-@@ -1260,7 +1260,7 @@
- /* save the path for later */
-
- if (!location) {
-- if (asprintf(&tdbfile, "%s/%s", lp_private_dir(),
-+ if (asprintf(&tdbfile, "%s/%s", lp_statedir(),
- PASSDB_FILE_NAME) < 0) {
- return NT_STATUS_NO_MEMORY;
- }
-Index: samba/source3/passdb/secrets.c
-===================================================================
---- samba.orig/source3/passdb/secrets.c
-+++ samba/source3/passdb/secrets.c
-@@ -64,7 +64,7 @@
- return True;
-
- fname = talloc_asprintf(talloc_tos(), "%s/secrets.tdb",
-- lp_private_dir());
-+ lp_statedir());
- if (fname == NULL) {
- return false;
- }
-Index: samba/docs/manpages/smb.conf.5
-===================================================================
---- samba.orig/docs/manpages/smb.conf.5
-+++ samba/docs/manpages/smb.conf.5
-@@ -7176,7 +7176,7 @@
- .\}
- tdbsam
- \- The TDB based password storage backend\&. Takes a path to the TDB as an optional argument (defaults to passdb\&.tdb in the
--\m[blue]\fBprivate dir\fR\m[]
-+\m[blue]\fBstate directory\fR\m[]
- directory\&.
- .RE
- .sp
-@@ -8047,9 +8047,7 @@
- .PP
- .RS 4
- This parameters defines the directory smbd will use for storing such files as
--smbpasswd
--and
--secrets\&.tdb\&.
-+smbpasswd\&. secrets\&.tdb is stored in state directory on Debian systems\&.
- .sp
- Default:
- \fI\fIprivate dir\fR\fR\fI = \fR\fI${prefix}/private\fR\fI \fR
---- a/libcli/auth/schannel_state_tdb.c
-+++ b/libcli/auth/schannel_state_tdb.c
-@@ -40,7 +40,7 @@
- const char *private_dir)
- {
- struct tdb_wrap *tdb_sc = NULL;
-- char *fname = talloc_asprintf(mem_ctx, "%s/schannel_store.tdb", private_dir);
-+ char *fname = talloc_asprintf(mem_ctx, "%s/schannel_store.tdb", get_dyn_STATEDIR());
-
- if (!fname) {
- return NULL;
---- a/source3/passdb/machine_sid.c
-+++ b/source3/passdb/machine_sid.c
-@@ -132,7 +132,7 @@
- }
-
- /* check for an old MACHINE.SID file for backwards compatibility */
-- if (asprintf(&fname, "%s/MACHINE.SID", lp_private_dir()) == -1) {
-+ if (asprintf(&fname, "%s/MACHINE.SID", lp_statedir()) == -1) {
- SAFE_FREE(sam_sid);
- return NULL;
- }
---- a/source3/utils/net_idmap.c
-+++ b/source3/utils/net_idmap.c
-@@ -75,7 +75,7 @@
- dbfile = lp_parm_talloc_string(-1, "tdb", "idmap2.tdb", NULL);
- if (dbfile == NULL) {
- dbfile = talloc_asprintf(talloc_tos(), "%s/idmap2.tdb",
-- lp_private_dir());
-+ lp_statedir());
- }
- if (dbfile == NULL) {
- d_fprintf(stderr, _("Out of memory!\n"));
---- a/source3/winbindd/idmap_tdb2.c
-+++ b/source3/winbindd/idmap_tdb2.c
-@@ -108,7 +108,7 @@
- return NT_STATUS_OK;
- }
-
-- db_path = talloc_asprintf(NULL, "%s/idmap2.tdb", lp_private_dir());
-+ db_path = talloc_asprintf(NULL, "%s/idmap2.tdb", lp_statedir());
- NT_STATUS_HAVE_NO_MEMORY(db_path);
-
- /* Open idmap repository */