goto done;
}
- lpath = lock_path("lang_");
+ lpath = lock_path(talloc_tos(), "lang_");
if (lpath == NULL) {
goto done;
}
return db;
}
- db_path = lock_path("smbd_cleanupd.tdb");
+ db_path = lock_path(talloc_tos(), "smbd_cleanupd.tdb");
if (db_path == NULL) {
return NULL;
}
}
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;
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;
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;
}
.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;
}
return NULL;
}
- fname = lock_path("mutex.tdb");
+ fname = lock_path(talloc_tos(), "mutex.tdb");
if (fname == NULL) {
TALLOC_FREE(result);
return NULL;
* @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());
}
/**
#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);
return false;
}
- dname = lock_path("smb_krb5");
+ dname = lock_path(talloc_tos(), "smb_krb5");
if (!dname) {
return false;
}
goto done;
}
- tmpname = lock_path("smb_tmp_krb5.XXXXXX");
+ tmpname = lock_path(talloc_tos(), "smb_tmp_krb5.XXXXXX");
if (!tmpname) {
goto done;
}
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;
return true;
}
- db_path = lock_path("leases.tdb");
+ db_path = lock_path(talloc_tos(), "leases.tdb");
if (db_path == NULL) {
return false;
}
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;
}
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;
return db;
}
- db_path = lock_path("printer_list.tdb");
+ db_path = lock_path(talloc_tos(), "printer_list.tdb");
if (db_path == NULL) {
return NULL;
}
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;
/*
* 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;
}
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;
}
/*
* 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;
}
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;
}
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;
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;