summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-07-18 19:25:32 +0000
committerJeremy Allison <jra@samba.org>2000-07-18 19:25:32 +0000
commit2637bfee06c1fb2d5fcb9345ff56b0883e024f31 (patch)
tree947e7a57625056febdb7d64588856ad07012fbbd /source3/rpc_parse
parent6f9afd1766dcc3e56f2c25028751068ef553b8af (diff)
downloadsamba-2637bfee06c1fb2d5fcb9345ff56b0883e024f31.tar.gz
samba-2637bfee06c1fb2d5fcb9345ff56b0883e024f31.tar.bz2
samba-2637bfee06c1fb2d5fcb9345ff56b0883e024f31.zip
rpc_parse/parse_prs.c: Removed extraneous ()'s.
rpc_parse/parse_spoolss.c: Fixed the security descriptor marshalling in a INFO_2 struct. for some reason SD's should be done inline after the info2, not as the last buffer marshall. rpc_server/srv_spoolss_nt.c: Removed extraneous ()'s. Jeremy. (This used to be commit f038a24e9f624fdb04cd52769d45783248ce8a38)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_prs.c4
-rw-r--r--source3/rpc_parse/parse_spoolss.c40
2 files changed, 21 insertions, 23 deletions
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 1bda5ef506..5f43e52975 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -817,7 +817,7 @@ BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, int len, int m
BOOL prs_uint16_pre(char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset)
{
- (*offset) = ps->data_offset;
+ *offset = ps->data_offset;
if (UNMARSHALLING(ps)) {
/* reading. */
return prs_uint16(name, ps, depth, data16);
@@ -864,7 +864,7 @@ BOOL prs_uint16_post(char *name, prs_struct *ps, int depth, uint16 *data16,
BOOL prs_uint32_pre(char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset)
{
- (*offset) = ps->data_offset;
+ *offset = ps->data_offset;
if (UNMARSHALLING(ps)) {
/* reading. */
return prs_uint32(name, ps, depth, data32);
diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c
index 9f5fdccfe7..a6de6d45d9 100644
--- a/source3/rpc_parse/parse_spoolss.c
+++ b/source3/rpc_parse/parse_spoolss.c
@@ -333,10 +333,9 @@ static BOOL smb_io_notify_info_data(char *desc,SPOOL_NOTIFY_INFO_DATA *data, prs
return False;
if(!prs_uint32("id", ps, depth, &data->id))
return False;
-#if 1 /* JRATEST - NEEDED ???? */
if(!prs_uint32("how many words", ps, depth, &how_many_words))
return False;
-#endif /* JRATEST - NEEDED ???? */
+
/*prs_align(ps);*/
@@ -1358,7 +1357,7 @@ static BOOL spoolss_smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int d
********************************************************************/
static BOOL new_smb_io_relstr(char *desc, NEW_BUFFER *buffer, int depth, UNISTR *string)
{
- prs_struct *ps=&(buffer->prs);
+ prs_struct *ps=&buffer->prs;
if (MARSHALLING(ps)) {
uint32 struct_offset = prs_offset(ps);
@@ -1421,15 +1420,6 @@ static BOOL new_smb_io_relarraystr(char *desc, NEW_BUFFER *buffer, int depth, ui
p=*string;
q=*string;
-#if 0 /* JRATEST */
- if (p == NULL) {
- relative_offset = 0;
- if (!prs_uint32("offset", ps, depth, &relative_offset))
- return False;
- return True;
- }
-#endif
-
/* first write the last 0 */
buffer->string_at_end -= 2;
if(!prs_set_offset(ps, buffer->string_at_end))
@@ -1438,13 +1428,6 @@ static BOOL new_smb_io_relarraystr(char *desc, NEW_BUFFER *buffer, int depth, ui
if(!prs_uint16("leading zero", ps, depth, &zero))
return False;
-#if 0 /* JRATEST */
- if (p == NULL)
- p = &zero;
- if (q == NULL)
- q = &zero;
-#endif /* JRATEST */
-
while (p && (*p!=0)) {
while (*q!=0)
q++;
@@ -1532,11 +1515,15 @@ static BOOL new_smb_io_relsecdesc(char *desc, NEW_BUFFER *buffer, int depth,
}
if (*secdesc != NULL) {
+#if 0 /* JRATEST */
+ if(!prs_set_offset(ps, 0x54))
+ return False;
+#else
buffer->string_at_end -= sec_desc_size(*secdesc);
if(!prs_set_offset(ps, buffer->string_at_end))
return False;
-
+#endif
/* write the secdesc */
if (!sec_io_desc(desc, secdesc, ps, depth))
return False;
@@ -1547,6 +1534,10 @@ static BOOL new_smb_io_relsecdesc(char *desc, NEW_BUFFER *buffer, int depth,
relative_offset=buffer->string_at_end - buffer->struct_start;
/* write its offset */
+#if 0 /* JRATEST */
+ relative_offset = 0x54;
+#endif
+
if (!prs_uint32("offset", ps, depth, &relative_offset))
return False;
} else {
@@ -1763,6 +1754,7 @@ BOOL new_smb_io_printer_info_1(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_1 *i
********************************************************************/
BOOL new_smb_io_printer_info_2(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_2 *info, int depth)
{
+ uint32 sec_offset;
prs_struct *ps=&buffer->prs;
prs_debug(ps, depth, desc, "new_smb_io_printer_info_2");
@@ -1798,7 +1790,7 @@ BOOL new_smb_io_printer_info_2(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_2 *i
if (!new_smb_io_relstr("parameters", buffer, depth, &info->parameters))
return False;
- if (!new_smb_io_relsecdesc("secdesc", buffer, depth, &info->secdesc))
+ if (!prs_uint32_pre("secdesc_ptr ", ps, depth, NULL, &sec_offset))
return False;
if (!prs_uint32("attributes", ps, depth, &info->attributes))
@@ -1818,6 +1810,12 @@ BOOL new_smb_io_printer_info_2(char *desc, NEW_BUFFER *buffer, PRINTER_INFO_2 *i
if (!prs_uint32("averageppm", ps, depth, &info->averageppm))
return False;
+ if (!prs_uint32_post("secdesc_ptr", ps, depth, NULL, sec_offset, info->secdesc ? prs_offset(ps) : 0 ))
+ return False;
+
+ if (!sec_io_desc("secdesc", &info->secdesc, ps, depth))
+ return False;
+
return True;
}