<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.17092" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=&#23435;&#20307;>Hi Mike,</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;></FONT>&nbsp;</DIV>
<DIV><FONT face=&#23435;&#20307;>I tried to update the patch to adapt 
jcifs_1.3.15.</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;><FONT face=&#23435;&#20307;>Hoping that it will be helpful to&nbsp;others, 
I'm sending it to you.</FONT></FONT></DIV>
<DIV><FONT face=&#23435;&#20307;></FONT>&nbsp;</DIV>
<DIV><FONT face=&#23435;&#20307;>- GetOwnerSid_1.3.15.patch</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;></FONT>&nbsp;</DIV>
<DIV><FONT face=&#23435;&#20307;>Besides&nbsp;adapting to the latest version of JCIFS, 
</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;>fixed the ArrayIndexOutOfBoundsException problom by 
</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;>changing the position of "bufferIndex = start + 
daclOffset;".</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;></FONT>&nbsp;</DIV>
<DIV><FONT face=&#23435;&#20307;>I'm a newcomer of JCIFS, if there is something wrong with it, 
</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;>please point it to me.</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;></FONT>&nbsp;</DIV>
<DIV><FONT face=&#23435;&#20307;>Good Luck!</FONT></DIV>
<DIV><FONT face=&#23435;&#20307;></FONT>&nbsp;</DIV>
<DIV><FONT face=&#23435;&#20307;>Denny</FONT></DIV>
<DIV><FONT face=&#23435;&#20307; size=2><FONT size=3></FONT>&nbsp;</DIV></FONT>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 9pt &#23435;&#20307;">----- Original Message ----- </DIV>
  <DIV style="BACKGROUND: #e4e4e4; FONT: 9pt &#23435;&#20307;; font-color: black"><B>From:</B> 
  <A title=ioplex@gmail.com href="mailto:ioplex@gmail.com">Michael B Allen</A> 
  </DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>To:</B> <A title=tudoudpg@163.com 
  href="mailto:tudoudpg@163.com">zhangpeng</A> </DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>Cc:</B> <A title=jcifs@lists.samba.org 
  href="mailto:jcifs@lists.samba.org">jcifs@lists.samba.org</A> </DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>Sent:</B> Saturday, November 13, 2010 6:48 
  AM</DIV>
  <DIV style="FONT: 9pt &#23435;&#20307;"><B>Subject:</B> Re: [jcifs] Question about 
  GetOwnerSid.patch</DIV>
  <DIV><BR></DIV>Hi Denny,<BR><BR>I think that patch is quite old at this point. 
  You would have to go<BR>through it line-by-line and actually understand what 
  it's doing and<BR>apply the necessary changes to the latest version of JCIFS. 
  There<BR>currently are no plans to incorporate the GetOwnerSid patch. But 
  if<BR>you get it working, please post a new patch. It might help the 
  next<BR>person.<BR><BR>Mike<BR><BR>-- <BR>Michael B Allen<BR>Java Active 
  Directory Integration<BR><A 
  href="http://www.ioplex.com/">http://www.ioplex.com/</A><BR><BR>2010/11/10 
  zhangpeng &lt;<A 
  href="mailto:tudoudpg@163.com">tudoudpg@163.com</A>&gt;:<BR>&gt; 
  Hi<BR>&gt;<BR>&gt; I have a Java application which getting security 
  information and metadata of<BR>&gt; a file in windows platform. And the 
  owner's SID of a file is also requried.<BR>&gt;<BR>&gt; I found that jcifs has 
  a patch named GetOwnerSid.patch. So, I applied<BR>&gt; GetOwnerSid.patch to 
  jcifs-1.2.24.jar.<BR>&gt; It succeeded in getting the owner's SID, but another 
  problem is coming.<BR>&gt;<BR>&gt; When I use SmbFile.getShareSecurity() to 
  get the information of a share<BR>&gt; folder, ArrayIndexOutOfBoundsException 
  occurred.<BR>&gt; Before applying the patch, this exception did not 
  occur.<BR>&gt;<BR>&gt; It seems that there is some problem in 
  GetOwnerSid.patch.<BR>&gt; As below, the "bufferIndex" is changed in line 36, 
  so the offset of "size"<BR>&gt; and "numAces" (line 42, 44) become 
  wrong.<BR>&gt;<BR>&gt; -------<BR>&gt; 33 &gt; if ( ownerGOffset &gt; 0 ) 
  {<BR>&gt; 34 &gt; bufferIndex = start + ownerGOffset;<BR>&gt; 35 &gt; 
  owner_group = new SID ( buffer, bufferIndex );<BR>&gt; 36 &gt; bufferIndex += 
  28; // ???<BR>&gt; 37 &gt; }<BR>&gt; 38 &gt;<BR>&gt; 39 &gt; if ( daclOffset 
  &gt; 0 ) {<BR>&gt; 40 &gt; bufferIndex++; // revision<BR>&gt; 41 &gt; 
  bufferIndex++;<BR>&gt; 42 &gt; int size = 
  ServerMessageBlock.readInt2(buffer,<BR>&gt; bufferIndex);<BR>&gt; 43 &gt; 
  bufferIndex += 2;<BR>&gt; 44 &gt; int numAces = 
  ServerMessageBlock.readInt4(buffer,<BR>&gt; bufferIndex);<BR>&gt; 45 &gt; 
  bufferIndex += 4;<BR>&gt; -------<BR>&gt;<BR>&gt; I think that it will be 
  right as below. (Line 42: bufferIndex -&gt; daclOffset)<BR>&gt;<BR>&gt; 42 
  &gt; int size = ServerMessageBlock.readInt2(buffer,<BR>&gt; 
  daclOffset);<BR>&gt; ^^^^^^^^^^<BR>&gt; I'm sorry I'm not sure about this 
  problem, could you help me to resolve it?<BR>&gt;<BR>&gt; And I saw that this 
  patch has not been took to trunk, do you have a plan to<BR>&gt; do 
  this?<BR>&gt;<BR>&gt;<BR>&gt; Best Regards from 
Denny.<BR>&gt;<BR>&gt;</BLOCKQUOTE></BODY></HTML>