~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source4/torture/rpc/spoolss_win.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
*/
20
20
 
21
21
#include "includes.h"
22
 
#include "torture/torture.h"
23
 
#include "torture/rpc/rpc.h"
 
22
#include "torture/rpc/torture_rpc.h"
24
23
#include "librpc/gen_ndr/ndr_spoolss_c.h"
25
 
#include "rpc_server/dcerpc_server.h"
26
24
#include "librpc/gen_ndr/ndr_misc.h"
27
25
#include "ntvfs/ntvfs.h"
28
26
#include "param/param.h"
41
39
 
42
40
/* This is a convenience function for all OpenPrinterEx calls */
43
41
static bool test_OpenPrinterEx(struct torture_context *tctx,
44
 
                                struct dcerpc_pipe *p,
 
42
                                struct dcerpc_binding_handle *b,
45
43
                                struct policy_handle *handle,
46
44
                                const char *printer_name,
47
45
                                uint32_t access_mask)
68
66
        ul_1.minor                      = 3;
69
67
        ul_1.processor                  = 4567;
70
68
 
71
 
        status = dcerpc_spoolss_OpenPrinterEx(p, tctx, &op);
 
69
        status = dcerpc_spoolss_OpenPrinterEx_r(b, tctx, &op);
72
70
        torture_assert_ntstatus_ok(tctx, status, "OpenPrinterEx failed");
73
71
        torture_assert_werr_ok(tctx, op.out.result, "OpenPrinterEx failed");
74
72
 
76
74
}
77
75
 
78
76
static bool test_OpenPrinterAsAdmin(struct torture_context *tctx,
79
 
                                        struct dcerpc_pipe *p,
 
77
                                        struct dcerpc_binding_handle *b,
80
78
                                        const char *printername)
81
79
{
82
80
        NTSTATUS status;
107
105
        torture_comment(tctx, "Testing OpenPrinterEx(%s) with admin rights\n",
108
106
                        op.in.printername);
109
107
 
110
 
        status = dcerpc_spoolss_OpenPrinterEx(p, tctx, &op);
 
108
        status = dcerpc_spoolss_OpenPrinterEx_r(b, tctx, &op);
111
109
 
112
110
        if (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(op.out.result)) {
113
 
                status = dcerpc_spoolss_ClosePrinter(p, tctx, &cp);
 
111
                status = dcerpc_spoolss_ClosePrinter_r(b, tctx, &cp);
114
112
                torture_assert_ntstatus_ok(tctx, status, "ClosePrinter failed");
115
113
        }
116
114
 
118
116
}
119
117
 
120
118
 
121
 
static bool test_ClosePrinter(struct torture_context *tctx,
122
 
                                struct dcerpc_pipe *p,
123
 
                                struct policy_handle *handle);
124
119
 
125
120
/* This replicates the opening sequence of OpenPrinterEx calls XP does */
126
121
static bool test_OpenPrinterSequence(struct torture_context *tctx,
130
125
        bool ret;
131
126
        char *printername = talloc_asprintf(tctx, "\\\\%s",
132
127
                        dcerpc_server_name(p));
 
128
        struct dcerpc_binding_handle *b = p->binding_handle;
133
129
 
134
130
        /* First, see if we can open the printer read_only */
135
 
        ret = test_OpenPrinterEx(tctx, p, handle, printername, 0);
 
131
        ret = test_OpenPrinterEx(tctx, b, handle, printername, 0);
136
132
        torture_assert(tctx, ret == true, "OpenPrinterEx failed.");
137
133
 
138
 
        ret = test_ClosePrinter(tctx, p, handle);
 
134
        ret = test_ClosePrinter(tctx, b, handle);
139
135
        torture_assert(tctx, ret, "ClosePrinter failed");
140
136
 
141
137
        /* Now let's see if we have admin rights to it. */
142
 
        ret = test_OpenPrinterAsAdmin(tctx, p, printername);
 
138
        ret = test_OpenPrinterAsAdmin(tctx, b, printername);
143
139
        torture_assert(tctx, ret == true,
144
140
                        "OpenPrinterEx as admin failed unexpectedly.");
145
141
 
146
 
        ret = test_OpenPrinterEx(tctx, p, handle, printername, SERVER_EXECUTE);
 
142
        ret = test_OpenPrinterEx(tctx, b, handle, printername, SERVER_EXECUTE);
147
143
        torture_assert(tctx, ret == true, "OpenPrinterEx failed.");
148
144
 
149
145
        return true;
150
146
}
151
147
 
