return true;
}
- tdb_path = state_path("group_mapping.tdb");
+ tdb_path = state_path(talloc_tos(), "group_mapping.tdb");
if (tdb_path == NULL) {
return false;
}
return false;
}
- ldb_path = state_path("group_mapping.ldb");
+ ldb_path = state_path(talloc_tos(), "group_mapping.ldb");
if (ldb_path == NULL) {
talloc_free(tdb_path);
return false;
}
/* now rename the old db out of the way */
- new_path = state_path("group_mapping.ldb.replaced");
+ new_path = state_path(talloc_tos(), "group_mapping.ldb.replaced");
if (!new_path) {
goto failed;
}
char *file;
char *tdbname;
- path = state_path("eventlog");
+ path = state_path(talloc_tos(), "eventlog");
if (!path) {
return NULL;
}
/* make sure that the eventlog dir exists */
- eventlogdir = state_path("eventlog");
+ eventlogdir = state_path(talloc_tos(), "eventlog");
if (eventlogdir == NULL) {
return NULL;
}
return True;
}
- db_path = state_path("share_info.tdb");
+ db_path = state_path(talloc_tos(), "share_info.tdb");
if (db_path == NULL) {
return false;
}
* @retval Pointer to a talloc'ed string containing the full path.
**/
-char *state_path(const char *name)
+char *state_path(TALLOC_CTX *mem_ctx, const char *name)
{
- return xx_path(talloc_tos(), name, lp_state_directory());
+ return xx_path(mem_ctx, name, lp_state_directory());
}
/**
#include <talloc.h>
char *lock_path(TALLOC_CTX *mem_ctx, const char *name);
-char *state_path(const char *name);
+char *state_path(TALLOC_CTX *mem_ctx, const char *name);
char *cache_path(const char *name);
char *canonicalize_absolute_path(TALLOC_CTX *ctx, const char *abs_path);
return true;
}
- dbname = state_path("file_ntacls.tdb");
+ dbname = state_path(talloc_tos(), "file_ntacls.tdb");
if (dbname == NULL) {
errno = ENOSYS;
const char *dbname;
char *def_dbname;
- def_dbname = state_path("xattr.tdb");
+ def_dbname = state_path(talloc_tos(), "xattr.tdb");
if (def_dbname == NULL) {
errno = ENOSYS;
return false;
return True;
}
- db_path = state_path("wins.tdb");
+ db_path = state_path(talloc_tos(), "wins.tdb");
if (db_path == NULL) {
return false;
}
add_samba_names_to_subnet(wins_server_subnet);
- list_path = state_path(WINS_LIST);
+ list_path = state_path(talloc_tos(), WINS_LIST);
if (list_path == NULL) {
tdb_close(wins_tdb);
return false;
}
}
- if (!(fname = state_path(WINS_LIST))) {
+ if (!(fname = state_path(talloc_tos(), WINS_LIST))) {
goto err_exit;
}
/* This is safe as the 0 length means "don't expand". */
return True;
}
- db_path = state_path("account_policy.tdb");
+ db_path = state_path(talloc_tos(), "account_policy.tdb");
if (db_path == NULL) {
return false;
}
return true;
}
- db_path = state_path("winbindd_idmap.tdb");
+ db_path = state_path(talloc_tos(), "winbindd_idmap.tdb");
if (db_path == NULL) {
return false;
}
}
}
- driver_path = state_path("DriverStore");
+ driver_path = state_path(talloc_tos(), "DriverStore");
if (driver_path == NULL) {
talloc_free(mem_ctx);
return false;
return false;
}
- driver_path = state_path("DriverStore/FileRepository");
+ driver_path = state_path(talloc_tos(), "DriverStore/FileRepository");
if (driver_path == NULL) {
talloc_free(mem_ctx);
return false;
return false;
}
- driver_path = state_path("DriverStore/Temp");
+ driver_path = state_path(talloc_tos(), "DriverStore/Temp");
if (driver_path == NULL) {
talloc_free(mem_ctx);
return false;
NTSTATUS status;
/* paths talloced on new stackframe */
- drivers_path = state_path("ntdrivers.tdb");
- printers_path = state_path("ntprinters.tdb");
- forms_path = state_path("ntforms.tdb");
+ drivers_path = state_path(talloc_tos(), "ntdrivers.tdb");
+ printers_path = state_path(talloc_tos(), "ntprinters.tdb");
+ forms_path = state_path(talloc_tos(), "ntforms.tdb");
if ((drivers_path == NULL) || (printers_path == NULL)
|| (forms_path == NULL)) {
talloc_free(tmp_ctx);
int32_t vers_id;
bool ret;
- drivers_path = state_path("ntdrivers.tdb");
+ drivers_path = state_path(talloc_tos(), "ntdrivers.tdb");
if (drivers_path == NULL) {
ret = false;
goto err_out;
}
- printers_path = state_path("ntprinters.tdb");
+ printers_path = state_path(talloc_tos(), "ntprinters.tdb");
if (printers_path == NULL) {
ret = false;
goto err_drvdb_free;
}
- forms_path = state_path("ntforms.tdb");
+ forms_path = state_path(talloc_tos(), "ntforms.tdb");
if (forms_path == NULL) {
ret = false;
goto err_prdb_free;
return WERR_OK;
}
- db_path = state_path("registry.tdb");
+ db_path = state_path(talloc_tos(), "registry.tdb");
if (db_path == NULL) {
return WERR_NOT_ENOUGH_MEMORY;
}
return WERR_OK;
}
- db_path = state_path("registry.tdb");
+ db_path = state_path(talloc_tos(), "registry.tdb");
if (db_path == NULL) {
return WERR_NOT_ENOUGH_MEMORY;
}
char *db_subpath = NULL;
char *ret = NULL;
- dir_path = state_path(PERFCOUNTDIR);
+ dir_path = state_path(talloc_tos(), PERFCOUNTDIR);
if (dir_path == NULL) {
return NULL;
}
return NULL;
}
- ret = state_path(db_subpath);
+ ret = state_path(talloc_tos(), db_subpath);
TALLOC_FREE(dir_path);
return ret;
}
d_fprintf(stderr, _("Out of memory!\n"));
}
} else if (strequal(backend, "tdb")) {
- dbfile = state_path("winbindd_idmap.tdb");
+ dbfile = state_path(talloc_tos(), "winbindd_idmap.tdb");
if (dbfile == NULL) {
d_fprintf(stderr, _("Out of memory!\n"));
}
}
ctx->backend = TDB;
} else if (strequal(backend, "autorid")) {
- dbfile = state_path("autorid.tdb");
+ dbfile = state_path(talloc_tos(), "autorid.tdb");
if (dbfile == NULL) {
d_fprintf(stderr, _("Out of memory!\n"));
}
} else if (argc > 0) {
dbfile = talloc_strdup(talloc_tos(), argv[0]);
} else {
- dbfile = state_path("registry.tdb");
+ dbfile = state_path(talloc_tos(), "registry.tdb");
}
if (dbfile == NULL) {
return -1;
return False;
}
- db_path = state_path("winbindd_cache.tdb");
+ db_path = state_path(talloc_tos(), "winbindd_cache.tdb");
if (db_path == NULL) {
return false;
}
return False;
}
- db_path = state_path("winbindd_cache.tdb");
+ db_path = state_path(talloc_tos(), "winbindd_cache.tdb");
if (db_path == NULL) {
return false;
}
commonconfig->rw_ops->get_new_id = idmap_autorid_allocate_id;
commonconfig->rw_ops->set_mapping = idmap_tdb_common_set_mapping;
- db_path = state_path("autorid.tdb");
+ db_path = state_path(talloc_tos(), "autorid.tdb");
if (db_path == NULL) {
status = NT_STATUS_NO_MEMORY;
goto error;
mem_ctx = talloc_stackframe();
/* use the old database if present */
- tdbfile = state_path("winbindd_idmap.tdb");
+ tdbfile = state_path(talloc_tos(), "winbindd_idmap.tdb");
if (!tdbfile) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
char *get_winbind_priv_pipe_dir(void)
{
- return state_path(WINBINDD_PRIV_SOCKET_SUBDIR);
+ return state_path(talloc_tos(), WINBINDD_PRIV_SOCKET_SUBDIR);
}
static void winbindd_setup_max_fds(void)
* Data needs to be kept persistent in state directory for
* running with "winbindd offline logon".
*/
- return state_path("winbindd_cache.tdb");
+ return state_path(talloc_tos(), "winbindd_cache.tdb");
}
static void winbindd_domain_init_backend(struct winbindd_domain *domain)