svn commit: samba r22062 - in branches: SAMBA_3_0/source/include
SAMBA_3_0/source/rpc_parse SAMBA_3_0/source/rpc_server
SAMBA_3_0/source/rpcclient SAMBA_3_0_25/source/include
SAMBA_3_0_25/source/rpc_parse SAMBA_3_0_25/source/rpc_server
SAMBA_3_0_25/source/rpcclient
jra at samba.org
jra at samba.org
Tue Apr 3 19:47:20 GMT 2007
Author: jra
Date: 2007-04-03 19:47:19 +0000 (Tue, 03 Apr 2007)
New Revision: 22062
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22062
Log:
Fix the parsing of info level 3. Flags is not a flags
field, but an offset. Fixed 64-bit display of ACLs on
printers.
Jeremy.
Modified:
branches/SAMBA_3_0/source/include/rpc_spoolss.h
branches/SAMBA_3_0/source/rpc_parse/parse_spoolss.c
branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c
branches/SAMBA_3_0/source/rpcclient/cmd_spoolss.c
branches/SAMBA_3_0_25/source/include/rpc_spoolss.h
branches/SAMBA_3_0_25/source/rpc_parse/parse_spoolss.c
branches/SAMBA_3_0_25/source/rpc_server/srv_spoolss_nt.c
branches/SAMBA_3_0_25/source/rpcclient/cmd_spoolss.c
Changeset:
Modified: branches/SAMBA_3_0/source/include/rpc_spoolss.h
===================================================================
--- branches/SAMBA_3_0/source/include/rpc_spoolss.h 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0/source/include/rpc_spoolss.h 2007-04-03 19:47:19 UTC (rev 22062)
@@ -961,7 +961,6 @@
typedef struct printer_info_3
{
- uint32 flags;
SEC_DESC *secdesc;
}
PRINTER_INFO_3;
Modified: branches/SAMBA_3_0/source/rpc_parse/parse_spoolss.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_parse/parse_spoolss.c 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_spoolss.c 2007-04-03 19:47:19 UTC (rev 22062)
@@ -2388,6 +2388,7 @@
BOOL smb_io_printer_info_3(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_3 *info, int depth)
{
+ uint32 offset = 0;
prs_struct *ps=&buffer->prs;
prs_debug(ps, depth, desc, "smb_io_printer_info_3");
@@ -2395,8 +2396,41 @@
buffer->struct_start=prs_offset(ps);
- if (!prs_uint32("flags", ps, depth, &info->flags))
- return False;
+ if (MARSHALLING(ps)) {
+ /* Ensure the SD is 8 byte aligned in the buffer. */
+ uint start = prs_offset(ps); /* Remember the start position. */
+ uint off_val = 0;
+
+ /* Write a dummy value. */
+ if (!prs_uint32("offset", ps, depth, &off_val))
+ return False;
+
+ /* 8 byte align. */
+ if (!prs_align_uint64(ps))
+ return False;
+
+ /* Remember where we must seek back to write the SD. */
+ offset = prs_offset(ps);
+
+ /* Calculate the real offset for the SD. */
+
+ off_val = offset - start;
+
+ /* Seek back to where we store the SD offset & store. */
+ prs_set_offset(ps, start);
+ if (!prs_uint32("offset", ps, depth, &off_val))
+ return False;
+
+ /* Return to after the 8 byte align. */
+ prs_set_offset(ps, offset);
+
+ } else {
+ if (!prs_uint32("offset", ps, depth, &offset))
+ return False;
+ /* Seek within the buffer. */
+ if (!prs_set_offset(ps, offset))
+ return False;
+ }
if (!sec_io_desc("sec_desc", &info->secdesc, ps, depth))
return False;
@@ -3143,9 +3177,8 @@
uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info)
{
- /* The 4 is for the self relative pointer.. */
- /* JRA !!!! TESTME - WHAT ABOUT prs_align.... !!! */
- return 4 + (uint32)sec_desc_size( info->secdesc );
+ /* The 8 is for the self relative pointer - 8 byte aligned.. */
+ return 8 + (uint32)sec_desc_size( info->secdesc );
}
/*******************************************************************
Modified: branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0/source/rpc_server/srv_spoolss_nt.c 2007-04-03 19:47:19 UTC (rev 22062)
@@ -4220,8 +4220,6 @@
/* These are the components of the SD we are returning. */
- printer->flags = 0x4;
-
if (ntprinter->info_2->secdesc_buf && ntprinter->info_2->secdesc_buf->sd_size != 0) {
/* don't use talloc_steal() here unless you do a deep steal of all
the SEC_DESC members */
Modified: branches/SAMBA_3_0/source/rpcclient/cmd_spoolss.c
===================================================================
--- branches/SAMBA_3_0/source/rpcclient/cmd_spoolss.c 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0/source/rpcclient/cmd_spoolss.c 2007-04-03 19:47:19 UTC (rev 22062)
@@ -276,8 +276,6 @@
static void display_print_info_3(PRINTER_INFO_3 *i3)
{
- printf("\tflags:[0x%x]\n", i3->flags);
-
display_sec_desc(i3->secdesc);
printf("\n");
@@ -2578,7 +2576,7 @@
goto done;
}
- if ( (ctr1.printers_3->flags != ctr1.printers_3->flags ) || !sec_desc_equal( sd1, sd2 ) ) {
+ if (!sec_desc_equal( sd1, sd2 ) ) {
printf("Security Descriptors *not* equal!\n");
result = False;
goto done;
Modified: branches/SAMBA_3_0_25/source/include/rpc_spoolss.h
===================================================================
--- branches/SAMBA_3_0_25/source/include/rpc_spoolss.h 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0_25/source/include/rpc_spoolss.h 2007-04-03 19:47:19 UTC (rev 22062)
@@ -961,7 +961,6 @@
typedef struct printer_info_3
{
- uint32 flags;
SEC_DESC *secdesc;
}
PRINTER_INFO_3;
Modified: branches/SAMBA_3_0_25/source/rpc_parse/parse_spoolss.c
===================================================================
--- branches/SAMBA_3_0_25/source/rpc_parse/parse_spoolss.c 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0_25/source/rpc_parse/parse_spoolss.c 2007-04-03 19:47:19 UTC (rev 22062)
@@ -2388,6 +2388,7 @@
BOOL smb_io_printer_info_3(const char *desc, RPC_BUFFER *buffer, PRINTER_INFO_3 *info, int depth)
{
+ uint32 offset = 0;
prs_struct *ps=&buffer->prs;
prs_debug(ps, depth, desc, "smb_io_printer_info_3");
@@ -2395,8 +2396,41 @@
buffer->struct_start=prs_offset(ps);
- if (!prs_uint32("flags", ps, depth, &info->flags))
- return False;
+ if (MARSHALLING(ps)) {
+ /* Ensure the SD is 8 byte aligned in the buffer. */
+ uint start = prs_offset(ps); /* Remember the start position. */
+ uint off_val = 0;
+
+ /* Write a dummy value. */
+ if (!prs_uint32("offset", ps, depth, &off_val))
+ return False;
+
+ /* 8 byte align. */
+ if (!prs_align_uint64(ps))
+ return False;
+
+ /* Remember where we must seek back to write the SD. */
+ offset = prs_offset(ps);
+
+ /* Calculate the real offset for the SD. */
+
+ off_val = offset - start;
+
+ /* Seek back to where we store the SD offset & store. */
+ prs_set_offset(ps, start);
+ if (!prs_uint32("offset", ps, depth, &off_val))
+ return False;
+
+ /* Return to after the 8 byte align. */
+ prs_set_offset(ps, offset);
+
+ } else {
+ if (!prs_uint32("offset", ps, depth, &offset))
+ return False;
+ /* Seek within the buffer. */
+ if (!prs_set_offset(ps, offset))
+ return False;
+ }
if (!sec_io_desc("sec_desc", &info->secdesc, ps, depth))
return False;
@@ -3143,9 +3177,8 @@
uint32 spoolss_size_printer_info_3(PRINTER_INFO_3 *info)
{
- /* The 4 is for the self relative pointer.. */
- /* JRA !!!! TESTME - WHAT ABOUT prs_align.... !!! */
- return 4 + (uint32)sec_desc_size( info->secdesc );
+ /* The 8 is for the self relative pointer - 8 byte aligned.. */
+ return 8 + (uint32)sec_desc_size( info->secdesc );
}
/*******************************************************************
Modified: branches/SAMBA_3_0_25/source/rpc_server/srv_spoolss_nt.c
===================================================================
--- branches/SAMBA_3_0_25/source/rpc_server/srv_spoolss_nt.c 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0_25/source/rpc_server/srv_spoolss_nt.c 2007-04-03 19:47:19 UTC (rev 22062)
@@ -4208,8 +4208,6 @@
/* These are the components of the SD we are returning. */
- printer->flags = 0x4;
-
if (ntprinter->info_2->secdesc_buf && ntprinter->info_2->secdesc_buf->len != 0) {
/* don't use talloc_steal() here unless you do a deep steal of all
the SEC_DESC members */
Modified: branches/SAMBA_3_0_25/source/rpcclient/cmd_spoolss.c
===================================================================
--- branches/SAMBA_3_0_25/source/rpcclient/cmd_spoolss.c 2007-04-03 18:32:25 UTC (rev 22061)
+++ branches/SAMBA_3_0_25/source/rpcclient/cmd_spoolss.c 2007-04-03 19:47:19 UTC (rev 22062)
@@ -276,8 +276,6 @@
static void display_print_info_3(PRINTER_INFO_3 *i3)
{
- printf("\tflags:[0x%x]\n", i3->flags);
-
display_sec_desc(i3->secdesc);
printf("\n");
@@ -2573,7 +2571,7 @@
goto done;
}
- if ( (ctr1.printers_3->flags != ctr1.printers_3->flags ) || !sec_desc_equal( sd1, sd2 ) ) {
+ if (!sec_desc_equal( sd1, sd2 ) ) {
printf("Security Descriptors *not* equal!\n");
result = False;
goto done;
More information about the samba-cvs
mailing list