diff options
author | Günther Deschner <gd@samba.org> | 2008-02-11 23:17:45 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-11 23:37:36 +0100 |
commit | 14ee7be97b618478076cef768090cacf491d8442 (patch) | |
tree | 62f8307e0cc3074a89d2d426c50fb452e868066e /source3/rpc_server | |
parent | f0e8c5d4c2ebb897472f8bc516f1f78a6b8159dc (diff) | |
download | samba-14ee7be97b618478076cef768090cacf491d8442.tar.gz samba-14ee7be97b618478076cef768090cacf491d8442.tar.bz2 samba-14ee7be97b618478076cef768090cacf491d8442.zip |
Fix SAMR_FIELD_LOGON_HOURS handling in rpc_server/srv_samr_util.c.
Guenther
(This used to be commit ed89daec1d170128047f157d7a9314ae83a21733)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_samr_util.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/source3/rpc_server/srv_samr_util.c b/source3/rpc_server/srv_samr_util.c index 7707438b67..6c43e455bc 100644 --- a/source3/rpc_server/srv_samr_util.c +++ b/source3/rpc_server/srv_samr_util.c @@ -247,32 +247,28 @@ void copy_id21_to_sam_passwd(const char *log_prefix, pdb_set_acct_ctrl(to, from->acct_flags, PDB_CHANGED); } } - DEBUG(15,("%s LOGON_DIVS: %08X -> %08X\n", l, pdb_get_logon_divs(to), - from->logon_hours.units_per_week)); -#if 0 -// LOGON_HRS -// struct samr_LogonHours logon_hours; - if (from->fields_present & ACCT_LOGON_HOURS) { + + if (from->fields_present & SAMR_FIELD_LOGON_HOURS) { char oldstr[44]; /* hours strings are 42 bytes. */ char newstr[44]; - DEBUG(15,("%s LOGON_DIVS: %08X -> %08X\n", l, pdb_get_logon_divs(to), from->logon_divs)); - if (from->logon_divs != pdb_get_logon_divs(to)) { - pdb_set_logon_divs(to, from->logon_divs, PDB_CHANGED); + DEBUG(15,("%s SAMR_FIELD_LOGON_HOURS (units_per_week): %08X -> %08X\n", l, pdb_get_logon_divs(to), from->logon_hours.units_per_week)); + if (from->logon_hours.units_per_week != pdb_get_logon_divs(to)) { + pdb_set_logon_divs(to, from->logon_hours.units_per_week, PDB_CHANGED); } - DEBUG(15,("%s LOGON_HRS.LEN: %08X -> %08X\n", l, pdb_get_hours_len(to), from->logon_hrs.len)); - if (from->logon_hrs.len != pdb_get_hours_len(to)) { - pdb_set_hours_len(to, from->logon_hrs.len, PDB_CHANGED); + DEBUG(15,("%s SAMR_FIELD_LOGON_HOURS (units_per_week/8): %08X -> %08X\n", l, pdb_get_hours_len(to), from->logon_hours.units_per_week/8)); + if (from->logon_hours.units_per_week/8 != pdb_get_hours_len(to)) { + pdb_set_hours_len(to, from->logon_hours.units_per_week/8, PDB_CHANGED); } - DEBUG(15,("%s LOGON_HRS.HOURS: %s -> %s\n", l, pdb_get_hours(to), from->logon_hrs.hours)); + DEBUG(15,("%s SAMR_FIELD_LOGON_HOURS (bits): %s -> %s\n", l, pdb_get_hours(to), from->logon_hours.bits)); pdb_sethexhours(oldstr, pdb_get_hours(to)); - pdb_sethexhours(newstr, from->logon_hrs.hours); + pdb_sethexhours(newstr, from->logon_hours.bits); if (!strequal(oldstr, newstr)) { - pdb_set_hours(to, from->logon_hrs.hours, PDB_CHANGED); + pdb_set_hours(to, from->logon_hours.bits, PDB_CHANGED); } } -#endif + if (from->fields_present & SAMR_FIELD_BAD_PWD_COUNT) { DEBUG(10,("%s SAMR_FIELD_BAD_PWD_COUNT: %08X -> %08X\n", l, pdb_get_bad_password_count(to), from->bad_password_count)); if (from->bad_password_count != pdb_get_bad_password_count(to)) { |