152
148
static bool test_GetPrinterData(struct torture_context *tctx,
153
 
                                struct dcerpc_pipe *p,
 
149
                                struct dcerpc_binding_handle *b,
154
150
                                struct policy_handle *handle,
155
151
                                const char *value_name,
156
152
                                WERROR expected_werr,
170
166
        gpd.out.type = &type;
171
167
        gpd.out.data = data;
172
168
 
173
 
        status = dcerpc_spoolss_GetPrinterData(p, tctx, &gpd);
 
169
        status = dcerpc_spoolss_GetPrinterData_r(b, tctx, &gpd);
174
170
        torture_assert_ntstatus_ok(tctx, status, "GetPrinterData failed.");
175
171
        torture_assert_werr_equal(tctx, gpd.out.result, expected_werr,
176
172
                        "GetPrinterData did not return expected error value.");
195
191
        uint32_t needed;
196
192
        uint32_t count;
197
193
        union spoolss_PrinterInfo *info;
 
194
        struct dcerpc_binding_handle *b = p->binding_handle;
198
195
 
199
196
        ep.in.flags = PRINTER_ENUM_NAME;
200
197
        ep.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
205
202
        ep.out.count = &count;
206
203
        ep.out.info = &info;
207
204
 
208
 
        status = dcerpc_spoolss_EnumPrinters(p, ctx, &ep);
 
205
        status = dcerpc_spoolss_EnumPrinters_r(b, ctx, &ep);
209
206
        torture_assert_ntstatus_ok(tctx, status, "EnumPrinters failed.");
210
207
 
211
208
        if (W_ERROR_EQUAL(ep.out.result, WERR_INSUFFICIENT_BUFFER)) {
212
209
                blob = data_blob_talloc_zero(ctx, needed);
213
210
                ep.in.buffer = &blob;
214
211
                ep.in.offered = needed;
215
 
                status = dcerpc_spoolss_EnumPrinters(p, ctx, &ep);
 
212
                status = dcerpc_spoolss_EnumPrinters_r(b, ctx, &ep);
216
213
                torture_assert_ntstatus_ok(tctx, status,"EnumPrinters failed.");
217
214
        }
218
215
 
227
224
}
228
225
 
229
226
static bool test_GetPrinter(struct torture_context *tctx,
230
 
                                struct dcerpc_pipe *p,
 
227
                                struct dcerpc_binding_handle *b,
231
228
                                struct policy_handle *handle,
232
229
                                struct test_spoolss_win_context *ctx,
233
230
                                uint32_t level,
246
243
        gp.in.offered = initial_blob_size;
247
244
        gp.out.needed = &needed;
248
245
 
249
 
        status = dcerpc_spoolss_GetPrinter(p, tctx, &gp);
 
246
        status = dcerpc_spoolss_GetPrinter_r(b, tctx, &gp);
250
247
        torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
251
248
 
252
249
        if (W_ERROR_EQUAL(gp.out.result, WERR_INSUFFICIENT_BUFFER)) {
253
250
                blob = data_blob_talloc_zero(ctx, needed);
254
251
                gp.in.buffer = &blob;
255
252
                gp.in.offered = needed;
256
 
                status = dcerpc_spoolss_GetPrinter(p, tctx, &gp);
 
253
                status = dcerpc_spoolss_GetPrinter_r(b, tctx, &gp);
257
254
                torture_assert_ntstatus_ok(tctx, status, "GetPrinter failed");
258
255
        }
259
256
 
270
267
}
271
268
 
