[jcifs] getAccountName() alwyas return null

ralflizard ralfaro2002 at gmail.com
Wed Jul 27 15:23:11 MDT 2011


Hi,

I know this post is quite old, but we ran into the same problem using the
GetOwnerSid.patch to retrieve the owner SID of the file.  Once we got the
SID and tried to use any of the methods (getAccountName or getDomainName for
example) all we got was "null".

To solve this we added the following two lines (bold lines) to both the
getOwnerUser and getOwnerGroup methods that are added by the patch:

  public SID getOwnerUser() throws IOException {
    int f = open0(O_RDONLY, READ_CONTROL, 0, isDirectory() ? 1 : 0);

    /*
     * NtTrans Query Security Desc Request / Response
     */

    NtTransQuerySecurityDesc request = new NtTransQuerySecurityDesc(f,
0x01);
    NtTransQuerySecurityDescResponse response = new
NtTransQuerySecurityDescResponse();
    send(request, response);

    close(f, 0L);
    *String server = getServerWithDfs();
    response.securityDescriptor.owner_user.origin_server=server;*
    return response.securityDescriptor.owner_user;
  }

Regards,
Rafa.

--
View this message in context: http://samba.2283325.n4.nabble.com/getAccountName-alwyas-return-null-tp2515690p3699863.html
Sent from the Samba - jcifs mailing list archive at Nabble.com.


More information about the jCIFS mailing list