1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Ensure we don't try and set the acct_flags if they are 0 (meaning

unchanged in this interface).

We seem to have two very similar interfaces here, and this is the
poorer interface, for this reason.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2008-02-28 10:43:57 +11:00
parent ba864cfd7c
commit 582073eff1
2 changed files with 9 additions and 1 deletions

View File

@ -534,7 +534,7 @@ static NTSTATUS set_user_changes(TALLOC_CTX *mem_ctx, struct usermod_change *mod
SET_FIELD_NTTIME(r->in, user, mod, acct_expiry, USERMOD_FIELD_ACCT_EXPIRY);
/* account flags change */
SET_FIELD_UINT32(r->in, user, mod, acct_flags, USERMOD_FIELD_ACCT_FLAGS);
SET_FIELD_ACCT_FLAGS(r->in, user, mod, acct_flags, USERMOD_FIELD_ACCT_FLAGS);
return NT_STATUS_OK;
}

View File

@ -91,6 +91,14 @@ struct libnet_ModifyUser {
mod->fields |= flag; \
}
#define SET_FIELD_ACCT_FLAGS(new, current, mod, field, flag) \
if (new.field) { \
if (current->field != new.field) { \
mod->field = new.field; \
mod->fields |= flag; \
} \
}
struct libnet_UserInfo {
struct {