272
269
static bool test_EnumJobs(struct torture_context *tctx,
273
 
                                struct dcerpc_pipe *p,
 
270
                                struct dcerpc_binding_handle *b,
274
271
                                struct policy_handle *handle)
275
272
{
276
273
        NTSTATUS status;
290
287
        ej.out.count = &count;
291
288
        ej.out.info = &info;
292
289
 
293
 
        status = dcerpc_spoolss_EnumJobs(p, tctx, &ej);
 
290
        status = dcerpc_spoolss_EnumJobs_r(b, tctx, &ej);
294
291
        torture_assert_ntstatus_ok(tctx, status, "EnumJobs failed");
295
292
        if (W_ERROR_EQUAL(ej.out.result, WERR_INSUFFICIENT_BUFFER)) {
296
293
                blob = data_blob_talloc_zero(tctx, needed);
297
294
                ej.in.offered = needed;
298
295
                ej.in.buffer = &blob;
299
 
                status = dcerpc_spoolss_EnumJobs(p, tctx, &ej);
 
296
                status = dcerpc_spoolss_EnumJobs_r(b, tctx, &ej);
300
297
                torture_assert_ntstatus_ok(tctx, status, "EnumJobs failed");
301
298
        }
302
299
        torture_assert_werr_ok(tctx, ej.out.result, "EnumJobs failed");
305
302
}
306
303
 
307
304
static bool test_GetPrinterDriver2(struct torture_context *tctx,
308
 
                                        struct dcerpc_pipe *p,
 
305
                                        struct dcerpc_binding_handle *b,
309
306
                                        struct test_spoolss_win_context *ctx,
310
307
                                        struct policy_handle *handle)
311
308
{
329
326
        gpd2.out.server_major_version = &server_major_version;
330
327
        gpd2.out.server_minor_version = &server_minor_version;
331
328
 
332
 
        status = dcerpc_spoolss_GetPrinterDriver2(p, tctx, &gpd2);
 
329
        status = dcerpc_spoolss_GetPrinterDriver2_r(b, tctx, &gpd2);
333
330
        torture_assert_ntstatus_ok(tctx, status, "GetPrinterDriver2 failed");
334
331
 
335
332
        if (ctx->printer_has_driver) {
341
338
}
342
339
 
343
340
static bool test_EnumForms(struct torture_context *tctx,
344
 
                                struct dcerpc_pipe *p,
 
341
                                struct dcerpc_binding_handle *b,
345
342
                                struct policy_handle *handle,
346
343
                                uint32_t initial_blob_size)
347
344
{
362
359
        ef.out.count = &count;
363
360
        ef.out.info = &info;
364
361
 
365
 
        status = dcerpc_spoolss_EnumForms(p, tctx, &ef);
 
362
        status = dcerpc_spoolss_EnumForms_r(b, tctx, &ef);
366
363
        torture_assert_ntstatus_ok(tctx, status, "EnumForms failed");
367
364
 
368
365
        if (W_ERROR_EQUAL(ef.out.result, WERR_INSUFFICIENT_BUFFER)) {
369
366
                blob = data_blob_talloc_zero(tctx, needed);
370
367
                ef.in.buffer = &blob;
371
368
                ef.in.offered = needed;
372
 
                status = dcerpc_spoolss_EnumForms(p, tctx, &ef);
 
369
                status = dcerpc_spoolss_EnumForms_r(b, tctx, &ef);
373
370
                torture_assert_ntstatus_ok(tctx, status, "EnumForms failed");
374
371
        }
375
372
 
379
376
}
380
377
 
381
378
static bool test_EnumPrinterKey(struct torture_context *tctx,
382
 
                                struct dcerpc_pipe *p,
 
379
                                struct dcerpc_binding_handle *b,
383
380
                                struct policy_handle *handle,
384
381
                                const char* key,
385
382
                                struct test_spoolss_win_context *ctx)
399
396
        epk.out.key_buffer = &key_buffer;
400
397
        epk.out._ndr_size = &_ndr_size;
401
398
 
402
 
        status = dcerpc_spoolss_EnumPrinterKey(p, tctx, &epk);
 
399
        status = dcerpc_spoolss_EnumPrinterKey_r(b, tctx, &epk);
403
400
        torture_assert_ntstatus_ok(tctx, status, "EnumPrinterKey failed");
404
401
 
405
402
        if (W_ERROR_EQUAL(epk.out.result, WERR_MORE_DATA)) {
406
403
                epk.in.offered = needed;
407
 
                status = dcerpc_spoolss_EnumPrinterKey(p, tctx, &epk);
 
404
                status = dcerpc_spoolss_EnumPrinterKey_r(b, tctx, &epk);
408
405
                torture_assert_ntstatus_ok(tctx, status,
409
406
                                "EnumPrinterKey failed");
410
407
        }
417
414
}
418
415
 
