Change directory permission under windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • __schronos__

    #1

    Change directory permission under windows

    Hi.

    I would like to add users with full control access to a directory. I
    can do it to a file in the following way:

    info=win32secur ity.DACL_SECURI TY_INFORMATION
    sd=win32securit y.GetFileSecuri ty(DIR, info)
    acl=sd.GetSecur ityDescriptorDa cl()
    sidUser=win32se curity.LookupAc countName(None, USER)[0]
    acl.AddAccessAl lowedAce(win32f ile.FILE_ALL_AC CESS, sidUser)
    sd.SetSecurityD escriptorDacl(1 , acl, 0)
    win32security.S etFileSecurity( dir, info, sd)

    and it work correctly, but if I try to do the same to a directory only
    the "special permission" checkbox is checked and this is not useful to
    me because I need a "full control" so that files under the directory
    can inheritage the directory rigths.

    Can anybody help me

    Thank's

  • Roger Upole

    #2
    Re: Change directory permission under windows


    __schronos__ wrote:
    Hi.
    >
    I would like to add users with full control access to a directory. I
    can do it to a file in the following way:
    >
    info=win32secur ity.DACL_SECURI TY_INFORMATION
    sd=win32securit y.GetFileSecuri ty(DIR, info)
    acl=sd.GetSecur ityDescriptorDa cl()
    sidUser=win32se curity.LookupAc countName(None, USER)[0]
    acl.AddAccessAl lowedAce(win32f ile.FILE_ALL_AC CESS, sidUser)
    sd.SetSecurityD escriptorDacl(1 , acl, 0)
    win32security.S etFileSecurity( dir, info, sd)
    >
    and it work correctly, but if I try to do the same to a directory only
    the "special permission" checkbox is checked and this is not useful to
    me because I need a "full control" so that files under the directory
    can inheritage the directory rigths.
    >
    Can anybody help me
    >
    Thank's
    >
    AddAccessAllowe dAce doesn't have a parm for inheritance flags.
    Try AddAccessAllowe dAceEx instead:

    acl.AddAccessAl lowedAceEx(win3 2security.ACL_R EVISION_DS,
    win32security.O BJECT_INHERIT_A CE|win32securit y.CONTAINER_INH ERIT_ACE,
    win32file.FILE_ ALL_ACCESS, sidUser)

    Roger



    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

    Comment

    Working...