diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-05-25 13:57:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:14 -0500 |
commit | 579c13da43d5b40ac6d6c1436399fbc1d8dfd054 (patch) | |
tree | 42299570746f2d7f80356b689cb15e3db6c53d3c /source4/librpc | |
parent | 81e8de9ca85fe9a6658beb1dab0d231c13cda063 (diff) | |
download | samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.tar.gz samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.tar.bz2 samba-579c13da43d5b40ac6d6c1436399fbc1d8dfd054.zip |
r873: converted samba4 to use real 64 bit integers instead of
structures. This was suggested by metze recently.
I checked on the build farm and all the machines we have support 64
bit ints, and support the LL suffix for 64 bit constants. I suspect
some won't support strtoll() and related functions, so we will
probably need replacements for those.
(This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/idl/misc.idl | 6 | ||||
-rw-r--r-- | source4/librpc/idl/netlogon.idl | 14 | ||||
-rw-r--r-- | source4/librpc/idl/samr.idl | 17 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 77 |
4 files changed, 79 insertions, 35 deletions
diff --git a/source4/librpc/idl/misc.idl b/source4/librpc/idl/misc.idl index fca8fe876e..551803fa8e 100644 --- a/source4/librpc/idl/misc.idl +++ b/source4/librpc/idl/misc.idl @@ -65,12 +65,6 @@ interface misc GUID uuid; } policy_handle; - /* a 4 byte aligned 64-bit integer */ - typedef [public] struct { - uint32 low; - uint32 high; - } ULONG8; - /* this is also used in samr and netlogon */ typedef [public, flag(NDR_PAHEX)] struct { uint16 units_per_week; diff --git a/source4/librpc/idl/netlogon.idl b/source4/librpc/idl/netlogon.idl index 693e7bf57c..f3c2b1ff26 100644 --- a/source4/librpc/idl/netlogon.idl +++ b/source4/librpc/idl/netlogon.idl @@ -77,8 +77,8 @@ interface netlogon /* in netr_AcctLockStr size seems to be be 24, and rrenard thinks that the structure of the bindata looks like this: - ULONG8 lockout_duration; - ULONG8 reset_count; + uint64 lockout_duration; + uint64 reset_count; uint32 bad_attempt_lockout; uint32 dummy; @@ -371,9 +371,9 @@ interface netlogon NTTIME forcedlogoff; uint16 minpasswdlen; uint16 passwdhistorylen; - ULONG8 pwd_must_change_time; - ULONG8 pwd_can_change_time; - ULONG8 sequence_num; + uint64 pwd_must_change_time; + uint64 pwd_can_change_time; + uint64 sequence_num; NTTIME domain_create_time; uint32 SecurityInformation; sec_desc_buf sdbuf; @@ -597,7 +597,7 @@ interface netlogon [case(NETR_DELTA_DELETE_SECRET)] netr_DELTA_DELETE_SECRET delete_secret; [case(NETR_DELTA_DELETE_GROUP2)] netr_DELTA_DELETE_USER *delete_group; [case(NETR_DELTA_DELETE_USER2)] netr_DELTA_DELETE_USER *delete_user; - [case(NETR_DELTA_MODIFY_COUNT)] ULONG8 *modified_count; + [case(NETR_DELTA_MODIFY_COUNT)] uint64 *modified_count; } netr_DELTA_UNION; typedef union { @@ -643,7 +643,7 @@ interface netlogon [in] netr_Authenticator credential, [in,out] netr_Authenticator return_authenticator, [in] uint32 database_id, - [in,out] ULONG8 sequence_num, + [in,out] uint64 sequence_num, [in] uint32 preferredmaximumlength, [out] netr_DELTA_ENUM_ARRAY *delta_enum_array ); diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index 2ff4e86cd1..3c9005a1f3 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -129,12 +129,13 @@ uint16 min_pwd_len; uint16 password_history; uint32 password_properties; - ULONG8 max_password_age; - ULONG8 min_password_age; + /* yes, these are signed. They are in negative 100ns */ + int64 max_password_age; + int64 min_password_age; } samr_DomInfo1; typedef struct { - ULONG8 force_logoff_time; + uint64 force_logoff_time; samr_Name comment; samr_Name domain; /* domain name */ samr_Name primary; /* PDC name if this is a BDC */ @@ -148,7 +149,7 @@ } samr_DomInfo2; typedef struct { - ULONG8 force_logoff_time; + uint64 force_logoff_time; } samr_DomInfo3; typedef struct { @@ -180,7 +181,7 @@ } samr_DomInfo9; typedef struct { - ULONG8 force_logoff_time; + uint64 force_logoff_time; samr_Name comment; samr_Name domain; samr_Name primary; @@ -1162,10 +1163,14 @@ /************************/ /* Function 0x3f */ + const int SAMR_REJECT_OTHER = 0; + const int SAMR_REJECT_TOO_SHORT = 1; + const int SAMR_REJECT_COMPLEXITY = 2; + typedef struct { + uint32 reason; uint32 unknown1; uint32 unknown2; - uint32 unknown3; } samr_ChangeReject; NTSTATUS samr_ChangePasswordUser3( diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 33176ec9c0..f4cdf44dc0 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -66,19 +66,36 @@ NTSTATUS ndr_pull_uint32(struct ndr_pull *ndr, uint32 *v) } /* - parse a HYPER_T + parse a uint64 */ -NTSTATUS ndr_pull_HYPER_T(struct ndr_pull *ndr, HYPER_T *v) +NTSTATUS ndr_pull_uint64(struct ndr_pull *ndr, uint64_t *v) { - NDR_PULL_ALIGN(ndr, 8); + NDR_PULL_ALIGN(ndr, 4); NDR_PULL_NEED_BYTES(ndr, 8); - v->low = NDR_IVAL(ndr, ndr->offset); - v->high = NDR_IVAL(ndr, ndr->offset+4); + *v = NDR_IVAL(ndr, ndr->offset); + *v |= (uint64_t)(NDR_IVAL(ndr, ndr->offset+4)) << 32; ndr->offset += 8; return NT_STATUS_OK; } /* + parse a int64 +*/ +NTSTATUS ndr_pull_int64(struct ndr_pull *ndr, int64_t *v) +{ + return ndr_pull_uint64(ndr, (uint64_t *)v); +} + +/* + parse a HYPER_T +*/ +NTSTATUS ndr_pull_HYPER_T(struct ndr_pull *ndr, HYPER_T *v) +{ + NDR_PULL_ALIGN(ndr, 8); + return ndr_pull_uint64(ndr, v); +} + +/* pull a NTSTATUS */ NTSTATUS ndr_pull_NTSTATUS(struct ndr_pull *ndr, NTSTATUS *status) @@ -215,18 +232,35 @@ NTSTATUS ndr_push_uint32(struct ndr_push *ndr, uint32 v) } /* - push a HYPER_T + push a uint64 */ -NTSTATUS ndr_push_HYPER_T(struct ndr_push *ndr, HYPER_T v) +NTSTATUS ndr_push_uint64(struct ndr_push *ndr, uint64 v) { - NDR_PUSH_ALIGN(ndr, 8); + NDR_PUSH_ALIGN(ndr, 4); NDR_PUSH_NEED_BYTES(ndr, 8); - NDR_SIVAL(ndr, ndr->offset, v.low); - NDR_SIVAL(ndr, ndr->offset+4, v.high); + NDR_SIVAL(ndr, ndr->offset, (v & 0xFFFFFFFF)); + NDR_SIVAL(ndr, ndr->offset+4, (v>>32)); ndr->offset += 8; return NT_STATUS_OK; } +/* + push a int64 +*/ +NTSTATUS ndr_push_int64(struct ndr_push *ndr, int64 v) +{ + return ndr_push_uint64(ndr, (uint64_t)v); +} + +/* + push a HYPER_T +*/ +NTSTATUS ndr_push_HYPER_T(struct ndr_push *ndr, HYPER_T v) +{ + NDR_PUSH_ALIGN(ndr, 8); + return ndr_push_uint64(ndr, v); +} + NTSTATUS ndr_push_align(struct ndr_push *ndr, size_t size) { NDR_PUSH_ALIGN(ndr, size); @@ -606,8 +640,7 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s) */ NTSTATUS ndr_push_NTTIME(struct ndr_push *ndr, NTTIME t) { - NDR_CHECK(ndr_push_uint32(ndr, t.low)); - NDR_CHECK(ndr_push_uint32(ndr, t.high)); + NDR_CHECK(ndr_push_uint64(ndr, t)); return NT_STATUS_OK; } @@ -616,8 +649,7 @@ NTSTATUS ndr_push_NTTIME(struct ndr_push *ndr, NTTIME t) */ NTSTATUS ndr_pull_NTTIME(struct ndr_pull *ndr, NTTIME *t) { - NDR_CHECK(ndr_pull_uint32(ndr, &t->low)); - NDR_CHECK(ndr_pull_uint32(ndr, &t->high)); + NDR_CHECK(ndr_pull_uint64(ndr, t)); return NT_STATUS_OK; } @@ -661,9 +693,22 @@ void ndr_print_uint32(struct ndr_print *ndr, const char *name, uint32 v) ndr->print(ndr, "%-25s: 0x%08x (%u)", name, v, v); } +void ndr_print_uint64(struct ndr_print *ndr, const char *name, uint64 v) +{ + ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32)(v >> 32), (uint32)(v & 0xFFFFFFFF)); +} + +void ndr_print_int64(struct ndr_print *ndr, const char *name, int64 v) +{ + ndr->print(ndr, "%-25s: 0x%08x%08x (%lld)", name, + (uint32)(v >> 32), + (uint32)(v & 0xFFFFFFFF), + v); +} + void ndr_print_HYPER_T(struct ndr_print *ndr, const char *name, HYPER_T v) { - ndr->print(ndr, "%-25s: 0x%08x%08x", name, v.high, v.low); + ndr->print(ndr, "%-25s: 0x%08x%08x", name, (uint32)(v >> 32), (uint32)(v & 0xFFFFFFFF)); } void ndr_print_ptr(struct ndr_print *ndr, const char *name, const void *p) @@ -686,7 +731,7 @@ void ndr_print_string(struct ndr_print *ndr, const char *name, const char *s) void ndr_print_NTTIME(struct ndr_print *ndr, const char *name, NTTIME t) { - ndr->print(ndr, "%-25s: %s", name, nt_time_string(ndr->mem_ctx, &t)); + ndr->print(ndr, "%-25s: %s", name, nt_time_string(ndr->mem_ctx, t)); } void ndr_print_time_t(struct ndr_print *ndr, const char *name, time_t t) |