summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>1999-04-08 05:36:15 +0000
committerMatthew Chapman <matty@samba.org>1999-04-08 05:36:15 +0000
commit373ea639e03e72bef8242133abbf678cf90ed0d9 (patch)
treec6fb6d1918c77c49f039ba0953dc4066abbb2d9c /source3/rpc_parse/parse_misc.c
parent53f0cd990c3d26e73b42266be35516d6db9621e0 (diff)
downloadsamba-373ea639e03e72bef8242133abbf678cf90ed0d9.tar.gz
samba-373ea639e03e72bef8242133abbf678cf90ed0d9.tar.bz2
samba-373ea639e03e72bef8242133abbf678cf90ed0d9.zip
Mainly BDC-related changes.
* Added SEC_CHAN_BDC * Propagate sec_chan into the various functions which change trust account passwords, so they can be used for domain control and inter-domain trusts. * Fix for endianness problem reported by Edan Idzerda <edan@mtu.edu>. A BUFFER2 is really a "unibuf" in my terminology and we should treat it as such. * Added some more common NT structures (BIGINT, BUFHDR2, BUFFER4). * Added NET_SAM_SYNC (-> NetDatabaseSync2) RPC for account replication. Still experimental and incomplete, with a few too many NULL security descriptors lying around (must go look at Jeremy's SD code). Haven't worked out password encryption yet either. However, the XXX_INFO structures I've added to rpc_netlogon.h are quite nice as they give some insight into how these objects are stored in the SAM. (This used to be commit 7b830350eb54dc9d357c115e12ddf9a0633527ac)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c99
1 files changed, 66 insertions, 33 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 64cbdef716..51587e6d7a 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -28,6 +28,21 @@
extern int DEBUGLEVEL;
+/*******************************************************************
+reads or writes a BIGINT structure.
+********************************************************************/
+void smb_io_bigint(char *desc, BIGINT *bigint, prs_struct *ps, int depth)
+{
+ if (bigint == NULL) return;
+
+ prs_debug(ps, depth, desc, "smb_io_bigint");
+ depth++;
+
+ prs_align(ps);
+
+ prs_uint32("low ", ps, depth, &(bigint->low ));
+ prs_uint32("high", ps, depth, &(bigint->high));
+}
/*******************************************************************
reads or writes a UTIME type.
@@ -311,6 +326,7 @@ void smb_io_hdrbuf_post(char *desc, BUFHDR *hdr, prs_struct *ps, int depth,
ps->offset = old_offset;
}
}
+
/*******************************************************************
reads or writes a BUFHDR structure.
********************************************************************/
@@ -332,6 +348,32 @@ void smb_io_hdrbuf(char *desc, BUFHDR *hdr, prs_struct *ps, int depth)
}
/*******************************************************************
+creates a BUFHDR2 structure.
+********************************************************************/
+void make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer)
+{
+ hdr->info_level = info_level;
+ hdr->length = length;
+ hdr->buffer = buffer;
+}
+
+/*******************************************************************
+reads or writes a BUFHDR2 structure.
+********************************************************************/
+void smb_io_bufhdr2(char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth)
+{
+ if (hdr == NULL) return;
+
+ prs_debug(ps, depth, desc, "smb_io_bufhdr2");
+ depth++;
+
+ prs_align(ps);
+ prs_uint32("info_level", ps, depth, &(hdr->info_level));
+ prs_uint32("length ", ps, depth, &(hdr->length ));
+ prs_uint32("buffer ", ps, depth, &(hdr->buffer ));
+}
+
+/*******************************************************************
creates a UNIHDR2 structure.
********************************************************************/
void make_uni_hdr2(UNIHDR2 *hdr, int len)
@@ -456,6 +498,27 @@ void smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth)
}
/*******************************************************************
+reads or writes a BUFFER4 structure.
+********************************************************************/
+void smb_io_buffer4(char *desc, BUFFER4 *buf4, uint32 buffer, prs_struct *ps, int depth)
+{
+ if ((buf4 == NULL) || (buffer == 0)) return;
+
+ prs_debug(ps, depth, desc, "smb_io_buffer4");
+ depth++;
+
+ prs_align(ps);
+ prs_uint32("buf_len", ps, depth, &(buf4->buf_len));
+
+ if (buf4->buf_len > MAX_BUFFERLEN)
+ {
+ buf4->buf_len = MAX_BUFFERLEN;
+ }
+
+ prs_uint8s(True, "buffer", ps, depth, buf4->buffer, buf4->buf_len);
+}
+
+/*******************************************************************
creates a BUFFER2 structure.
********************************************************************/
void make_buffer2(BUFFER2 *str, const char *buf, int len)
@@ -463,12 +526,11 @@ void make_buffer2(BUFFER2 *str, const char *buf, int len)
ZERO_STRUCTP(str);
/* set up string lengths. */
- str->buf_max_len = len;
+ str->buf_max_len = str->buf_len = len * 2;
str->undoc = 0;
- str->buf_len = len;
- /* store the string (wide chars) */
- ascii_to_unistr(str->buffer, buf, len);
+ /* store the string */
+ ascii_to_unibuf(str->buffer, buf, len);
}
/*******************************************************************
@@ -910,35 +972,6 @@ void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int dept
}
/*******************************************************************
-makes a DOM_LOGON_ID structure.
-********************************************************************/
-void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high)
-{
- if (log == NULL) return;
-
- DEBUG(5,("make_logon_id: %d\n", __LINE__));
-
- log->low = log_id_low;
- log->high = log_id_high;
-}
-
-/*******************************************************************
-reads or writes a DOM_LOGON_ID structure.
-********************************************************************/
-void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth)
-{
- if (log == NULL) return;
-
- prs_debug(ps, depth, desc, "smb_io_logon_id");
- depth++;
-
- prs_align(ps);
-
- prs_uint32("low ", ps, depth, &(log->low ));
- prs_uint32("high", ps, depth, &(log->high));
-}
-
-/*******************************************************************
makes an OWF_INFO structure.
********************************************************************/
void make_owf_info(OWF_INFO *hash, uint8 data[16])