static bool get_privileges( const struct dom_sid *sid, uint64_t *mask )
{
struct db_context *db = get_account_pol_db();
- fstring tmp, keystr;
+ struct dom_sid_buf tmp;
+ fstring keystr;
TDB_DATA data;
NTSTATUS status;
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, dom_sid_str_buf(sid, &tmp));
status = dbwrap_fetch_bystring(db, talloc_tos(), keystr, &data);
{
struct db_context *db = get_account_pol_db();
uint8_t privbuf[8];
- fstring tmp, keystr;
+ struct dom_sid_buf tmp;
+ fstring keystr;
TDB_DATA data;
if ( !lp_enable_privileges() )
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, dom_sid_str_buf(sid, &tmp));
/* This writes the 64 bit bitmask out in little endian format */
SBVAL(privbuf,0,mask);
NTSTATUS privilege_delete_account(const struct dom_sid *sid)
{
struct db_context *db = get_account_pol_db();
- fstring tmp, keystr;
+ struct dom_sid_buf tmp;
+ fstring keystr;
if (!lp_enable_privileges()) {
return NT_STATUS_OK;
/* PRIV_<SID> (NULL terminated) as the key */
- fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
+ fstr_sprintf(keystr, "%s%s", PRIVPREFIX, dom_sid_str_buf(sid, &tmp));
return dbwrap_delete_bystring(db, keystr);
}