419
416
static bool test_EnumPrinterDataEx(struct torture_context *tctx,
420
 
                                        struct dcerpc_pipe *p,
 
417
                                        struct dcerpc_binding_handle *b,
421
418
                                        struct policy_handle *handle,
422
419
                                        const char *key,
423
420
                                        uint32_t initial_blob_size,
438
435
        epde.out.count = &count;
439
436
        epde.out.info = &info;
440
437
 
441
 
        status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &epde);
 
438
        status = dcerpc_spoolss_EnumPrinterDataEx_r(b, tctx, &epde);
442
439
        torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDataEx failed.");
443
440
        if (W_ERROR_EQUAL(epde.out.result, WERR_MORE_DATA)) {
444
441
                epde.in.offered = needed;
445
 
                status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &epde);
 
442
                status = dcerpc_spoolss_EnumPrinterDataEx_r(b, tctx, &epde);
446
443
                torture_assert_ntstatus_ok(tctx, status,
447
444
                                "EnumPrinterDataEx failed.");
448
445
        }
453
450
        return true;
454
451
}
455
452
 
456
 
static bool test_ClosePrinter(struct torture_context *tctx,
457
 
                                struct dcerpc_pipe *p,
458
 
                                struct policy_handle *handle)
459
 
{
460
 
        NTSTATUS status;
461
 
        struct spoolss_ClosePrinter cp;
462
 
 
463
 
        cp.in.handle  = handle;
464
 
        cp.out.handle = handle;
465
 
 
466
 
        status = dcerpc_spoolss_ClosePrinter(p, tctx, &cp);
467
 
        torture_assert_ntstatus_ok(tctx, status, "ClosePrinter failed");
468
 
 
469
 
        return true;
470
 
}
471
 
 
472
453
static bool test_WinXP(struct torture_context *tctx, struct dcerpc_pipe *p)
473
454
{
474
455
        bool ret = true;
479
460
        struct policy_handle unused_handle1, unused_handle2;
480
461
        char *server_name;
481
462
        uint32_t i;
 
463
        struct dcerpc_binding_handle *b = p->binding_handle;
482
464
 
483
465
        ntvfs_init(tctx->lp_ctx);
484
466
 
486
468
        tmp_ctx = talloc_zero(tctx, struct test_spoolss_win_context);
487
469
 
488
470
        ret &= test_OpenPrinterSequence(tctx, p, &handle01);
489
 
        ret &= test_GetPrinterData(tctx, p, &handle01,"UISingleJobStatusString",
 
471
        ret &= test_GetPrinterData(tctx, b, &handle01,"UISingleJobStatusString",
490
472
                        WERR_INVALID_PARAM, 0);
491
473
        torture_comment(tctx, "Skip RemoteFindNextPrinterChangeNotifyEx test\n");
492
474
 
493
475
        server_name = talloc_asprintf(ctx, "\\\\%s", dcerpc_server_name(p));
494
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle1, server_name, 0);
 
476
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle1, server_name, 0);
495
477
 
496
478
        ret &= test_EnumPrinters(tctx, p, ctx, 1024);
