Ejemplo n.º 1
0
 def runTest(self):
     hnd = spoolss.openprinter(self.uncname)
     spoolss.closeprinter(hnd)
Ejemplo n.º 2
0
 def runTest(self):
     hnd = spoolss.openprinter("\\\\%s" % self.server["hostname"])
     spoolss.closeprinter(hnd)
Ejemplo n.º 3
0
    try:
        hnd = spoolss.openprinter(printername)
    except:
        print "error opening printer %s" % printername
        sys.exit(1)

    secdesc = hnd.getprinter(level=3)["security_descriptor"]

    print secdesc["owner_sid"]
    print secdesc["group_sid"]

    for acl in secdesc["dacl"]["ace_list"]:
        print "%d %d 0x%08x %s" % (acl["type"], acl["flags"], acl["mask"],
                                   acl["trustee"])

    spoolss.closeprinter(hnd)

    sys.exit(0)

# Set security descriptor

if op == "setsec":

    # Open printer

    try:
        hnd = spoolss.openprinter(printername,
                                  creds={
                                      "domain": "NPSD-TEST2",
                                      "username": "******",
                                      "password": "******"
Ejemplo n.º 4
0
    try:
        hnd = spoolss.openprinter(printername)
    except:
        print "error opening printer %s" % printername
        sys.exit(1)

    secdesc = hnd.getprinter(level = 3)["security_descriptor"]

    print secdesc["owner_sid"]
    print secdesc["group_sid"]

    for acl in secdesc["dacl"]["ace_list"]:
        print "%d %d 0x%08x %s" % (acl["type"], acl["flags"],
                                   acl["mask"], acl["trustee"])

    spoolss.closeprinter(hnd)

    sys.exit(0)

# Set security descriptor

if op == "setsec":

    # Open printer

    try:
        hnd = spoolss.openprinter(printername,
                                  creds = {"domain": "NPSD-TEST2",
                                           "username": "******",
                                           "password": "******"})
    except:
Ejemplo n.º 5
0
 def runTest(self):
     hnd = spoolss.openprinter("\\\\{0!s}".format(self.server["hostname"]))
     spoolss.closeprinter(hnd)
Ejemplo n.º 6
0
 def runTest(self):
     hnd = spoolss.openprinter("\\\\%s" % self.server["hostname"])
     spoolss.closeprinter(hnd)
Ejemplo n.º 7
0
 def runTest(self):
     hnd = spoolss.openprinter(self.uncname)
     spoolss.closeprinter(hnd)