NTSTATUS dbwrap_change_int32_atomic_bystring(struct db_context *db, const char *keystr, int32_t *oldval, int32_t change_val) { return dbwrap_change_int32_atomic(db, string_term_tdb_data(keystr), oldval, change_val); }
/** * Use a TDB to store an incrementing random seed. * * Initialised to the current pid, the very first time Samba starts, * and incremented by one each time it is needed. * * @note Not called by systems with a working /dev/urandom. */ static void get_rand_seed(int *new_seed) { *new_seed = sys_getpid(); if (db_ctx) { dbwrap_change_int32_atomic(db_ctx, "INFO/random_seed", new_seed, 1); } }