[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-156-g779353b

Gerald (Jerry) Carter jerry at samba.org
Fri Nov 2 01:31:19 GMT 2007


The branch, v3-2-test has been updated
       via  779353b86d1699324149896f1ffa237c6ebe46ec (commit)
       via  d6cdbfd875bb2653e831d314726c3240beb0a96b (commit)
       via  b7d2fadbef044a89920da613b1aafc74a3d94e24 (commit)
      from  47dbddcb5361caa30ee60cf4e15bb50d557d1191 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 779353b86d1699324149896f1ffa237c6ebe46ec
Merge: d6cdbfd875bb2653e831d314726c3240beb0a96b 47dbddcb5361caa30ee60cf4e15bb50d557d1191
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Thu Nov 1 21:30:43 2007 -0400

    Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test

commit d6cdbfd875bb2653e831d314726c3240beb0a96b
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Thu Nov 1 15:53:44 2007 -0400

    Patch 2 of 3 from Debian Samba packagers:
    
    The point is doing the following associations:
    
    - non discardable state data (all TDB files that may need to be backed
      up) go to statedir
    - shared data (codepage stuff) go to codepagedir
    
    The patch *does not change* the default location for these
    directories. So, there is no behaviour change when applying it.
    
    The main change is for samba developers who have to think when dealing
    with files that previously pertained to libdir whether they:
    - go in statedir
    - go in codepagedir
    - stay in libdir

commit b7d2fadbef044a89920da613b1aafc74a3d94e24
Author: Gerald (Jerry) Carter <jerry at samba.org>
Date:   Thu Nov 1 13:00:10 2007 -0400

    Patch from Debian Samba package maintainers:
    
    Patch 1 of 3:
    
    - Patch 1 adds the new variables
    - Patch 2 makes uses of them for files belonging to the "state" path
      and the "code pages" path
      This patch seemed more easily acceptable, which explains why we
      separated it from patch 3
    - Patch 3 reassigns files to the "cache" path. Indeed all "debatable"
      changes have been moved to that one
    
    The point is adding:
    
    - a path for non discardable state data: basically all TDB files
      that may need to be backed up
    - a path for shared data: mostly codepage stuff
    - a path for cache data to host files such as
      browse.dat, printers.tbd, <printer>.tdb
    
    All these are currently mixed in "libdir" (${prefix}/lib/samba by default).
    The patch keeps these new paths to point to ${prefix}/lib/samba by default
    and does therefore not change the software behaviour.  Used alone, it just
    adds unused variables...so it can safely be used in sources without any
    behaviour change and no impact on Samba developers work.

-----------------------------------------------------------------------

Summary of changes:
 source/Makefile.in                   |   16 +++++++++++++---
 source/configure.in                  |    7 +++++++
 source/dynconfig.c                   |   31 +++++++++++++++++++++++++++++++
 source/groupdb/mapping_ldb.c         |    8 ++++----
 source/groupdb/mapping_tdb.c         |    2 +-
 source/include/dynconfig.h           |    4 ++++
 source/intl/lang_tdb.c               |    2 +-
 source/lib/account_pol.c             |    4 ++--
 source/lib/sharesec.c                |    4 ++--
 source/lib/util.c                    |   33 +++++++++++++++++++++++++++++++++
 source/lib/util_unistr.c             |    6 +++---
 source/nmbd/nmbd_winsserver.c        |    4 ++--
 source/param/loadparm.c              |    8 ++++----
 source/passdb/pdb_tdb.c              |    4 ++--
 source/printing/nt_printing.c        |   12 ++++++------
 source/registry/reg_db.c             |   10 +++++-----
 source/registry/reg_perfcount.c      |    4 ++--
 source/rpc_server/srv_eventlog_lib.c |    4 ++--
 source/winbindd/idmap_tdb.c          |    2 +-
 19 files changed, 125 insertions(+), 40 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/Makefile.in b/source/Makefile.in
index a1da65a..baa1828 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -127,6 +127,13 @@ SWATDIR = @swatdir@
 # the directory where lock files go
 LOCKDIR = @lockdir@
 
+# FHS directories; equal to LOCKDIR if not using --with-fhs
+CACHEDIR = @cachedir@
+STATEDIR = @statedir@
+
+# Where to look for (and install) codepage databases.
+CODEPAGEDIR = @codepagedir@
+
 # the directory where pid files go
 PIDDIR = @piddir@
 
@@ -154,7 +161,10 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
 	-DLOGFILEBASE=\"$(LOGFILEBASE)\" \
 	-DSHLIBEXT=\"@SHLIBEXT@\" \
 	-DCTDBDIR=\"$(CTDBDIR)\" \
-	-DCONFIGDIR=\"$(CONFIGDIR)\"
+	-DCONFIGDIR=\"$(CONFIGDIR)\" \
+	-DCODEPAGEDIR=\"$(CODEPAGEDIR)\" \
+	-DCACHEDIR=\"$(CACHEDIR)\" \
+	-DSTATEDIR=\"$(STATEDIR)\"
 
 # Note that all executable programs now provide for an optional executable suffix.
 
@@ -1761,10 +1771,10 @@ installscripts: installdirs
 	@$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS_BIN) $(DESTDIR)$(BINDIR) $(SCRIPTS)
 
 installdat: installdirs
