Error in rpc_parse/parse_samr.c ?

Eelco Vriezekolk eelco at nexus.com.na
Mon Jul 2 20:56:35 GMT 2001


Hello,

I hit the assert error in parse_samr.c line 1651, which I think is not 
correct in its current form:

--- parse_samr.c-orig   Mon Jul  2 21:34:49 2001
+++ parse_samr.c        Mon Jul  2 21:25:03 2001
@@ -1648,7 +1648,7 @@
         if(!prs_align(ps))
                 return False;

-       SMB_ASSERT_ARRAY(sam->sam, num_entries);
+       //SMB_ASSERT_ARRAY(sam->sam, num_entries);

         for (i = 0; i < num_entries; i++) {
                 if(!sam_io_sam_entry3("", &sam->sam[i], ps, depth))

Interesting enough, when I remove the ASSERT (and with my patch sent 
earlier today), the Nexus tools are able to successfully create an 
access control list entry. The first time that I make this work! This 
would indeed be very good news!

Gdb shows that num_entries is 2, and the first two elements of sam->sam 
seem to be normal to me. The definition of SMB_ASSERT_ARRAY is
    SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n))
In this case sizeof(sam->sam) == 4 (it being a pointer), and
sizeof(sam->sam[0]) == 28. Correct me if I am wrong, but I don't believe 
that there is a way to check that sam->sam indeed contains at least 
num_entries elements.

Could someone who understands the code better please check?

Regards,
-- 
Nexus Consultants cc, Eelco Vriezekolk <eelco at nexus.com.na>
Phone:  +264 61 252345     AOL IM: "vriezekolk"
Mobile: +264 81 2495182





More information about the samba-technical mailing list