diff options
-rw-r--r-- | source3/intl/lang_tdb.c | 2 | ||||
-rw-r--r-- | source3/lib/cleanupdb.c | 2 | ||||
-rw-r--r-- | source3/lib/g_lock.c | 2 | ||||
-rw-r--r-- | source3/lib/gencache.c | 2 | ||||
-rw-r--r-- | source3/lib/messages.c | 4 | ||||
-rw-r--r-- | source3/lib/server_mutex.c | 2 | ||||
-rw-r--r-- | source3/lib/util_path.c | 4 | ||||
-rw-r--r-- | source3/lib/util_path.h | 5 | ||||
-rw-r--r-- | source3/libads/kerberos.c | 4 | ||||
-rw-r--r-- | source3/locking/brlock.c | 2 | ||||
-rw-r--r-- | source3/locking/leases_db.c | 2 | ||||
-rw-r--r-- | source3/locking/share_mode_lock.c | 2 | ||||
-rw-r--r-- | source3/nmbd/nmbd_namelistdb.c | 2 | ||||
-rw-r--r-- | source3/printing/printer_list.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/fss/srv_fss_agent.c | 2 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_client.c | 2 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_open.c | 2 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_session.c | 2 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_tcon.c | 2 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_version.c | 2 | ||||
-rw-r--r-- | source3/utils/status.c | 2 |
21 files changed, 27 insertions, 24 deletions
diff --git a/source3/intl/lang_tdb.c b/source3/intl/lang_tdb.c index ecdfe1dc911..2e050fd96de 100644 --- a/source3/intl/lang_tdb.c +++ b/source3/intl/lang_tdb.c @@ -149,7 +149,7 @@ bool lang_tdb_init(const char *lang) goto done; } - lpath = lock_path("lang_"); + lpath = lock_path(talloc_tos(), "lang_"); if (lpath == NULL) { goto done; } diff --git a/source3/lib/cleanupdb.c b/source3/lib/cleanupdb.c index 3250d609d03..93d6acc9e44 100644 --- a/source3/lib/cleanupdb.c +++ b/source3/lib/cleanupdb.c @@ -38,7 +38,7 @@ static struct tdb_wrap *cleanup_db(void) return db; } - db_path = lock_path("smbd_cleanupd.tdb"); + db_path = lock_path(talloc_tos(), "smbd_cleanupd.tdb"); if (db_path == NULL) { return NULL; } diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index de24b6c847b..9090a2d873c 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -154,7 +154,7 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx, } result->msg = msg; - db_path = lock_path("g_lock.tdb"); + db_path = lock_path(talloc_tos(), "g_lock.tdb"); if (db_path == NULL) { TALLOC_FREE(result); return NULL; diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c index ab12fc1c531..158554bd9a8 100644 --- a/source3/lib/gencache.c +++ b/source3/lib/gencache.c @@ -91,7 +91,7 @@ static bool gencache_init(void) return false; } - cache_fname = lock_path("gencache_notrans.tdb"); + cache_fname = lock_path(talloc_tos(), "gencache_notrans.tdb"); if (cache_fname == NULL) { TALLOC_FREE(cache); return false; diff --git a/source3/lib/messages.c b/source3/lib/messages.c index dab53f1c48e..cf6c1ce9c5a 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -504,7 +504,7 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx, return NT_STATUS_INVALID_PARAMETER; } - lck_path = lock_path("msg.lock"); + lck_path = lock_path(talloc_tos(), "msg.lock"); if (lck_path == NULL) { return NT_STATUS_NO_MEMORY; } @@ -664,7 +664,7 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) .pid = getpid(), .vnn = msg_ctx->id.vnn }; - lck_path = lock_path("msg.lock"); + lck_path = lock_path(talloc_tos(), "msg.lock"); if (lck_path == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/lib/server_mutex.c b/source3/lib/server_mutex.c index 56673f68637..cbb83575c02 100644 --- a/source3/lib/server_mutex.c +++ b/source3/lib/server_mutex.c @@ -70,7 +70,7 @@ struct named_mutex *grab_named_mutex(TALLOC_CTX *mem_ctx, const char *name, return NULL; } - fname = lock_path("mutex.tdb"); + fname = lock_path(talloc_tos(), "mutex.tdb"); if (fname == NULL) { TALLOC_FREE(result); return NULL; diff --git a/source3/lib/util_path.c b/source3/lib/util_path.c index 049ced548e2..b8ce304c213 100644 --- a/source3/lib/util_path.c +++ b/source3/lib/util_path.c @@ -65,9 +65,9 @@ static char *xx_path(TALLOC_CTX *mem_ctx, * @retval Pointer to a talloc'ed string containing the full path. **/ -char *lock_path(const char *name) +char *lock_path(TALLOC_CTX *mem_ctx, const char *name) { - return xx_path(talloc_tos(), name, lp_lock_directory()); + return xx_path(mem_ctx, name, lp_lock_directory()); } /** diff --git a/source3/lib/util_path.h b/source3/lib/util_path.h index 16e27926084..6df67fb6feb 100644 --- a/source3/lib/util_path.h +++ b/source3/lib/util_path.h @@ -24,7 +24,10 @@ #ifndef __LIB_UTIL_PATH_H__ #define __LIB_UTIL_PATH_H__ -char *lock_path(const char *name); +#include "replace.h" +#include <talloc.h> + +char *lock_path(TALLOC_CTX *mem_ctx, const char *name); char *state_path(const char *name); char *cache_path(const char *name); char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path); diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index e623f2456a8..58f38cdc55d 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -628,7 +628,7 @@ bool create_local_private_krb5_conf_for_domain(const char *realm, return false; } - dname = lock_path("smb_krb5"); + dname = lock_path(talloc_tos(), "smb_krb5"); if (!dname) { return false; } @@ -639,7 +639,7 @@ bool create_local_private_krb5_conf_for_domain(const char *realm, goto done; } - tmpname = lock_path("smb_tmp_krb5.XXXXXX"); + tmpname = lock_path(talloc_tos(), "smb_tmp_krb5.XXXXXX"); if (!tmpname) { goto done; } diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index 33efe37810b..0c91d55e813 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -362,7 +362,7 @@ void brl_init(bool read_only) tdb_flags |= TDB_SEQNUM; } - db_path = lock_path("brlock.tdb"); + db_path = lock_path(talloc_tos(), "brlock.tdb"); if (db_path == NULL) { DEBUG(0, ("out of memory!\n")); return; diff --git a/source3/locking/leases_db.c b/source3/locking/leases_db.c index 4167ef713e1..ea63b00e272 100644 --- a/source3/locking/leases_db.c +++ b/source3/locking/leases_db.c @@ -41,7 +41,7 @@ bool leases_db_init(bool read_only) return true; } - db_path = lock_path("leases.tdb"); + db_path = lock_path(talloc_tos(), "leases.tdb"); if (db_path == NULL) { return false; } diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c index 9314735ceda..49d4a7c5aec 100644 --- a/source3/locking/share_mode_lock.c +++ b/source3/locking/share_mode_lock.c @@ -70,7 +70,7 @@ static bool locking_init_internal(bool read_only) if (lock_db) return True; - db_path = lock_path("locking.tdb"); + db_path = lock_path(talloc_tos(), "locking.tdb"); if (db_path == NULL) { return false; } diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c index af1f9b743ba..6122fd1dc73 100644 --- a/source3/nmbd/nmbd_namelistdb.c +++ b/source3/nmbd/nmbd_namelistdb.c @@ -647,7 +647,7 @@ void dump_all_namelists(void) struct subnet_record *subrec; char *dump_path; - dump_path = lock_path("namelist.debug"); + dump_path = lock_path(talloc_tos(), "namelist.debug"); if (dump_path == NULL) { DEBUG(0, ("out of memory!\n")); return; diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c index 9b20dc19ade..0e479072a22 100644 --- a/source3/printing/printer_list.c +++ b/source3/printing/printer_list.c @@ -39,7 +39,7 @@ static struct db_context *get_printer_list_db(void) return db; } - db_path = lock_path("printer_list.tdb"); + db_path = lock_path(talloc_tos(), "printer_list.tdb"); if (db_path == NULL) { return NULL; } diff --git a/source3/rpc_server/fss/srv_fss_agent.c b/source3/rpc_server/fss/srv_fss_agent.c index 33cbca87d73..ab7f9055939 100644 --- a/source3/rpc_server/fss/srv_fss_agent.c +++ b/source3/rpc_server/fss/srv_fss_agent.c @@ -394,7 +394,7 @@ NTSTATUS srv_fssa_start(struct messaging_context *msg_ctx) return NT_STATUS_NO_MEMORY; } - fss_global.db_path = lock_path(FSS_DB_NAME); + fss_global.db_path = lock_path(talloc_tos(), FSS_DB_NAME); if (fss_global.db_path == NULL) { talloc_free(fss_global.mem_ctx); return NT_STATUS_NO_MEMORY; diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c index 4cae8c5287e..9fc8bdae1cf 100644 --- a/source3/smbd/smbXsrv_client.c +++ b/source3/smbd/smbXsrv_client.c @@ -63,7 +63,7 @@ NTSTATUS smbXsrv_client_global_init(void) /* * This contains secret information like client keys! */ - global_path = lock_path("smbXsrv_client_global.tdb"); + global_path = lock_path(talloc_tos(), "smbXsrv_client_global.tdb"); if (global_path == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c index 2a2cf6973e7..23fd96ef0ef 100644 --- a/source3/smbd/smbXsrv_open.c +++ b/source3/smbd/smbXsrv_open.c @@ -57,7 +57,7 @@ NTSTATUS smbXsrv_open_global_init(void) return NT_STATUS_OK; } - global_path = lock_path("smbXsrv_open_global.tdb"); + global_path = lock_path(talloc_tos(), "smbXsrv_open_global.tdb"); if (global_path == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/smbd/smbXsrv_session.c b/source3/smbd/smbXsrv_session.c index cf537e7dc9d..557a43f2f8c 100644 --- a/source3/smbd/smbXsrv_session.c +++ b/source3/smbd/smbXsrv_session.c @@ -67,7 +67,7 @@ NTSTATUS smbXsrv_session_global_init(struct messaging_context *msg_ctx) /* * This contains secret information like session keys! */ - global_path = lock_path("smbXsrv_session_global.tdb"); + global_path = lock_path(talloc_tos(), "smbXsrv_session_global.tdb"); if (global_path == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/smbd/smbXsrv_tcon.c b/source3/smbd/smbXsrv_tcon.c index 4552ebb15eb..eb483937d63 100644 --- a/source3/smbd/smbXsrv_tcon.c +++ b/source3/smbd/smbXsrv_tcon.c @@ -55,7 +55,7 @@ NTSTATUS smbXsrv_tcon_global_init(void) return NT_STATUS_OK; } - global_path = lock_path("smbXsrv_tcon_global.tdb"); + global_path = lock_path(talloc_tos(), "smbXsrv_tcon_global.tdb"); if (global_path == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/smbd/smbXsrv_version.c b/source3/smbd/smbXsrv_version.c index e318e7de1e0..f2d138d95a0 100644 --- a/source3/smbd/smbXsrv_version.c +++ b/source3/smbd/smbXsrv_version.c @@ -72,7 +72,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id) frame = talloc_stackframe(); - global_path = lock_path("smbXsrv_version_global.tdb"); + global_path = lock_path(talloc_tos(), "smbXsrv_version_global.tdb"); if (global_path == NULL) { TALLOC_FREE(frame); return NT_STATUS_NO_MEMORY; diff --git a/source3/utils/status.c b/source3/utils/status.c index 811eb7b492b..f0d1a851be4 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -685,7 +685,7 @@ int main(int argc, const char *argv[]) int result; struct db_context *db; - db_path = lock_path("locking.tdb"); + db_path = lock_path(talloc_tos(), "locking.tdb"); if (db_path == NULL) { d_printf("Out of memory - exiting\n"); ret = -1; |