-	@$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR) $(LIBDIR) $(srcdir)
+	@$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR) $(CODEPAGEDIR) $(srcdir)
 
 installmsg: installdirs
-	@$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR) $(LIBDIR) $(srcdir)
+	@$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR) $(CODEPAGEDIR) $(srcdir)
 
 installswat: installdirs installmsg
 	@$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR) $(SWATDIR) $(srcdir)
diff --git a/source/configure.in b/source/configure.in
index 9e1ebef..227ab40 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -65,6 +65,10 @@ AC_ARG_WITH(fhs,
     libdir="\${prefix}/lib/samba"
     configdir="\${sysconfdir}/samba"
     swatdir="\${DATADIR}/samba/swat"
+    codepagedir="\${prefix}/lib/samba"
+    statedir="\${VARDIR}/lib/samba"
+    cachedir="\${VARDIR}/lib/samba"
+    AC_DEFINE(FHS_COMPATIBLE, 1, [Whether to use fully FHS-compatible paths])
     ;;
   esac])
 
@@ -284,6 +288,9 @@ AC_SUBST(privatedir)
 AC_SUBST(swatdir)
 AC_SUBST(bindir)
 AC_SUBST(sbindir)
+AC_SUBST(codepagedir)
+AC_SUBST(statedir)
+AC_SUBST(cachedir)
 AC_SUBST(rootsbindir)
 AC_SUBST(pammodulesdir)
 
diff --git a/source/dynconfig.c b/source/dynconfig.c
index 6a40a07..01460b8 100644
--- a/source/dynconfig.c
+++ b/source/dynconfig.c
@@ -52,6 +52,13 @@ pstring dyn_LOGFILEBASE = LOGFILEBASE;
 pstring dyn_LMHOSTSFILE = LMHOSTSFILE;
 
 /**
+ * @brief Samba data directory.
+ *
+ * @sa data_path() to get the path to a file inside the CODEPAGEDIR.
+ **/
+pstring dyn_CODEPAGEDIR = CODEPAGEDIR;
+
+/**
  * @brief Samba library directory.
  *
  * @sa lib_path() to get the path to a file inside the LIBDIR.
@@ -69,3 +76,27 @@ pstring dyn_PIDDIR  = PIDDIR;
 
 pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE;
 pstring dyn_PRIVATE_DIR = PRIVATE_DIR;
+
+
+/* In non-FHS mode, these should be configurable using 'lock dir =';
+   but in FHS mode, they are their own directory.  Implement as wrapper
+   functions so that everything can still be kept in dynconfig.c.
+ */
+
+char *dyn_STATEDIR(void)
+{
+#ifdef FHS_COMPATIBLE
+	return STATEDIR;
+#else
+	return lp_lockdir();
+#endif
+}
+
+char *dyn_CACHEDIR(void)
+{
+#ifdef FHS_COMPATIBLE
+	return CACHEDIR;
+#else
+	return lp_lockdir();
+#endif
+}
diff --git a/source/groupdb/mapping_ldb.c b/source/groupdb/mapping_ldb.c
index c0b2e82..be1f159 100644
--- a/source/groupdb/mapping_ldb.c
+++ b/source/groupdb/mapping_ldb.c
@@ -55,7 +55,7 @@ static bool init_group_mapping(void)
 	/* this is needed as Samba3 doesn't have this globally yet */
 	ldb_global_init();
 
