ACLs

Discussion in 'Java' started by John Smith, Jun 8, 2006.

  1. John Smith

    John Smith Guest

    Is there a way in java of getting the access control lists of file in
    windows/linux, i.e. does user x have access to file y.

    Thanks

    Jon
     
    John Smith, Jun 8, 2006
    #1
    1. Advertising

  2. John Smith

    Chris Uppal Guest

    John Smith wrote:

    > Is there a way in java of getting the access control lists of file in
    > windows/linux, i.e. does user x have access to file y.


    Via JNI or by launching an external (native) program which will write the ACL
    info to stdout[*] which you can parse from your Java program.

    -- chris

    [*] I personally don't know of such a program in a standard Windows
    distribution, but that doesn't mean there isn't one. Perhaps in the reskits.
    Otherwise write your own.)
     
    Chris Uppal, Jun 8, 2006
    #2
    1. Advertising

  3. John Smith

    Rogan Dawes Guest

    Chris Uppal wrote:
    > John Smith wrote:
    >
    >> Is there a way in java of getting the access control lists of file in
    >> windows/linux, i.e. does user x have access to file y.

    >
    > Via JNI or by launching an external (native) program which will write the ACL
    > info to stdout[*] which you can parse from your Java program.
    >
    > -- chris
    >
    > [*] I personally don't know of such a program in a standard Windows
    > distribution, but that doesn't mean there isn't one. Perhaps in the reskits.
    > Otherwise write your own.)
    >
    >


    [*] cacls
     
    Rogan Dawes, Jun 8, 2006
    #3
  4. John Smith

    Chris Uppal Guest

    Rogan Dawes wrote:

    [me:]
    > > Via JNI or by launching an external (native) program which will write
    > > the ACL info to stdout[*] which you can parse from your Java program.


    > [*] cacls


    Cool, thanks.

    -- chris
     
    Chris Uppal, Jun 8, 2006
    #4
  5. John Smith

    Robert Mabee Guest

    John Smith wrote:
    > Is there a way in java of getting the access control lists of file in
    > windows/linux, i.e. does user x have access to file y.


    I consider it bad practice to try to duplicate the OS's algorithm for
    deciding access, since this is an area subject to OS/FS enhancements,
    and the access information itself may be hidden from non-root access.
    For example, suppose you hard-coded the original Unix check
    (owner/group/other) and then ran into the ACL extensions.

    In general, the only robust way to determine A can perform system
    call B is for A to go ahead and do it. I hate the style of making
    snooping calls to predict whether the payload call will work, as the
    payload call might still fail (for example, because of an external
    change happening in the timing window) but that failure is hard to
    test and the coder not likely to have coded for it properly.

    In your example, make a process that runs as user x and accesses
    file y (without damaging it) then reports its success ot failure.
     
    Robert Mabee, Jun 8, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Amiga

    Opening Shares and Setting ACLS in C#.

    Dan Amiga, Sep 19, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    Dan Amiga
    Sep 19, 2003
  2. Liet Kynes
    Replies:
    0
    Views:
    533
    Liet Kynes
    Nov 26, 2003
  3. cameron

    Setting ACLs in C# + ASPX

    cameron, Jul 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    527
    cameron
    Jul 27, 2004
  4. =?Utf-8?B?U2hlcndvb2Q=?=

    Use of ACLs possible with Forms authentication against AD?

    =?Utf-8?B?U2hlcndvb2Q=?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    395
    =?Utf-8?B?U2hlcndvb2Q=?=
    Jun 23, 2005
  5. Replies:
    0
    Views:
    505
Loading...

Share This Page