497
479
 
498
 
        ret &= test_OpenPrinterEx(tctx, p, &handle02, server_name, 0);
499
 
        ret &= test_GetPrinterData(tctx, p, &handle02, "MajorVersion", WERR_OK,
 
480
        ret &= test_OpenPrinterEx(tctx, b, &handle02, server_name, 0);
 
481
        ret &= test_GetPrinterData(tctx, b, &handle02, "MajorVersion", WERR_OK,
500
482
                        3);
501
 
        ret &= test_ClosePrinter(tctx, p, &handle02);
 
483
        ret &= test_ClosePrinter(tctx, b, &handle02);
502
484
 
503
485
        /* If no printers were found, skip all tests that need a printer */
504
486
        if (ctx->printer_count == 0) {
505
487
                goto end_testWinXP;
506
488
        }
507
489
 
508
 
        ret &= test_OpenPrinterEx(tctx, p, &handle02,
 
490
        ret &= test_OpenPrinterEx(tctx, b, &handle02,
509
491
                        ctx->printer_info[0].info2.printername,
510
492
                        PRINTER_ACCESS_USE);
511
 
        ret &= test_GetPrinter(tctx, p, &handle02, ctx, 2, 0);
 
493
        ret &= test_GetPrinter(tctx, b, &handle02, ctx, 2, 0);
512
494
 
513
495
        torture_assert_str_equal(tctx, ctx->current_info->info2.printername,
514
496
                        ctx->printer_info[0].info2.printername,
515
497
                        "GetPrinter returned unexpected printername");
516
498
        /*FIXME: Test more components of the PrinterInfo2 struct */
517
499
 
518
 
        ret &= test_OpenPrinterEx(tctx, p, &handle03,
519
 
                        ctx->printer_info[0].info2.printername, 0);
520
 
        ret &= test_GetPrinter(tctx, p, &handle03, ctx, 0, 1164);
521
 
        ret &= test_GetPrinter(tctx, p, &handle03, ctx, 2, 0);
522
 
 
523
 
        ret &= test_OpenPrinterEx(tctx, p, &handle04,
524
 
                        ctx->printer_info[0].info2.printername, 0);
525
 
        ret &= test_GetPrinter(tctx, p, &handle04, ctx, 2, 0);
526
 
        ret &= test_ClosePrinter(tctx, p, &handle04);
527
 
 
528
 
        ret &= test_OpenPrinterEx(tctx, p, &handle04,
529
 
                        ctx->printer_info[0].info2.printername, 0);
530
 
        ret &= test_GetPrinter(tctx, p, &handle04, ctx, 2, 4096);
531
 
        ret &= test_ClosePrinter(tctx, p, &handle04);
532
 
 
533
 
        ret &= test_OpenPrinterAsAdmin(tctx, p,
 
500
        ret &= test_OpenPrinterEx(tctx, b, &handle03,
 
501
                        ctx->printer_info[0].info2.printername, 0);
 
502
        ret &= test_GetPrinter(tctx, b, &handle03, ctx, 0, 1164);
 
503
        ret &= test_GetPrinter(tctx, b, &handle03, ctx, 2, 0);
 
504
 
 
505
        ret &= test_OpenPrinterEx(tctx, b, &handle04,
 
506
                        ctx->printer_info[0].info2.printername, 0);
 
507
        ret &= test_GetPrinter(tctx, b, &handle04, ctx, 2, 0);
 
508
        ret &= test_ClosePrinter(tctx, b, &handle04);
 
509
 
 
510
        ret &= test_OpenPrinterEx(tctx, b, &handle04,
 
511
                        ctx->printer_info[0].info2.printername, 0);
 
512
        ret &= test_GetPrinter(tctx, b, &handle04, ctx, 2, 4096);
 
513
        ret &= test_ClosePrinter(tctx, b, &handle04);
 
514
 
 
515
        ret &= test_OpenPrinterAsAdmin(tctx, b,
534
516
                        ctx->printer_info[0].info2.printername);
535
517
 
536
 
        ret &= test_OpenPrinterEx(tctx, p, &handle04,
 
518
        ret &= test_OpenPrinterEx(tctx, b, &handle04,
537
519
                        ctx->printer_info[0].info2.printername, PRINTER_READ);
538
 
        ret &= test_GetPrinterData(tctx, p, &handle04,"UISingleJobStatusString",
 
520
        ret &= test_GetPrinterData(tctx, b, &handle04,"UISingleJobStatusString",
539
521
                        WERR_BADFILE, 0);
540
522
        torture_comment(tctx, "Skip RemoteFindNextPrinterChangeNotifyEx test\n");
541
523
 
542
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
 
524
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
543
525
                        ctx->printer_info[0].info2.printername, 0);
544
526
 
545
 
        ret &= test_EnumJobs(tctx, p, &handle04);
546
 
        ret &= test_GetPrinter(tctx, p, &handle04, ctx, 2, 4096);
 
527
        ret &= test_EnumJobs(tctx, b, &handle04);
 
528
        ret &= test_GetPrinter(tctx, b, &handle04, ctx, 2, 4096);
547
529
 
548
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle2);
549
 
        ret &= test_ClosePrinter(tctx, p, &handle04);
 
530
        ret &= test_ClosePrinter(tctx, b, &unused_handle2);
 
531
        ret &= test_ClosePrinter(tctx, b, &handle04);
550
532
 
551
533
        ret &= test_EnumPrinters(tctx, p, ctx, 1556);
552
 
        ret &= test_GetPrinterDriver2(tctx, p, ctx, &handle03);
553
 
        ret &= test_EnumForms(tctx, p, &handle03, 0);
 
534
        ret &= test_GetPrinterDriver2(tctx, b, ctx, &handle03);
 
535
        ret &= test_EnumForms(tctx, b, &handle03, 0);
554
536
 
555
 
        ret &= test_EnumPrinterKey(tctx, p, &handle03, "", ctx);
 
537
        ret &= test_EnumPrinterKey(tctx, b, &handle03, "", ctx);
556
538
 
557
539
        for (i=0; ctx->printer_keys && ctx->printer_keys[i] != NULL; i++) {
558
540
 
559
 
                ret &= test_EnumPrinterKey(tctx, p, &handle03,
 
541
                ret &= test_EnumPrinterKey(tctx, b, &handle03,
560
542
                                           ctx->printer_keys[i],
561
543
                                           tmp_ctx);
562
 
                ret &= test_EnumPrinterDataEx(tctx, p, &handle03,
 
544
                ret &= test_EnumPrinterDataEx(tctx, b, &handle03,
563
545
                                              ctx->printer_keys[i], 0,
564
546
                                              WERR_OK);
565
547
        }
566
548
 
567
 
        ret &= test_EnumPrinterDataEx(tctx, p, &handle03, "", 0,
 
549
        ret &= test_EnumPrinterDataEx(tctx, b, &handle03, "", 0,
568
550
                        WERR_INVALID_PARAM);
569
551
 
570
 
        ret &= test_GetPrinter(tctx, p, &handle03, tmp_ctx, 2, 0);
571
 
 
572
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
573
 
                        ctx->printer_info[0].info2.printername, 0);
574
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle2);
575
 
 
576
 
        ret &= test_GetPrinter(tctx, p, &handle03, tmp_ctx, 2, 2556);
577
 
 
578
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
579
 
                        ctx->printer_info[0].info2.printername, 0);
580
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle2);
581
 
 
582
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
583
 
                        ctx->printer_info[0].info2.printername, 0);
584
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle2);
585
 
 
586
 
        ret &= test_GetPrinter(tctx, p, &handle03, tmp_ctx, 7, 0);