-	db_path = lock_path("group_mapping.ldb");
+	db_path = state_path("group_mapping.ldb");
 
 	ldb = ldb_init(NULL);
 	if (ldb == NULL) goto failed;
@@ -89,9 +89,9 @@ static bool init_group_mapping(void)
 	}
 
 	/* possibly upgrade */
-	tdb_path = lock_path("group_mapping.tdb");
+	tdb_path = state_path("group_mapping.tdb");
 	if (file_exist(tdb_path, NULL) && !mapping_upgrade(tdb_path)) {
-		unlink(lock_path("group_mapping.ldb"));
+		unlink(state_path("group_mapping.ldb"));
 		goto failed;
 	}
 
@@ -638,7 +638,7 @@ static bool mapping_upgrade(const char *tdb_path)
 	}
 
 	pstrcpy(old_path, tdb_path);
-	pstrcpy(new_path, lock_path("group_mapping.tdb.upgraded"));
+	pstrcpy(new_path, state_path("group_mapping.tdb.upgraded"));
 
 	if (rename(old_path, new_path) != 0) {
 		DEBUG(0,("Failed to rename old group mapping database\n"));
diff --git a/source/groupdb/mapping_tdb.c b/source/groupdb/mapping_tdb.c
index 5bfe966..f0f875d 100644
--- a/source/groupdb/mapping_tdb.c
+++ b/source/groupdb/mapping_tdb.c
@@ -42,7 +42,7 @@ static bool init_group_mapping(void)
 	if (tdb)
 		return True;
 		
-	tdb = tdb_open_log(lock_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+	tdb = tdb_open_log(state_path("group_mapping.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
 	if (!tdb) {
 		DEBUG(0,("Failed to open group mapping database\n"));
 		return False;
diff --git a/source/include/dynconfig.h b/source/include/dynconfig.h
index 7091aa8..996cf61 100644
--- a/source/include/dynconfig.h
+++ b/source/include/dynconfig.h
@@ -30,8 +30,12 @@ extern char const *dyn_SBINDIR,
 extern pstring dyn_CONFIGFILE;
 extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
 extern pstring dyn_LIBDIR;
+extern pstring dyn_CODEPAGEDIR;
 extern fstring dyn_SHLIBEXT;
 extern pstring dyn_LOCKDIR;
 extern pstring dyn_PIDDIR;
 extern pstring dyn_SMB_PASSWD_FILE;
 extern pstring dyn_PRIVATE_DIR;
+
+char *dyn_STATEDIR(void);
+char *dyn_CACHEDIR(void);
diff --git a/source/intl/lang_tdb.c b/source/intl/lang_tdb.c
index e2e7083..bb780c5 100644
--- a/source/intl/lang_tdb.c
+++ b/source/intl/lang_tdb.c
@@ -127,7 +127,7 @@ bool lang_tdb_init(const char *lang)
 	if (!lang) 
 		return True;
 
-	asprintf(&msg_path, "%s.msg", lib_path((const char *)lang));
+	asprintf(&msg_path, "%s.msg", data_path((const char *)lang));
 	if (stat(msg_path, &st) != 0) {
 		/* the msg file isn't available */
 		DEBUG(10, ("lang_tdb_init: %s: %s\n", msg_path, 
diff --git a/source/lib/account_pol.c b/source/lib/account_pol.c
index 96a471c..2540b49 100644
--- a/source/lib/account_pol.c
+++ b/source/lib/account_pol.c
@@ -212,9 +212,9 @@ bool init_account_policy(void)
 		return True;
 	}
 
-	tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
+	tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR, 0600);
 	if (!tdb) { /* the account policies files does not exist or open failed, try to create a new one */
-		tdb = tdb_open_log(lock_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+		tdb = tdb_open_log(state_path("account_policy.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
 		if (!tdb) {
 			DEBUG(0,("Failed to open account policy database\n"));
 			return False;
diff --git a/source/lib/sharesec.c b/source/lib/sharesec.c
index 244a6d7..e2320b2 100644
--- a/source/lib/sharesec.c
+++ b/source/lib/sharesec.c
@@ -46,10 +46,10 @@ bool share_info_db_init(void)
 		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 --git a/source/lib/util.c b/source/lib/util.c
index 53200ad..c8f0c31 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -2435,6 +2435,39 @@ char *lib_path(const char *name)
 }
 
 /**
+ * @brief Returns an absolute path to a file in the Samba data directory.
+ *
+ * @param name File to find, relative to CODEPAGEDIR.
+ *
+ * @retval Pointer to a talloc'ed string containing the full path.
+ **/
+
+char *data_path(const char *name)
+{
+	return talloc_asprintf(talloc_tos(), "%s/%s", dyn_CODEPAGEDIR, name);
+}
+
+/*****************************************************************
+a useful function for returning a path in the Samba state directory
+ *****************************************************************/
+char *state_path(char *name)
+{
+	pstring fname;
+
+	pstrcpy(fname,dyn_STATEDIR());
+	trim_string(fname,"","/");
+
+	if (!directory_exist(fname,NULL)) {
+		mkdir(fname,0755);
+	}
+
+	pstrcat(fname,"/");
+	pstrcat(fname,name);
+
+	return talloc_strdup(talloc_tos(), fname);
+}
+
+/**
  * @brief Returns the platform specific shared library extension.
  *
  * @retval Pointer to a static #fstring containing the extension.
diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c
index 2b91ea9..e9e2c33 100644
--- a/source/lib/util_unistr.c
+++ b/source/lib/util_unistr.c
@@ -87,11 +87,11 @@ void load_case_tables(void)
 	}
 	initialised = 1;
 
-	upcase_table = (smb_ucs2_t *)map_file(lib_path("upcase.dat"),
+	upcase_table = (smb_ucs2_t *)map_file(data_path("upcase.dat"),
 					      0x20000);
 	upcase_table_use_unmap = ( upcase_table != NULL );
 
-	lowcase_table = (smb_ucs2_t *)map_file(lib_path("lowcase.dat"),
+	lowcase_table = (smb_ucs2_t *)map_file(data_path("lowcase.dat"),
 					       0x20000);
 	lowcase_table_use_unmap = ( lowcase_table != NULL );
 
@@ -229,7 +229,7 @@ void init_valid_table(void)
 		return;
 	}
 
-	valid_file = (uint8 *)map_file(lib_path("valid.dat"), 0x10000);
+	valid_file = (uint8 *)map_file(data_path("valid.dat"), 0x10000);
 	if (valid_file) {
 		valid_table = valid_file;
 		mapped_file = 1;
diff --git a/source/nmbd/nmbd_winsserver.c b/source/nmbd/nmbd_winsserver.c
index 70303af..736bbf4 100644
--- a/source/nmbd/nmbd_winsserver.c
+++ b/source/nmbd/nmbd_winsserver.c
@@ -584,7 +584,7 @@ bool initialise_wins(void)
 
 	add_samba_names_to_subnet(wins_server_subnet);
 
-	if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL) {
+	if((fp = x_fopen(state_path(WINS_LIST),O_RDONLY,0)) == NULL) {
 		DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
 			WINS_LIST, strerror(errno) ));
 		return True;
@@ -2337,7 +2337,7 @@ void wins_write_database(time_t t, bool background)
 		}
 	}
 
-	slprintf(fname,sizeof(fname)-1,"%s/%s", lp_lockdir(), WINS_LIST);
+	slprintf(fname,sizeof(fname)-1,"%s/%s", dyn_STATEDIR(), WINS_LIST);
 	all_string_sub(fname,"//", "/", 0);
 	slprintf(fnamenew,sizeof(fnamenew)-1,"%s.%u", fname, (unsigned int)sys_getpid());
 
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index 163f417..19af6aa 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -1696,7 +1696,7 @@ static void init_globals(bool first_time_only)
 	Globals.bASUSupport       = False;
 	
 	/* User defined shares. */
-	pstrcpy(s, dyn_LOCKDIR);
+	pstrcpy(s, dyn_STATEDIR());
 	pstrcat(s, "/usershares");
 	string_set(&Globals.szUsersharePath, s);
 	string_set(&Globals.szUsershareTemplateShare, "");
@@ -3341,12 +3341,12 @@ static struct tdb_wrap *lp_regdb_open(void)
 	uint32 vers_id;
 
 	become_root();
-	reg_tdb = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, 
+	reg_tdb = tdb_wrap_open(NULL, state_path("registry.tdb"), 0, 
 				REG_TDB_FLAGS, O_RDWR, 0600);
 	unbecome_root();
 	if (!reg_tdb) {
 		DEBUG(1, ("lp_regdb_open: failed to open %s: %s\n",
-			 lock_path("registry.tdb"), strerror(errno)));
+			 state_path("registry.tdb"), strerror(errno)));
 		goto done;
 	}
 	else {
@@ -3357,7 +3357,7 @@ static struct tdb_wrap *lp_regdb_open(void)
 	if (vers_id != REGVER_V1) {
 		DEBUG(10, ("lp_regdb_open: INFO: registry tdb %s has wrong "
 			  "INFO/version (got %d, expected %d)\n",
-			  lock_path("registry.tdb"), vers_id, REGVER_V1));
+			  state_path("registry.tdb"), vers_id, REGVER_V1));
 		/* this is apparently not implemented in the tdb */
 	}
 
diff --git a/source/passdb/pdb_tdb.c b/source/passdb/pdb_tdb.c
index 530660f..79427a5 100644
--- a/source/passdb/pdb_tdb.c
+++ b/source/passdb/pdb_tdb.c
@@ -1542,7 +1542,7 @@ static bool tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid)
 	uint32 rid;
 	bool ret = False;
 
-	tdb = tdb_open_log(lock_path("winbindd_idmap.tdb"), 0,
+	tdb = tdb_open_log(state_path("winbindd_idmap.tdb"), 0,
 			   TDB_DEFAULT, O_RDWR | O_CREAT, 0644);
 
 	if (tdb == NULL) {
@@ -1606,7 +1606,7 @@ static NTSTATUS pdb_init_tdbsam(struct pdb_methods **pdb_method, const char *loc
 	/* save the path for later */
 			   
 	if ( !location ) {
-		pstr_sprintf( tdbfile, "%s/%s", lp_private_dir(), PASSDB_FILE_NAME );
+		pstr_sprintf( tdbfile, "%s/%s", dyn_STATEDIR(), PASSDB_FILE_NAME );
 		pfile = tdbfile;
 	}
 	pstrcpy( tdbsam_filename, pfile );
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 5276c2d..36add6f 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -552,28 +552,28 @@ bool nt_printing_init(struct messaging_context *msg_ctx)
  
 	if (tdb_drivers)
 		tdb_close(tdb_drivers);
-	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;
 	}
  
 	if (tdb_printers)
 		tdb_close(tdb_printers);
-	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;
 	}
  
 	if (tdb_forms)
 		tdb_close(tdb_forms);
-	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 --git a/source/registry/reg_db.c b/source/registry/reg_db.c
index 9933012..8dd61fc 100644
--- a/source/registry/reg_db.c
+++ b/source/registry/reg_db.c
@@ -230,12 +230,12 @@ bool regdb_init( void )
 	if ( tdb_reg )
 		return True;
 
-	if ( !(tdb_reg = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600)) )
+	if ( !(tdb_reg = tdb_wrap_open(NULL, state_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600)) )
 	{
-		tdb_reg = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR|O_CREAT, 0600);
+		tdb_reg = tdb_wrap_open(NULL, state_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR|O_CREAT, 0600);
 		if ( !tdb_reg ) {
 			DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
-				lock_path("registry.tdb"), strerror(errno) ));
+				state_path("registry.tdb"), strerror(errno) ));
 			return False;
 		}
 		
@@ -278,11 +278,11 @@ WERROR regdb_open( void )
 	
 	become_root();
 
-	tdb_reg = tdb_wrap_open(NULL, lock_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600);
+	tdb_reg = tdb_wrap_open(NULL, state_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600);
 	if ( !tdb_reg ) {
 		result = ntstatus_to_werror( map_nt_error_from_unix( errno ) );
 		DEBUG(0,("regdb_open: Failed to open %s! (%s)\n", 
-			lock_path("registry.tdb"), strerror(errno) ));
+			state_path("registry.tdb"), strerror(errno) ));
 	}
 
 	unbecome_root();
