diff options
author | Jeremy Allison <jra@samba.org> | 2001-03-09 23:48:58 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-03-09 23:48:58 +0000 |
commit | 00ab9021b0cc5fe2667d383eb9cc2973072cdaaa (patch) | |
tree | d6444c6041525e86a61c0aa70247dc332aeb1a80 /source3/include | |
parent | 0bfc10011bd5cacecda8b59c36e80f676e5c7fa3 (diff) | |
download | samba-00ab9021b0cc5fe2667d383eb9cc2973072cdaaa.tar.gz samba-00ab9021b0cc5fe2667d383eb9cc2973072cdaaa.tar.bz2 samba-00ab9021b0cc5fe2667d383eb9cc2973072cdaaa.zip |
Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
(This used to be commit 0cd37c831d79a12a10e479bf4fa89ffe64c1292a)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/ntdomain.h | 11 | ||||
-rw-r--r-- | source3/include/proto.h | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 7a47f6150e..0ae48169fb 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -79,6 +79,11 @@ typedef struct _prs_struct #define MARSHALLING(ps) (!(ps)->io) #define UNMARSHALLING(ps) ((ps)->io) +#define RPC_BIG_ENDIAN 1 +#define RPC_LITTLE_ENDIAN 0 + +#define RPC_PARSE_ALIGN 4 + typedef struct _output_data { /* * Raw RPC output data. This does not include RPC headers or footers. @@ -196,6 +201,12 @@ typedef struct pipes_struct BOOL fault_state; /* + * Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's + */ + + BOOL endian; + + /* * Struct to deal with multiple pdu inputs. */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 442354abed..a532830ce1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2529,7 +2529,7 @@ BOOL net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int void prs_dump(char *name, int v, prs_struct *ps); void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name); -BOOL prs_init(prs_struct *ps, uint32 size, uint8 align, TALLOC_CTX *ctx, BOOL io); +BOOL prs_init(prs_struct *ps, uint32 size, TALLOC_CTX *ctx, BOOL io); BOOL prs_read(prs_struct *ps, int fd, size_t len, int timeout); void prs_mem_free(prs_struct *ps); char *prs_alloc_mem(prs_struct *ps, size_t size); @@ -2546,7 +2546,7 @@ BOOL prs_set_offset(prs_struct *ps, uint32 offset); BOOL prs_append_prs_data(prs_struct *dst, prs_struct *src); BOOL prs_append_some_prs_data(prs_struct *dst, prs_struct *src, int32 start, uint32 len); BOOL prs_append_data(prs_struct *dst, char *src, uint32 len); -void prs_set_bigendian_data(prs_struct *ps); +void prs_set_endian_data(prs_struct *ps, BOOL endian); BOOL prs_align(prs_struct *ps); BOOL prs_align_needed(prs_struct *ps, uint32 needed); char *prs_mem_get(prs_struct *ps, uint32 extra_size); |