Ignore:
Timestamp:
May 13, 2014, 11:39:04 AM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update trunk to 3.6.23

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/torture/ndr/ntprinting.c

    r752 r862  
    2323#include "librpc/gen_ndr/ndr_ntprinting.h"
    2424#include "torture/ndr/proto.h"
     25#include "param/param.h"
    2526
    2627static const uint8_t ntprinting_printer_data[] = {
     
    297298};
    298299
     300static const uint8_t ntprinting_printer_data_latin1[] = {
     301        0x48, 0x1a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
     302        0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     303        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     304        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     305        0x94, 0x46, 0x50, 0x0e, 0x00, 0x00, 0x00, 0x00,
     306        0x94, 0xee, 0xb9, 0x50, 0x00, 0x53, 0x30, 0x42,
     307        0x43, 0x00, 0x53, 0x30, 0x42, 0x43, 0x00, 0x53,
     308        0x61, 0x6d, 0x62, 0x61, 0x20, 0x50, 0x72, 0x69,
     309        0x6e, 0x74, 0x65, 0x72, 0x20, 0x50, 0x6f, 0x72,
     310        0x74, 0x00, 0x48, 0x50, 0x20, 0x44, 0x65, 0x73,
     311        0x69, 0x67, 0x6e, 0x6a, 0x65, 0x74, 0x20, 0x38,
     312        0x30, 0x30, 0x50, 0x53, 0x20, 0x34, 0x32, 0x20,
     313        0x62, 0x79, 0x20, 0x48, 0x50, 0x00, 0x22, 0x20,
     314        0x53, 0x41, 0x4c, 0x41, 0x20, 0x44, 0x41, 0x20,
     315        0x52, 0x45, 0x43, 0x45, 0x50, 0xc7, 0xc3, 0x4f,
     316        0x20, 0x44, 0x41, 0x20, 0x43, 0x4f, 0x4e, 0x53,
     317        0x54, 0x52, 0x55, 0xc7, 0xc3, 0x4f, 0x20, 0x2d,
     318        0x20, 0x52, 0x41, 0x4e, 0x44, 0x30, 0x20, 0x4c,
     319        0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x00, 0x55,
     320        0x54, 0x47, 0x43, 0x41, 0x20, 0x00, 0x00, 0x77,
     321        0x69, 0x6e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00,
     322        0x52, 0x41, 0x57, 0x00, 0x00, 0x01, 0x00, 0x00,
     323        0x00, 0x5c, 0x5c, 0x4c, 0x4f, 0x43, 0x41, 0x4c,
     324        0x48, 0x4f, 0x53, 0x54, 0x5c, 0x53, 0x30, 0x42,
     325        0x43, 0x00, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72,
     326        0x00, 0x01, 0x04, 0x00, 0x04, 0xdc, 0x00, 0x00,
     327        0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
     328        0x00, 0x64, 0x00, 0x01, 0x00, 0x0f, 0x00, 0xfc,
     329        0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
     330        0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x47, 0x01,
     331        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     332        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     333        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     334        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     335        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     336        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     337        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     338        0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69,
     339        0x6e, 0x74, 0x65, 0x72, 0x44, 0x72, 0x69, 0x76,
     340        0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00,
     341        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
     342        0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74,
     343        0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
     344        0x44, 0x61, 0x74, 0x61, 0x5c, 0x44, 0x72, 0x76,
     345        0x50, 0x61, 0x70, 0x65, 0x72, 0x53, 0x74, 0x61,
     346        0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x00, 0x04,
     347        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x61,
     348        0xc2, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x50,
     349        0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x44, 0x72,
     350        0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61,
     351        0x5c, 0x44, 0x72, 0x76, 0x44, 0x65, 0x76, 0x4d,
     352        0x6f, 0x64, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00,
     353        0x42, 0x02, 0x00, 0x00, 0x31, 0x00, 0x3b, 0x00,
     354        0x31, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x36, 0x00,
     355        0x36, 0x00, 0x3b, 0x00, 0x2d, 0x00, 0x33, 0x00,
     356        0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x31, 0x00,
     357        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     358        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     359        0x31, 0x00, 0x30, 0x00, 0x37, 0x00, 0x33, 0x00,
     360        0x37, 0x00, 0x34, 0x00, 0x31, 0x00, 0x39, 0x00,
     361        0x30, 0x00, 0x35, 0x00, 0x3b, 0x00, 0x30, 0x00,
     362        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x30, 0x00,
     363        0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x35, 0x00,
     364        0x30, 0x00, 0x3b, 0x00, 0x34, 0x00, 0x3b, 0x00,
     365        0x35, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     366        0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3b, 0x00,
     367        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     368        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     369        0x32, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x3b, 0x00,
     370        0x32, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     371        0x31, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     372        0x30, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x36, 0x00,
     373        0x32, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x30, 0x00,
     374        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x36, 0x00,
     375        0x37, 0x00, 0x37, 0x00, 0x37, 0x00, 0x32, 0x00,
     376        0x31, 0x00, 0x36, 0x00, 0x3b, 0x00, 0x30, 0x00,
     377        0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x30, 0x00,
     378        0x3b, 0x00, 0x31, 0x00, 0x36, 0x00, 0x3b, 0x00,
     379        0x32, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x32, 0x00,
     380        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     381        0x31, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     382        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     383        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     384        0x31, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     385        0x34, 0x00, 0x3b, 0x00, 0x36, 0x00, 0x35, 0x00,
     386        0x35, 0x00, 0x33, 0x00, 0x35, 0x00, 0x3b, 0x00,
     387        0x32, 0x00, 0x36, 0x00, 0x33, 0x00, 0x31, 0x00,
     388        0x37, 0x00, 0x32, 0x00, 0x3b, 0x00, 0x30, 0x00,
     389        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x31, 0x00,
     390        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x37, 0x00,
     391        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x32, 0x00,
     392        0x37, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     393        0x30, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x3b, 0x00,
     394        0x31, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     395        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     396        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     397        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     398        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     399        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     400        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     401        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     402        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     403        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     404        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     405        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     406        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     407        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     408        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     409        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     410        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     411        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     412        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     413        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     414        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     415        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     416        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     417        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     418        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     419        0x34, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     420        0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00,
     421        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
     422        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
     423        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
     424        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x30, 0x00,
     425        0x3b, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x01, 0x00,
     426        0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65,
     427        0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44,
     428        0x61, 0x74, 0x61, 0x5c, 0x44, 0x72, 0x76, 0x45,
     429        0x57, 0x53, 0x49, 0x50, 0x00, 0x01, 0x00, 0x00,
     430        0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
     431        0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f,
     432        0x6f, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00,
     433        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
     434        0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c,
     435        0x65, 0x72, 0x5c, 0x70, 0x72, 0x69, 0x6e, 0x74,
     436        0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01,
     437        0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x53,
     438        0x00, 0x30, 0x00, 0x42, 0x00, 0x43, 0x00, 0x00,
     439        0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53,
     440        0x70, 0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x73,
     441        0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d,
     442        0x65, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00,
     443        0x00, 0x00, 0x53, 0x00, 0x36, 0x00, 0x30, 0x00,
     444        0x32, 0x00, 0x30, 0x00, 0x50, 0x00, 0x53, 0x00,
     445        0x36, 0x00, 0x36, 0x00, 0x00, 0x00, 0x01, 0x00,
     446        0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f,
     447        0x6c, 0x65, 0x72, 0x5c, 0x73, 0x68, 0x6f, 0x72,
     448        0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e,
     449        0x61, 0x6d, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00,
     450        0x14, 0x00, 0x00, 0x00, 0x53, 0x00, 0x36, 0x00,
     451        0x30, 0x00, 0x32, 0x00, 0x30, 0x00, 0x50, 0x00,
     452        0x53, 0x00, 0x36, 0x00, 0x36, 0x00, 0x00, 0x00,
     453        0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70,
     454        0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x75, 0x4e,
     455        0x43, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01, 0x00,
     456        0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5c, 0x00,
     457        0x5c, 0x00, 0x53, 0x00, 0x36, 0x00, 0x30, 0x00,
     458        0x32, 0x00, 0x30, 0x00, 0x50, 0x00, 0x53, 0x00,
     459        0x36, 0x00, 0x36, 0x00, 0x5c, 0x00, 0x53, 0x00,
     460        0x30, 0x00, 0x42, 0x00, 0x43, 0x00, 0x00, 0x00,
     461        0x00, 0x00, 0x00, 0x00
     462};
     463
    299464static bool ntprinting_printer_check(struct torture_context *tctx,
    300465                                     struct ntprinting_printer *r)
     
    422587}
    423588
     589static bool ntprinting_printer_latin1_check(struct torture_context *tctx)
     590{
     591        enum ndr_err_code ndr_err;
     592        struct ntprinting_printer r;
     593        DATA_BLOB blob;
     594        bool ok;
     595
     596        ok = lpcfg_do_global_parameter(tctx->lp_ctx, "dos charset", "CP1252");
     597        if (!ok) {
     598                torture_comment(tctx, "Could not set 'dos charset' option.\n");
     599                return false;
     600        }
     601        reload_charcnv(tctx->lp_ctx);
     602
     603        ZERO_STRUCT(r);
     604        r.info.string_flags = LIBNDR_FLAG_STR_ASCII;
     605
     606        blob = data_blob_const(ntprinting_printer_data_latin1,
     607                               sizeof(ntprinting_printer_data_latin1));
     608
     609        ndr_err = ndr_pull_struct_blob(&blob, tctx, &r,
     610                   (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer);
     611
     612        torture_assert_ndr_success(tctx,
     613                                   ndr_err,
     614                                   "ndr_pull_ntprinting_printer");
     615#if 0
     616        ndr_print_debug((ndr_print_fn_t) ndr_print_ntprinting_printer,
     617                        "ntprinter",
     618                        &r);
     619#endif
     620        torture_assert_str_equal(tctx,
     621                                 r.info.printername,
     622                                 "S0BC",
     623                                 "printername");
     624        /* latin1 encoding check */
     625        torture_assert_str_equal(tctx,
     626                                 r.info.comment,
     627                                 "\" SALA DA RECEPÇÃO DA CONSTRUÇÃO - RAND0 LOCATIO",
     628                                 "comment");
     629        torture_assert_str_equal(tctx,
     630                                 r.info.location,
     631                                 "UTGCA ",
     632                                 "location");
     633
     634        return true;
     635}
     636
    424637struct torture_suite *ndr_ntprinting_suite(TALLOC_CTX *ctx)
    425638{
    426639        struct torture_suite *suite = torture_suite_create(ctx, "ntprinting");
     640
     641        torture_suite_add_simple_test(suite,
     642                                      "ntprinting latin1 check",
     643                                      ntprinting_printer_latin1_check);
    427644
    428645        torture_suite_add_ndr_pull_test(suite,
Note: See TracChangeset for help on using the changeset viewer.