diff options
author | Rafal Szczesniak <mimir@samba.org> | 2006-08-07 20:29:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:26 -0500 |
commit | 84f8d208eff81ed055bd82542bc6bd753659a4c1 (patch) | |
tree | 030597c4f7b44457f57c4c37888faa19fa20ee9a /source4/libnet/libnet_user.h | |
parent | 9ea3b567e461a7f99ac6bff2dd61380482451ebf (diff) | |
download | samba-84f8d208eff81ed055bd82542bc6bd753659a4c1.tar.gz samba-84f8d208eff81ed055bd82542bc6bd753659a4c1.tar.bz2 samba-84f8d208eff81ed055bd82542bc6bd753659a4c1.zip |
r17448: Define macros to set fields in api function modifying user account.
rafal
(This used to be commit 8d9330c490470127f192949efa9201225136edb1)
Diffstat (limited to 'source4/libnet/libnet_user.h')
-rw-r--r-- | source4/libnet/libnet_user.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/libnet/libnet_user.h b/source4/libnet/libnet_user.h index d2f1c438c7..cd5325b58e 100644 --- a/source4/libnet/libnet_user.h +++ b/source4/libnet/libnet_user.h @@ -49,15 +49,40 @@ struct libnet_ModifyUser { const char *account_name; const char *full_name; const char *description; + const char *home_directory; + const char *home_drive; const char *comment; const char *logon_script; const char *profile_path; struct timeval *acct_expiry; struct timeval *allow_password_change; struct timeval *force_password_change; + struct timeval *last_logon; + struct timeval *last_logoff; + struct timeval *last_password_change; uint32_t acct_flags; } in; struct { const char *error_string; } out; }; + + +#define SET_FIELD_LSA_STRING(new, current, mod, field, flag) \ + if (new.field != NULL && \ + !strequal_w(current->field.string, new.field)) { \ + \ + mod->field = talloc_strdup(mem_ctx, new.field); \ + if (mod->field == NULL) return NT_STATUS_NO_MEMORY; \ + \ + mod->fields |= flag; \ + } + +#define SET_FIELD_NTTIME(new, current, mod, field, flag) \ + if (new.field != 0) { \ + NTTIME newval = timeval_to_nttime(new.field); \ + if (newval != current->field) { \ + mod->field = talloc_memdup(mem_ctx, new.field, sizeof(*new.field)); \ + mod->fields |= flag; \ + } \ + } |