diff --git a/source/registry/reg_perfcount.c b/source/registry/reg_perfcount.c
index 44b5a5e..1fd9b36 100644
--- a/source/registry/reg_perfcount.c
+++ b/source/registry/reg_perfcount.c
@@ -45,7 +45,7 @@ static char* counters_directory( const char *dbname )
 	
 	fstr_sprintf( path, "%s/%s", PERFCOUNTDIR, dbname );
 	
-	pstrcpy( fname, lock_path( path ) );
+	pstrcpy( fname, state_path( path ) );
 	
 	return talloc_strdup(talloc_tos(), fname);
 }
@@ -55,7 +55,7 @@ static char* counters_directory( const char *dbname )
 
 void perfcount_init_keys( void )
 {
-	char *p = lock_path(PERFCOUNTDIR);
+	char *p = state_path(PERFCOUNTDIR);
 
 	/* no registry keys; just create the perfmon directory */
 	
diff --git a/source/rpc_server/srv_eventlog_lib.c b/source/rpc_server/srv_eventlog_lib.c
index 3f06f0f..00afe5b 100644
--- a/source/rpc_server/srv_eventlog_lib.c
+++ b/source/rpc_server/srv_eventlog_lib.c
@@ -66,7 +66,7 @@ char *elog_tdbname( const char *name )
 {
 	fstring path;
 	char *tdb_fullpath;
-	char *eventlogdir = lock_path( "eventlog" );
+	char *eventlogdir = state_path( "eventlog" );
 	
 	pstr_sprintf( path, "%s/%s.tdb", eventlogdir, name );
 	strlower_m( path );
@@ -348,7 +348,7 @@ ELOG_TDB *elog_open_tdb( char *logname, bool force_clear )
 	
 	/* make sure that the eventlog dir exists */
 	
-	eventlogdir = lock_path( "eventlog" );
+	eventlogdir = state_path( "eventlog" );
 	if ( !directory_exist( eventlogdir, NULL ) )
 		mkdir( eventlogdir, 0755 );	
 	
diff --git a/source/winbindd/idmap_tdb.c b/source/winbindd/idmap_tdb.c
index 881377b..1ec7085 100644
--- a/source/winbindd/idmap_tdb.c
+++ b/source/winbindd/idmap_tdb.c
@@ -221,7 +221,7 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx, TDB_CONTEXT **tdbctx)
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list