diff options
-rw-r--r-- | source4/librpc/idl/spoolss.idl | 4 | ||||
-rw-r--r-- | source4/scripting/swig/torture/spoolss.py | 59 |
2 files changed, 55 insertions, 8 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl index 2724154935..e30be6844c 100644 --- a/source4/librpc/idl/spoolss.idl +++ b/source4/librpc/idl/spoolss.idl @@ -123,7 +123,7 @@ [relative] nstring *printprocessor; [relative] nstring *datatype; [relative] nstring *parameters; - [relative] security_descriptor *secdesc; + [relative,subcontext(0)] security_descriptor *secdesc; uint32 attributes; uint32 priority; uint32 defaultpriority; @@ -136,7 +136,7 @@ typedef struct { uint32 flags; - security_descriptor secdesc; + [subcontext(0)] security_descriptor secdesc; } spoolss_PrinterInfo3; typedef struct { diff --git a/source4/scripting/swig/torture/spoolss.py b/source4/scripting/swig/torture/spoolss.py index 240d815fb4..91e785ca75 100644 --- a/source4/scripting/swig/torture/spoolss.py +++ b/source4/scripting/swig/torture/spoolss.py @@ -6,7 +6,8 @@ def test_OpenPrinterEx(pipe, printer): print 'testing spoolss_OpenPrinterEx(%s)' % printer r = {} - r['printername'] = '\\\\win2k3dc\\%s' % printer + r['printername'] = '\\\\%s\\%s' % \ + (dcerpc.dcerpc_server_name(pipe), printer) r['datatype'] = None r['devmode_ctr'] = {} r['devmode_ctr']['size'] = 0 @@ -41,7 +42,9 @@ def test_GetPrinter(pipe, handle): r = {} r['handle'] = handle - for level in [1, 2, 3]: + for level in [0, 1, 2, 3, 4, 5, 6, 7]: + + print 'test_GetPrinter(level = %d)' % level r['level'] = level r['buffer'] = None @@ -49,8 +52,6 @@ def test_GetPrinter(pipe, handle): result = dcerpc.spoolss_GetPrinter(pipe, r) - print result - if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER: r['buffer'] = result['buf_size'] * '\x00' r['buf_size'] = result['buf_size'] @@ -59,6 +60,47 @@ def test_GetPrinter(pipe, handle): print result +def test_EnumForms(pipe, handle): + + print 'testing spoolss_EnumForms' + + r = {} + r['handle'] = handle + r['level'] = 1 + r['buffer'] = None + r['buf_size'] = 0 + + result = dcerpc.spoolss_EnumForms(pipe, r) + + if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER: + r['buffer'] = result['buf_size'] * '\x00' + r['buf_size'] = result['buf_size'] + + result = dcerpc.spoolss_EnumForms(pipe, r) + + print result + + +def test_EnumPorts(pipe, handle): + + print 'testing spoolss_EnumPorts' + + r = {} + r['handle'] = handle + r['level'] = 1 + r['buffer'] = None + r['buf_size'] = 0 + + result = dcerpc.spoolss_EnumPorts(pipe, r) + + if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER: + r['buffer'] = result['buf_size'] * '\x00' + r['buf_size'] = result['buf_size'] + + result = dcerpc.spoolss_EnumPorts(pipe, r) + + print result + def test_EnumPrinters(pipe): @@ -70,7 +112,9 @@ def test_EnumPrinters(pipe): r['flags'] = 0x02 r['server'] = None - for level in [1, 2, 4, 5]: + for level in [0, 1, 4, 5]: + + print 'test_EnumPrinters(level = %d)' % level r['level'] = level r['buf_size'] = 0 @@ -87,7 +131,10 @@ def test_EnumPrinters(pipe): printers = dcerpc.unmarshall_spoolss_PrinterInfo_array( result['buffer'], r['level'], result['count']) - if printer_names is None: + from pprint import pprint + pprint(printers) + + if level == 1: printer_names = map( lambda x: string.split(x['info1']['name'], ',')[0], printers) |