587
 
 
588
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
589
 
                        ctx->printer_info[0].info2.printername, 0);
590
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle2);
591
 
 
592
 
        ret &= test_ClosePrinter(tctx, p, &handle03);
593
 
 
594
 
        ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
595
 
                        ctx->printer_info[0].info2.printername, 0);
596
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle2);
597
 
 
598
 
        ret &= test_OpenPrinterEx(tctx, p, &handle03, server_name, 0);
599
 
        ret &= test_GetPrinterData(tctx, p, &handle03, "W3SvcInstalled",
 
552
        ret &= test_GetPrinter(tctx, b, &handle03, tmp_ctx, 2, 0);
 
553
 
 
554
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
 
555
                        ctx->printer_info[0].info2.printername, 0);
 
556
        ret &= test_ClosePrinter(tctx, b, &unused_handle2);
 
557
 
 
558
        ret &= test_GetPrinter(tctx, b, &handle03, tmp_ctx, 2, 2556);
 
559
 
 
560
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
 
561
                        ctx->printer_info[0].info2.printername, 0);
 
562
        ret &= test_ClosePrinter(tctx, b, &unused_handle2);
 
563
 
 
564
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
 
565
                        ctx->printer_info[0].info2.printername, 0);
 
566
        ret &= test_ClosePrinter(tctx, b, &unused_handle2);
 
