mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r4532: - rename bitmap -> bits
the next commit is support for typedef bitmap {...}; in pidl metze
This commit is contained in:
parent
a742ea1e12
commit
bd06a85cb7
@ -556,14 +556,14 @@ struct samr_LogonHours samdb_result_logon_hours(TALLOC_CTX *mem_ctx, struct ldb_
|
||||
const int units_per_week = 168;
|
||||
const struct ldb_val *val = ldb_msg_find_ldb_val(msg, attr);
|
||||
ZERO_STRUCT(hours);
|
||||
hours.bitmap = talloc_array_p(mem_ctx, uint8, units_per_week);
|
||||
if (!hours.bitmap) {
|
||||
hours.bits = talloc_array_p(mem_ctx, uint8, units_per_week);
|
||||
if (!hours.bits) {
|
||||
return hours;
|
||||
}
|
||||
hours.units_per_week = units_per_week;
|
||||
memset(hours.bitmap, 0xFF, units_per_week);
|
||||
memset(hours.bits, 0xFF, units_per_week);
|
||||
if (val) {
|
||||
memcpy(hours.bitmap, val->data, MIN(val->length, units_per_week));
|
||||
memcpy(hours.bits, val->data, MIN(val->length, units_per_week));
|
||||
}
|
||||
return hours;
|
||||
}
|
||||
@ -888,7 +888,7 @@ int samdb_msg_add_logon_hours(void *ctx, TALLOC_CTX *mem_ctx, struct ldb_message
|
||||
struct ldb_wrap *sam_ctx = ctx;
|
||||
struct ldb_val val;
|
||||
val.length = hours->units_per_week / 8;
|
||||
val.data = hours->bitmap;
|
||||
val.data = hours->bits;
|
||||
return ldb_msg_add_value(sam_ctx->ldb, msg, attr_name, &val);
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,7 @@
|
||||
/* this is also used in samr and netlogon */
|
||||
typedef [public, flag(NDR_PAHEX)] struct {
|
||||
uint16 units_per_week;
|
||||
[size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
|
||||
[size_is(1260), length_is(units_per_week/8)] uint8 *bits;
|
||||
} samr_LogonHours;
|
||||
|
||||
typedef struct {
|
||||
|
@ -245,11 +245,11 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||
s2.in.level = lvl1; \
|
||||
u = *q.out.info; \
|
||||
if (lvl1 == 21) { \
|
||||
uint8_t *bitmap = u.info21.logon_hours.bitmap; \
|
||||
uint8_t *bits = u.info21.logon_hours.bits; \
|
||||
ZERO_STRUCT(u.info21); \
|
||||
if (fpval == SAMR_FIELD_LOGON_HOURS) { \
|
||||
u.info21.logon_hours.units_per_week = 168; \
|
||||
u.info21.logon_hours.bitmap = bitmap; \
|
||||
u.info21.logon_hours.bits = bits; \
|
||||
} \
|
||||
u.info21.fields_present = fpval; \
|
||||
} \
|
||||
@ -324,10 +324,10 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
|
||||
TEST_USERINFO_INT(21, code_page, 21, code_page, __LINE__,
|
||||
SAMR_FIELD_CODE_PAGE);
|
||||
|
||||
TEST_USERINFO_INT(4, logon_hours.bitmap[3], 3, logon_hours.bitmap[3], 1, 0);
|
||||
TEST_USERINFO_INT(4, logon_hours.bitmap[3], 5, logon_hours.bitmap[3], 2, 0);
|
||||
TEST_USERINFO_INT(4, logon_hours.bitmap[3], 21, logon_hours.bitmap[3], 3, 0);
|
||||
TEST_USERINFO_INT(21, logon_hours.bitmap[3], 21, logon_hours.bitmap[3], 4,
|
||||
TEST_USERINFO_INT(4, logon_hours.bits[3], 3, logon_hours.bits[3], 1, 0);
|
||||
TEST_USERINFO_INT(4, logon_hours.bits[3], 5, logon_hours.bits[3], 2, 0);
|
||||
TEST_USERINFO_INT(4, logon_hours.bits[3], 21, logon_hours.bits[3], 3, 0);
|
||||
TEST_USERINFO_INT(21, logon_hours.bits[3], 21, logon_hours.bits[3], 4,
|
||||
SAMR_FIELD_LOGON_HOURS);
|
||||
|
||||
TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
|
||||
|
@ -453,7 +453,7 @@ static BOOL samsync_handle_user(TALLOC_CTX *mem_ctx, struct samsync_state *samsy
|
||||
TEST_INT_EQUAL(q.out.info->info21.logon_hours.units_per_week,
|
||||
user->logon_hours.units_per_week);
|
||||
if (ret) {
|
||||
if (memcmp(q.out.info->info21.logon_hours.bitmap, user->logon_hours.bitmap,
|
||||
if (memcmp(q.out.info->info21.logon_hours.bits, user->logon_hours.bits,
|
||||
q.out.info->info21.logon_hours.units_per_week/8) != 0) {
|
||||
printf("Logon hours mismatch\n");
|
||||
ret = False;
|
||||
|
Loading…
Reference in New Issue
Block a user