RE: file() and Win32 security attributes

Discussion in 'Python' started by Tim Golden, Feb 27, 2004.

  1. Tim Golden

    Tim Golden Guest

    GK> how can I force file() to create files that
    GK> have "ALL ACCESS FOR EVERYONE" security attributes? Other than by a
    GK> major rewrite of my existing code modules replacing the existing
    GK> "native-python" code by win32file / win32security calls?

    In short, I don't believe you can (other than reworking the necessary
    Python module source and rebuilding...). However (and I'm not an NT
    security guru by any means) I think you can up permissions so that the
    files in a directory inherit the folder's permissions. This won't of
    course help you if you want to create files in arbitrary directories.

    >In case you're wondering what is happening here:
    >
    >- user A with admin rights logs on to NT and uses python to create a
    >file
    >- user A logs off
    >- user B without admin rights logs on to NT and uses python to access
    >said file -> doesn't work, because B has no admin rights and cannot
    >access files created by an administrator.


    Strictly, it doesn't matter who the file is created by, but rather
    what permissions it acquires during its creation. (The ownership
    might matter as a tie-breaker but I'm not sure what happens if an
    administrator removes my permissions on a file which I own).

    I do have a rough-edged nt_security module (based on the win32all/pywin32
    stuff)
    which does something to simplify ACL maintenance. If you're interested, let
    me
    know.

    TJG

    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star Internet. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
     
    Tim Golden, Feb 27, 2004
    #1
    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. David Bear

    win32 file attributes

    David Bear, Aug 28, 2003, in forum: Python
    Replies:
    2
    Views:
    617
    Tim Golden
    Aug 29, 2003
  2. Gerson Kurz

    file() and Win32 security attributes

    Gerson Kurz, Feb 26, 2004, in forum: Python
    Replies:
    8
    Views:
    579
    Josiah Carlson
    Feb 29, 2004
  3. P4trykx
    Replies:
    2
    Views:
    1,834
    bruce barker
    Jan 31, 2007
  4. Ziv Tepman
    Replies:
    0
    Views:
    70
    Ziv Tepman
    Jan 21, 2014
  5. Ziv Tepman
    Replies:
    0
    Views:
    87
    Ziv Tepman
    Jan 21, 2014
Loading...

Share This Page