*/
static void get_rand_seed(void *userdata, int *new_seed)
{
- *new_seed = sys_getpid();
+ *new_seed = getpid();
if (db_ctx) {
- dbwrap_trans_change_int32_atomic(db_ctx, "INFO/random_seed",
- new_seed, 1);
+ dbwrap_trans_change_int32_atomic_bystring(
+ db_ctx, "INFO/random_seed", new_seed, 1);
}
}
}
db_ctx = db_open(NULL, fname, 0,
- TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ TDB_DEFAULT, O_RDWR|O_CREAT, 0600,
+ DBWRAP_LOCK_ORDER_1);
if (db_ctx == NULL) {
DEBUG(0,("Failed to open %s\n", fname));
char *key = NULL;
size_t size = 0;
- *dn = smb_xstrdup(lp_ldap_admin_dn());
+ *dn = smb_xstrdup(lp_ldap_admin_dn(talloc_tos()));
if (asprintf(&key, "%s/%s", SECRETS_LDAP_BIND_PW, *dn) < 0) {
SAFE_FREE(*dn);
return ret;
}
-bool secrets_delete_generic(const char *owner, const char *key)
-{
- char *tdbkey = NULL;
- bool ret;
-
- if (asprintf(&tdbkey, "SECRETS/GENERIC/%s/%s", owner, key) < 0) {
- DEBUG(0, ("asprintf failed!\n"));
- return False;
- }
-
- ret = secrets_delete(tdbkey);
-
- SAFE_FREE(tdbkey);
- return ret;
-}
-
/*******************************************************************
Find the ldap password.
******************************************************************/