567
 
 
568
        ret &= test_GetPrinter(tctx, b, &handle03, tmp_ctx, 7, 0);
 
569
 
 
570
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
 
571
                        ctx->printer_info[0].info2.printername, 0);
 
572
        ret &= test_ClosePrinter(tctx, b, &unused_handle2);
 
573
 
 
574
        ret &= test_ClosePrinter(tctx, b, &handle03);
 
575
 
 
576
        ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
 
577
                        ctx->printer_info[0].info2.printername, 0);
 
578
        ret &= test_ClosePrinter(tctx, b, &unused_handle2);
 
579
 
 
580
        ret &= test_OpenPrinterEx(tctx, b, &handle03, server_name, 0);
 
581
        ret &= test_GetPrinterData(tctx, b, &handle03, "W3SvcInstalled",
600
582
                        WERR_OK, 0);
601
 
        ret &= test_ClosePrinter(tctx, p, &handle03);
602
 
 
603
 
        ret &= test_ClosePrinter(tctx, p, &unused_handle1);
604
 
        ret &= test_ClosePrinter(tctx, p, &handle02);
605
 
 
606
 
        ret &= test_OpenPrinterEx(tctx, p, &handle02,
 
583
        ret &= test_ClosePrinter(tctx, b, &handle03);
 
584
 
 
585
        ret &= test_ClosePrinter(tctx, b, &unused_handle1);
 
586
        ret &= test_ClosePrinter(tctx, b, &handle02);
 
587
 
 
588
        ret &= test_OpenPrinterEx(tctx, b, &handle02,
607
589
                        ctx->printer_info[0].info2.sharename, 0);
608
 
        ret &= test_GetPrinter(tctx, p, &handle02, tmp_ctx, 2, 0);
609
 
        ret &= test_ClosePrinter(tctx, p, &handle02);
 
590
        ret &= test_GetPrinter(tctx, b, &handle02, tmp_ctx, 2, 0);
 
591
        ret &= test_ClosePrinter(tctx, b, &handle02);
610
592
 
611
593
end_testWinXP:
612
 
        ret &= test_ClosePrinter(tctx, p, &handle01);
 
594
        ret &= test_ClosePrinter(tctx, b, &handle01);
613
595
 
614
596
        talloc_free(tmp_ctx);
615
597
        talloc_free(ctx);
618
600
 
619
601
struct torture_suite *torture_rpc_spoolss_win(TALLOC_CTX *mem_ctx)
620
602
{
621
 
        struct torture_suite *suite = torture_suite_create(mem_ctx, "SPOOLSS-WIN");
 
603
        struct torture_suite *suite = torture_suite_create(mem_ctx, "spoolss.win");
622
604
 
623
605
        struct torture_rpc_tcase *tcase = torture_suite_add_rpc_iface_tcase(suite, 
624
606
                                                        "win", &ndr_table_spoolss);