Ejemplo n.º 1
0
from winsys import fs, security

full_control = security.ace ((security.me (), "F", "ALLOW"))

def take_control (f):
  f.take_ownership ()
  with f.security () as s:
    s.dacl.append (full_control)

start_from = fs.dir (raw_input ("Start from: "))
take_control (start_from)
for f in start_from.flat (includedirs=True):
  print f
  take_control (f)
Ejemplo n.º 2
0
from winsys import fs, security

full_control = security.ace((security.me(), "F", "ALLOW"))


def take_control(f):
    f.take_ownership()
    with f.security() as s:
        s.dacl.append(full_control)


start_from = fs.dir(raw_input("Start from: "))
take_control(start_from)
for f in start_from.flat(includedirs=True):
    print f
    take_control(f)
Ejemplo n.º 3
0
from __future__ import with_statement
from winsys import security, fs

f = fs.file("c:/temp/tim.txt")
with security.change_privileges([security.PRIVILEGE.TAKE_OWNERSHIP]):
    f.take_ownership()

assert f.security("O").owner == security.me()