Deserialize ACL problem

I'm developing a custom security extension to Reporting services. In my authorization class I have a problem to deserialize the ACL (secDesc parameter). I have many examples and I’m doing the same excepted for one thing I’m not in form authentication but I’m in windows authentication.

The problem is in the method 'DeserializeAcl(byte[] ...)'.
I encounter this kind of bug :
BinaryFormatter versions incompatibility : Excpected version 1.0,
received version 880850475.24252454.

Thanx for your help



Answer this question

Deserialize ACL problem

  • ANDRIAMA

    was there ever an answer to Eric's question regarding de-serializing the secDesc content under Windows authentication

    -- /chris


  • ckimmel

    Dear Eric,

    Did you find a solution to this problem.

    I am experiencing the same issue.

    My report server sends a null security descriptor when try to access report manager/ reportserver through forms authentication.

    Also, this happens when I try to join a new instance of report server to an existing report server database.

    Sarit



  • Maksim Goleta

    Sorry but no. We stopped working on windows authentication with the extension. I designed the solution with using form authentication which is well documented.

    Eric


  • Shavona48

    The binary serializer used in the sample makes use of the assembly version of the the sample DLL.
    If you made changes to it and have your VS project set up to change the assembly number between builds you can get this error.
    Two solutions 1. write your own serialization code - it shouldn't be that hard, but it was not directly related to the sample, that's why we didn't include it in it.
    2. switch back to the original assembly version.

    -Tudor


  • Sequel

    Some more investigation from me…

    I switched my report server to Forms authentication.

    Then the secDesc parameter is nothing for the first call to the CheckAcces. It’s always for checking folder access (probably root folder).

    In Windows authentication, the secDesc parameter is set to something else (more than 400 bytes).

    I feel (pretty sure) that RS sends different information to the authorization extension depending of its authentication mode.

    Back to my original question, what is the content of the secDesc in Windows authentication How to convert it to an ACL reporting service object Is it possible

    Thanks
    Eric


  • Miles Whitener

    I’m trying to make my test very simple and there’s something I really don’t understand. Please look to what I did step by step:< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     

    -         First I reinstalled RS to restart from scratch (all default settings).

    -         I modified my security extension to raise an exception when entering the CreateSecurityDescriptor.

    -         I modified the GetPermissions to raise an exception also.

    -         I modified all the CheckAccess to deserialize the ACL when entering the function.

    -         I copied the extension and I configured it into the RS (pretty sure this is well done)

    -         Make an IISRESET

    -         And type the following URL in IE : localhost\reportserver

     

    Then  I get is (sorry my RS is in French):

    • Une erreur interne s'est produite sur le serveur de rapports. Pour plus d'informations, consultez le journal des erreurs. (rsInternalError) Obtenir de l'aide en ligne
      • Incompatibilite des versions BinaryFormatter. Version attendue 1.0. Version recue 880804864.1140850688.

    The error is the same described in previous post. With the debugger I can see that RS checks the access to a folder.  Probalby the root folder, I have nothing in my DB.

    I’m sure the
    CreateSecurityDescriptor and GetPermissions are not called yet (because the exceptions I placed are not raised).


    So I guess I try to unserialize the secDesc (AceCollection) installed by the reporting services setup program. It doesn’t work properly.


    Something I misunderstand here :) Please help me …


    Eric


  • Phillip Cave

    < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

    Thank you Tudor for the reply,

     

    I use the following code to serialize and to deserialize. The one I found in MDSN. This code is in my extension, so I don’t use any other library except the one for the BinaryFormatter and MemoryStream (the .net framework).  So I don’t understand what you mean by using the wrong library

     

    Can you confirm to me this code should work in Form authentication and in Windows authentication Then I will be sure this is me who serialized something incorrect in the reporting services database. I will reinstall RS and restart from scratch.

     

    Thank you,

     

    The code :

     

    Public Function CreateSecurityDescriptor(acl As AceCollection, itemType As SecurityItemType, _

       ByRef stringSecDesc As String) As Byte()

       ' Creates a memory stream and serializes the ACL for storage.

       Dim bf As New BinaryFormatter()

       Dim result As New MemoryStream()

       bf.Serialize(result, acl)

       stringSecDesc = Nothing

       Return result.GetBuffer()

    End Function 'CreateSecurityDescriptor

     

    Private Function DeserializeAcl(secDesc() As Byte) As AceCollection

       Dim bf As New BinaryFormatter()

       Dim sdStream As New MemoryStream(secDesc)

       Dim acl As AceCollection = CType(bf.Deserialize(sdStream), AceCollection)

       Return acl

    End Function 'DeserializeAcl


  • Deserialize ACL problem