Changeset 746 for vendor/current/source4
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- Location:
- vendor/current/source4
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/auth/credentials/credentials_ntlm.c
r740 r746 111 111 *flags &= ~CLI_CRED_LANMAN_AUTH; 112 112 } else if (*flags & CLI_CRED_NTLM2) { 113 struct MD5Contextmd5_session_nonce_ctx;113 MD5_CTX md5_session_nonce_ctx; 114 114 uint8_t session_nonce[16]; 115 115 uint8_t session_nonce_hash[16]; -
vendor/current/source4/dsdb/samdb/ldb_modules/password_hash.c
r740 r746 1352 1352 1353 1353 for (i=0; i < ARRAY_SIZE(wdigest); i++) { 1354 struct MD5Contextmd5;1354 MD5_CTX md5; 1355 1355 MD5Init(&md5); 1356 1356 if (wdigest[i].nt4dom) { -
vendor/current/source4/lib/ldb/common/ldb_parse.c
r740 r746 112 112 } 113 113 114 static bool need_encode(unsigned char cval) 115 { 116 if (cval < 0x20 || cval > 0x7E || strchr(" *()\\&|!\"", cval)) { 117 return true; 118 } 119 return false; 120 } 114 121 115 122 /* … … 125 132 126 133 for (i=0;i<val.length;i++) { 127 if ( !isprint(buf[i]) || strchr(" *()\\&|!\"",buf[i])) {134 if (need_encode(buf[i])) { 128 135 len += 2; 129 136 } … … 134 141 len = 0; 135 142 for (i=0;i<val.length;i++) { 136 if ( !isprint(buf[i]) || strchr(" *()\\&|!\"",buf[i])) {143 if (need_encode(buf[i])) { 137 144 snprintf(ret+len, 4, "\\%02X", buf[i]); 138 145 len += 3; -
vendor/current/source4/libcli/raw/smb_signing.c
r740 r746 104 104 { 105 105 uint8_t calc_md5_mac[16]; 106 struct MD5Contextmd5_ctx;106 MD5_CTX md5_ctx; 107 107 108 108 /* … … 139 139 uint8_t *server_sent_mac; 140 140 uint8_t sequence_buf[8]; 141 struct MD5Contextmd5_ctx;141 MD5_CTX md5_ctx; 142 142 const size_t offset_end_of_sig = (HDR_SS_FIELD + 8); 143 143 int i; -
vendor/current/source4/libnet/libnet_passwd.c
r740 r746 275 275 DATA_BLOB confounded_session_key = data_blob_talloc(mem_ctx, NULL, 16); 276 276 uint8_t confounder[16]; 277 struct MD5Contextmd5;277 MD5_CTX md5; 278 278 279 279 if (r->samr_handle.in.info21) { … … 331 331 DATA_BLOB confounded_session_key = data_blob_talloc(mem_ctx, NULL, 16); 332 332 uint8_t confounder[16]; 333 struct MD5Contextmd5;333 MD5_CTX md5; 334 334 335 335 if (!r->samr_handle.in.info21) { -
vendor/current/source4/ntp_signd/ntp_signd.c
r740 r746 108 108 struct ldb_result *res; 109 109 const char *attrs[] = { "unicodePwd", "userAccountControl", "cn", NULL }; 110 struct MD5Contextctx;110 MD5_CTX ctx; 111 111 struct samr_Password *nt_hash; 112 112 uint32_t user_account_control; -
vendor/current/source4/rpc_server/samr/samr_password.c
r740 r746 545 545 DATA_BLOB co_session_key; 546 546 DATA_BLOB session_key = data_blob(NULL, 0); 547 struct MD5Contextctx;547 MD5_CTX ctx; 548 548 549 549 nt_status = dcesrv_fetch_session_key(dce_call->conn, &session_key); -
vendor/current/source4/torture/ndr/ndr.c
r740 r746 351 351 torture_suite_add_suite(suite, ndr_drsuapi_suite(suite)); 352 352 torture_suite_add_suite(suite, ndr_spoolss_suite(suite)); 353 torture_suite_add_suite(suite, ndr_ntprinting_suite(suite)); 353 354 torture_suite_add_suite(suite, ndr_samr_suite(suite)); 354 355 torture_suite_add_suite(suite, ndr_drsblobs_suite(suite)); -
vendor/current/source4/torture/ndr/ndr.h
r740 r746 44 44 _torture_suite_add_ndr_pull_test(suite, #name, \ 45 45 (ndr_pull_flags_fn_t)ndr_pull_ ## name, data_blob_talloc(suite, data, sizeof(data)), \ 46 sizeof(struct name), 0, (bool (*) (struct torture_context *, void *)) check_fn);46 sizeof(struct name), NDR_SCALARS|NDR_BUFFERS, (bool (*) (struct torture_context *, void *)) check_fn); 47 47 48 48 #define torture_suite_add_ndr_pull_fn_test(suite,name,data,flags,check_fn) \ -
vendor/current/source4/torture/ndr/samr.c
r740 r746 278 278 }; 279 279 280 static const uint8_t samr_changepassworduser3_w2k8r2_out_data[] = { 281 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 282 0x00, 0x80, 0xa6, 0x0a, 0xff, 0xde, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 283 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 284 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0xc0 285 }; 286 287 static bool samr_changepassworduser3_w2k8r2_out_check(struct torture_context *tctx, 288 struct samr_ChangePasswordUser3 *r) 289 { 290 struct samr_DomInfo1 *dominfo = *r->out.dominfo; 291 struct userPwdChangeFailureInformation *reject = *r->out.reject; 292 293 torture_assert_int_equal(tctx, dominfo->min_password_length, 7, "min_password_length"); 294 torture_assert_int_equal(tctx, dominfo->password_history_length, 0, "password_history_length"); 295 torture_assert_int_equal(tctx, dominfo->password_properties, DOMAIN_PASSWORD_COMPLEX, "password_properties"); 296 torture_assert_u64_equal(tctx, dominfo->max_password_age, 0xffffdeff0aa68000, "max_password_age"); 297 torture_assert_u64_equal(tctx, dominfo->min_password_age, 0x0000000000000000, "min_password_age"); 298 299 torture_assert_int_equal(tctx, reject->extendedFailureReason, SAM_PWD_CHANGE_NOT_COMPLEX, "extendedFailureReason"); 300 torture_assert_int_equal(tctx, reject->filterModuleName.length, 0, "filterModuleName.length"); 301 torture_assert_int_equal(tctx, reject->filterModuleName.size, 0, "filterModuleName.size"); 302 303 torture_assert_ntstatus_equal(tctx, r->out.result, NT_STATUS_PASSWORD_RESTRICTION, "result"); 304 305 return true; 306 } 307 280 308 struct torture_suite *ndr_samr_suite(TALLOC_CTX *ctx) 281 309 { … … 314 342 torture_suite_add_ndr_pull_fn_test(suite, samr_ChangePasswordUser3, samr_changepassworduser3_w2k_out_data, NDR_OUT, NULL); 315 343 #endif 344 torture_suite_add_ndr_pull_fn_test(suite, 345 samr_ChangePasswordUser3, 346 samr_changepassworduser3_w2k8r2_out_data, 347 NDR_OUT, 348 samr_changepassworduser3_w2k8r2_out_check); 349 316 350 return suite; 317 351 } -
vendor/current/source4/torture/ntp/ntp_signd.c
r740 r746 79 79 int sys_errno; 80 80 81 struct MD5Contextctx;81 MD5_CTX ctx; 82 82 uint8_t sig[16]; 83 83 enum ndr_err_code ndr_err; -
vendor/current/source4/torture/rpc/samba3rpc.c
r740 r746 775 775 DATA_BLOB confounded_session_key = data_blob_talloc( 776 776 mem_ctx, NULL, 16); 777 struct MD5Contextctx;777 MD5_CTX ctx; 778 778 uint8_t confounder[16]; 779 779 -
vendor/current/source4/torture/rpc/samlogon.c
r740 r746 1076 1076 uint8_t client_chall[8]; 1077 1077 1078 struct MD5Contextmd5_session_nonce_ctx;1078 MD5_CTX md5_session_nonce_ctx; 1079 1079 HMACMD5Context hmac_ctx; 1080 1080 -
vendor/current/source4/torture/rpc/samr.c
r740 r746 772 772 char *newpass; 773 773 struct dcerpc_binding_handle *b = p->binding_handle; 774 struct MD5Contextctx;774 MD5_CTX ctx; 775 775 struct samr_GetUserPwInfo pwp; 776 776 struct samr_PwInfo info; … … 857 857 DATA_BLOB session_key; 858 858 DATA_BLOB confounded_session_key = data_blob_talloc(tctx, NULL, 16); 859 struct MD5Contextctx;859 MD5_CTX ctx; 860 860 uint8_t confounder[16]; 861 861 char *newpass; … … 1141 1141 DATA_BLOB session_key; 1142 1142 DATA_BLOB confounded_session_key = data_blob_talloc(tctx, NULL, 16); 1143 struct MD5Contextctx;1143 MD5_CTX ctx; 1144 1144 uint8_t confounder[16]; 1145 1145 char *newpass; … … 2459 2459 DATA_BLOB confounded_session_key = data_blob_talloc(tctx, NULL, 16); 2460 2460 uint8_t confounder[16]; 2461 struct MD5Contextctx;2461 MD5_CTX ctx; 2462 2462 2463 2463 bool ret = true; -
vendor/current/source4/torture/rpc/spoolss.c
r740 r746 36 36 #include "libcli/raw/raw_proto.h" 37 37 #include "libcli/resolve/resolve.h" 38 #include "libcli/smb2/smb2.h" 39 #include "libcli/smb2/smb2_calls.h" 38 40 #include "lib/cmdline/popt_common.h" 39 41 #include "system/filesys.h" 40 42 #include "torture/ndr/ndr.h" 43 #include "torture/smb2/proto.h" 41 44 42 45 #define TORTURE_WELLKNOWN_PRINTER "torture_wkn_printer" … … 50 53 #define TORTURE_DRIVER_ADOBE_CUPSADDSMB "torture_driver_adobe_cupsaddsmb" 51 54 #define TORTURE_DRIVER_TIMESTAMPS "torture_driver_timestamps" 55 #define TORTURE_DRIVER_DELETER "torture_driver_deleter" 56 #define TORTURE_DRIVER_DELETERIN "torture_driver_deleterin" 57 #define TORTURE_PRINTER_STATIC1 "print1" 52 58 53 59 #define TOP_LEVEL_PRINT_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print" … … 5498 5504 TEST_SET_SZ("description", comment, "newval"); 5499 5505 TEST_SET_SZ("location", location, "newval"); 5506 TEST_SET_SZ("driverName", drivername, "newval"); 5500 5507 /* TEST_SET_DWORD("priority", priority, 25); */ 5501 5508 … … 7724 7731 } 7725 7732 7726 static bool test_printer_sd(struct torture_context *tctx, 7727 void *private_data) 7733 /* use smbd file IO to spool a print job */ 7734 static bool test_print_test_smbd(struct torture_context *tctx, 7735 void *private_data) 7728 7736 { 7729 7737 struct torture_printer_context *t = … … 7731 7739 struct dcerpc_pipe *p = t->spoolss_pipe; 7732 7740 struct dcerpc_binding_handle *b = p->binding_handle; 7733 7734 torture_assert(tctx, 7735 test_PrinterInfo_SD(tctx, b, &t->handle), 7736 "failed to test security descriptors"); 7737 7738 return true; 7739 } 7740 7741 static bool test_printer_dm(struct torture_context *tctx, 7741 NTSTATUS status; 7742 uint32_t count; 7743 union spoolss_JobInfo *info = NULL; 7744 int i; 7745 7746 struct smb2_tree *tree; 7747 struct smb2_handle job_h; 7748 struct cli_credentials *credentials = cmdline_credentials; 7749 struct smbcli_options options; 7750 TALLOC_CTX *mem_ctx = talloc_new(tctx); 7751 /* 7752 * Do not test against the dynamically added printers, printing via 7753 * smbd means that a different spoolss process may handle the 7754 * OpenPrinter request to the one that handled the AddPrinter request. 7755 * This currently leads to an ugly race condition where one process 7756 * sees the new printer and one doesn't. 7757 */ 7758 const char *share = TORTURE_PRINTER_STATIC1; 7759 7760 torture_comment(tctx, "Testing smbd job spooling\n"); 7761 lpcfg_smbcli_options(tctx->lp_ctx, &options); 7762 7763 status = smb2_connect(tctx, 7764 torture_setting_string(tctx, "host", NULL), 7765 lpcfg_smb_ports(tctx->lp_ctx), 7766 share, 7767 lpcfg_resolve_context(tctx->lp_ctx), 7768 credentials, 7769 &tree, 7770 tctx->ev, 7771 &options, 7772 lpcfg_socket_options(tctx->lp_ctx), 7773 lpcfg_gensec_settings(tctx, tctx->lp_ctx)); 7774 if (!NT_STATUS_IS_OK(status)) { 7775 printf("Failed to connect to SMB2 printer %s - %s\n", 7776 share, nt_errstr(status)); 7777 return false; 7778 } 7779 7780 status = torture_smb2_testfile(tree, "smbd_spooler_job", &job_h); 7781 torture_assert_ntstatus_ok(tctx, status, "smbd spool job create"); 7782 7783 status = smb2_util_write(tree, job_h, "exciting print job data", 0, 7784 sizeof("exciting print job data")); 7785 torture_assert_ntstatus_ok(tctx, status, "smbd spool job write"); 7786 7787 /* check back end spoolss job was created */ 7788 torture_assert(tctx, 7789 test_EnumJobs_args(tctx, b, &t->handle, 1, &count, &info), 7790 "EnumJobs level 1 failed"); 7791 7792 for (i = 0; i < count; i++) { 7793 if (!strcmp(info[i].info1.document_name, "smbd_spooler_job")) { 7794 break; 7795 } 7796 } 7797 torture_assert(tctx, (i != count), "smbd_spooler_job not found"); 7798 7799 status = smb2_util_close(tree, job_h); 7800 torture_assert_ntstatus_ok(tctx, status, "smbd spool job close"); 7801 7802 /* disconnect from printer share */ 7803 talloc_free(mem_ctx); 7804 7805 return true; 7806 } 7807 7808 static bool test_printer_sd(struct torture_context *tctx, 7742 7809 void *private_data) 7743 {7744 struct torture_printer_context *t =7745 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context);7746 struct dcerpc_pipe *p = t->spoolss_pipe;7747 7748 torture_assert(tctx,7749 test_PrinterInfo_DevMode(tctx, p, &t->handle, t->info2.printername, t->devmode),7750 "failed to test devicemodes");7751 7752 return true;7753 }7754 7755 static bool test_printer_info_winreg(struct torture_context *tctx,7756 void *private_data)7757 {7758 struct torture_printer_context *t =7759 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context);7760 struct dcerpc_pipe *p = t->spoolss_pipe;7761 7762 torture_assert(tctx,7763 test_PrinterInfo_winreg(tctx, p, &t->handle, t->info2.printername),7764 "failed to test printer info winreg");7765 7766 return true;7767 }7768 7769 static bool test_printer_change_id(struct torture_context *tctx,7770 void *private_data)7771 {7772 struct torture_printer_context *t =7773 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context);7774 struct dcerpc_pipe *p = t->spoolss_pipe;7775 7776 torture_assert(tctx,7777 test_ChangeID(tctx, p, &t->handle),7778 "failed to test change id");7779 7780 return true;7781 }7782 7783 static bool test_printer_keys(struct torture_context *tctx,7784 void *private_data)7785 7810 { 7786 7811 struct torture_printer_context *t = … … 7790 7815 7791 7816 torture_assert(tctx, 7817 test_PrinterInfo_SD(tctx, b, &t->handle), 7818 "failed to test security descriptors"); 7819 7820 return true; 7821 } 7822 7823 static bool test_printer_dm(struct torture_context *tctx, 7824 void *private_data) 7825 { 7826 struct torture_printer_context *t = 7827 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context); 7828 struct dcerpc_pipe *p = t->spoolss_pipe; 7829 7830 torture_assert(tctx, 7831 test_PrinterInfo_DevMode(tctx, p, &t->handle, t->info2.printername, t->devmode), 7832 "failed to test devicemodes"); 7833 7834 return true; 7835 } 7836 7837 static bool test_printer_info_winreg(struct torture_context *tctx, 7838 void *private_data) 7839 { 7840 struct torture_printer_context *t = 7841 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context); 7842 struct dcerpc_pipe *p = t->spoolss_pipe; 7843 7844 torture_assert(tctx, 7845 test_PrinterInfo_winreg(tctx, p, &t->handle, t->info2.printername), 7846 "failed to test printer info winreg"); 7847 7848 return true; 7849 } 7850 7851 static bool test_printer_change_id(struct torture_context *tctx, 7852 void *private_data) 7853 { 7854 struct torture_printer_context *t = 7855 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context); 7856 struct dcerpc_pipe *p = t->spoolss_pipe; 7857 7858 torture_assert(tctx, 7859 test_ChangeID(tctx, p, &t->handle), 7860 "failed to test change id"); 7861 7862 return true; 7863 } 7864 7865 static bool test_printer_keys(struct torture_context *tctx, 7866 void *private_data) 7867 { 7868 struct torture_printer_context *t = 7869 (struct torture_printer_context *)talloc_get_type_abort(private_data, struct torture_printer_context); 7870 struct dcerpc_pipe *p = t->spoolss_pipe; 7871 struct dcerpc_binding_handle *b = p->binding_handle; 7872 7873 torture_assert(tctx, 7792 7874 test_printer_all_keys(tctx, b, &t->handle), 7793 7875 "failed to test printer keys"); … … 7905 7987 torture_tcase_add_simple_test(tcase, "print_test", test_print_test); 7906 7988 torture_tcase_add_simple_test(tcase, "print_test_extended", test_print_test_extended); 7989 torture_tcase_add_simple_test(tcase, "print_test_smbd", test_print_test_smbd); 7907 7990 torture_tcase_add_simple_test(tcase, "printer_info", test_printer_info); 7908 7991 torture_tcase_add_simple_test(tcase, "sd", test_printer_sd); … … 8923 9006 } 8924 9007 9008 static bool check_printer_driver_file(struct torture_context *tctx, 9009 struct smbcli_state *cli, 9010 struct torture_driver_context *d, 9011 const char *file_name) 9012 { 9013 const char *remote_arch_dir = driver_directory_dir(d->remote.driver_directory); 9014 const char *remote_name = talloc_asprintf(tctx, "%s\\%d\\%s", 9015 remote_arch_dir, 9016 d->info8.version, 9017 file_name); 9018 int fnum; 9019 9020 torture_assert(tctx, (file_name && strlen(file_name) != 0), "invalid filename"); 9021 9022 torture_comment(tctx, "checking for driver file at %s\n", remote_name); 9023 9024 fnum = smbcli_open(cli->tree, remote_name, O_RDONLY, DENY_NONE); 9025 if (fnum == -1) { 9026 return false; 9027 } 9028 9029 torture_assert_ntstatus_ok(tctx, 9030 smbcli_close(cli->tree, fnum), 9031 "failed to close driver file"); 9032 9033 return true; 9034 } 9035 9036 static bool check_printer_driver_files(struct torture_context *tctx, 9037 const char *server_name, 9038 struct torture_driver_context *d, 9039 bool expect_exist) 9040 { 9041 struct smbcli_state *cli; 9042 const char *share_name = driver_directory_share(tctx, d->remote.driver_directory); 9043 int i; 9044 9045 torture_assert(tctx, 9046 connect_printer_driver_share(tctx, server_name, share_name, &cli), 9047 "failed to connect to driver share"); 9048 9049 torture_comment(tctx, "checking %sexistent driver files at \\\\%s\\%s\n", 9050 (expect_exist ? "": "non-"), 9051 server_name, share_name); 9052 9053 if (d->info8.driver_path && d->info8.driver_path[0]) { 9054 torture_assert(tctx, 9055 check_printer_driver_file(tctx, cli, d, d->info8.driver_path) == expect_exist, 9056 "failed driver_path check"); 9057 } 9058 if (d->info8.data_file && d->info8.data_file[0]) { 9059 torture_assert(tctx, 9060 check_printer_driver_file(tctx, cli, d, d->info8.data_file) == expect_exist, 9061 "failed data_file check"); 9062 } 9063 if (d->info8.config_file && d->info8.config_file[0]) { 9064 torture_assert(tctx, 9065 check_printer_driver_file(tctx, cli, d, d->info8.config_file) == expect_exist, 9066 "failed config_file check"); 9067 } 9068 if (d->info8.help_file && d->info8.help_file[0]) { 9069 torture_assert(tctx, 9070 check_printer_driver_file(tctx, cli, d, d->info8.help_file) == expect_exist, 9071 "failed help_file check"); 9072 } 9073 if (d->info8.dependent_files) { 9074 for (i=0; d->info8.dependent_files->string && d->info8.dependent_files->string[i] != NULL; i++) { 9075 torture_assert(tctx, 9076 check_printer_driver_file(tctx, cli, d, d->info8.dependent_files->string[i]) == expect_exist, 9077 "failed dependent_files check"); 9078 } 9079 } 9080 9081 talloc_free(cli); 9082 9083 return true; 9084 } 9085 8925 9086 static bool remove_printer_driver_file(struct torture_context *tctx, 8926 9087 struct smbcli_state *cli, … … 9207 9368 struct torture_driver_context *d; 9208 9369 9370 if (!torture_setting_bool(tctx, "samba3", false)) { 9371 torture_skip(tctx, "skipping adobe test which only works against samba3"); 9372 } 9373 9209 9374 d = talloc_zero(tctx, struct torture_driver_context); 9210 9375 … … 9372 9537 } 9373 9538 9539 static bool test_del_driver_all_files(struct torture_context *tctx, 9540 struct dcerpc_pipe *p) 9541 { 9542 struct torture_driver_context *d; 9543 struct spoolss_StringArray *a; 9544 uint32_t add_flags = APD_COPY_NEW_FILES; 9545 uint32_t delete_flags = DPD_DELETE_ALL_FILES; 9546 struct dcerpc_binding_handle *b = p->binding_handle; 9547 const char *server_name_slash = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); 9548 9549 d = talloc_zero(tctx, struct torture_driver_context); 9550 9551 d->ex = true; 9552 d->info8.version = SPOOLSS_DRIVER_VERSION_200X; 9553 d->info8.driver_name = TORTURE_DRIVER_DELETER; 9554 d->info8.architecture = NULL; 9555 d->info8.driver_path = talloc_strdup(d, "pscript5.dll"); 9556 d->info8.data_file = talloc_strdup(d, "cups6.ppd"); 9557 d->info8.config_file = talloc_strdup(d, "cupsui6.dll"); 9558 d->info8.help_file = talloc_strdup(d, "pscript.hlp"); 9559 d->local.environment = talloc_strdup(d, SPOOLSS_ARCHITECTURE_x64); 9560 d->local.driver_directory = talloc_strdup(d, "/usr/share/cups/drivers/x64"); 9561 9562 a = talloc_zero(d, struct spoolss_StringArray); 9563 a->string = talloc_zero_array(a, const char *, 3); 9564 a->string[0] = talloc_strdup(a->string, "cups6.inf"); 9565 a->string[1] = talloc_strdup(a->string, "cups6.ini"); 9566 9567 d->info8.dependent_files = a; 9568 d->info8.architecture = d->local.environment; 9569 9570 torture_assert(tctx, 9571 fillup_printserver_info(tctx, p, d), 9572 "failed to fillup printserver info"); 9573 9574 if (!directory_exist(d->local.driver_directory)) { 9575 torture_skip(tctx, "Skipping Printer Driver test as no local driver is available"); 9576 } 9577 9578 torture_assert(tctx, 9579 upload_printer_driver(tctx, dcerpc_server_name(p), d), 9580 "failed to upload printer driver"); 9581 9582 torture_assert(tctx, 9583 test_AddPrinterDriver_args_level_3(tctx, b, server_name_slash, &d->info8, add_flags, true, NULL), 9584 "failed to add driver"); 9585 9586 torture_assert(tctx, 9587 test_DeletePrinterDriverEx(tctx, b, server_name_slash, 9588 d->info8.driver_name, 9589 d->local.environment, 9590 delete_flags, 9591 d->info8.version), 9592 "failed to delete driver"); 9593 9594 torture_assert(tctx, 9595 check_printer_driver_files(tctx, dcerpc_server_name(p), d, false), 9596 "printer driver file check failed"); 9597 9598 talloc_free(d); 9599 return true; 9600 } 9601 9602 static bool test_del_driver_unused_files(struct torture_context *tctx, 9603 struct dcerpc_pipe *p) 9604 { 9605 struct torture_driver_context *d1; 9606 struct torture_driver_context *d2; 9607 uint32_t add_flags = APD_COPY_NEW_FILES; 9608 struct dcerpc_binding_handle *b = p->binding_handle; 9609 const char *server_name_slash = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); 9610 9611 d1 = talloc_zero(tctx, struct torture_driver_context); 9612 d1->ex = true; 9613 d1->info8.version = SPOOLSS_DRIVER_VERSION_200X; 9614 d1->info8.driver_name = TORTURE_DRIVER_DELETER; 9615 d1->info8.architecture = NULL; 9616 d1->info8.driver_path = talloc_strdup(d1, "pscript5.dll"); 9617 d1->info8.data_file = talloc_strdup(d1, "cups6.ppd"); 9618 d1->info8.config_file = talloc_strdup(d1, "cupsui6.dll"); 9619 d1->info8.help_file = talloc_strdup(d1, "pscript.hlp"); 9620 d1->local.environment = talloc_strdup(d1, SPOOLSS_ARCHITECTURE_x64); 9621 d1->local.driver_directory = talloc_strdup(d1, "/usr/share/cups/drivers/x64"); 9622 d1->info8.architecture = d1->local.environment; 9623 9624 d2 = talloc_zero(tctx, struct torture_driver_context); 9625 d2->ex = true; 9626 d2->info8.version = SPOOLSS_DRIVER_VERSION_200X; 9627 d2->info8.driver_name = TORTURE_DRIVER_DELETERIN; 9628 d2->info8.architecture = NULL; 9629 d2->info8.driver_path = talloc_strdup(d2, "pscript5.dll"); /* overlapping */ 9630 d2->info8.data_file = talloc_strdup(d2, "cupsps6.dll"); 9631 d2->info8.config_file = talloc_strdup(d2, "cups6.ini"); 9632 d2->info8.help_file = talloc_strdup(d2, "pscript.hlp"); /* overlapping */ 9633 d2->local.environment = talloc_strdup(d2, SPOOLSS_ARCHITECTURE_x64); 9634 d2->local.driver_directory = talloc_strdup(d2, "/usr/share/cups/drivers/x64"); 9635 d2->info8.architecture = d2->local.environment; 9636 9637 torture_assert(tctx, 9638 fillup_printserver_info(tctx, p, d1), 9639 "failed to fillup printserver info"); 9640 torture_assert(tctx, 9641 fillup_printserver_info(tctx, p, d2), 9642 "failed to fillup printserver info"); 9643 9644 if (!directory_exist(d1->local.driver_directory)) { 9645 torture_skip(tctx, "Skipping Printer Driver test as no local driver is available"); 9646 } 9647 9648 torture_assert(tctx, 9649 upload_printer_driver(tctx, dcerpc_server_name(p), d1), 9650 "failed to upload printer driver"); 9651 torture_assert(tctx, 9652 test_AddPrinterDriver_args_level_3(tctx, b, server_name_slash, &d1->info8, add_flags, true, NULL), 9653 "failed to add driver"); 9654 9655 torture_assert(tctx, 9656 upload_printer_driver(tctx, dcerpc_server_name(p), d2), 9657 "failed to upload printer driver"); 9658 torture_assert(tctx, 9659 test_AddPrinterDriver_args_level_3(tctx, b, server_name_slash, &d2->info8, add_flags, true, NULL), 9660 "failed to add driver"); 9661 9662 /* some files are in use by a separate driver, should fail */ 9663 torture_assert(tctx, 9664 test_DeletePrinterDriverEx_exp(tctx, b, server_name_slash, 9665 d1->info8.driver_name, 9666 d1->local.environment, 9667 DPD_DELETE_ALL_FILES, 9668 d1->info8.version, 9669 WERR_PRINTER_DRIVER_IN_USE), 9670 "invalid delete driver response"); 9671 9672 /* should only delete files not in use by other driver */ 9673 torture_assert(tctx, 9674 test_DeletePrinterDriverEx_exp(tctx, b, server_name_slash, 9675 d1->info8.driver_name, 9676 d1->local.environment, 9677 DPD_DELETE_UNUSED_FILES, 9678 d1->info8.version, 9679 WERR_OK), 9680 "failed to delete driver (unused files)"); 9681 9682 /* check non-overlapping were deleted */ 9683 d1->info8.driver_path = NULL; 9684 d1->info8.help_file = NULL; 9685 torture_assert(tctx, 9686 check_printer_driver_files(tctx, dcerpc_server_name(p), d1, false), 9687 "printer driver file check failed"); 9688 /* d2 files should be uneffected */ 9689 torture_assert(tctx, 9690 check_printer_driver_files(tctx, dcerpc_server_name(p), d2, true), 9691 "printer driver file check failed"); 9692 9693 torture_assert(tctx, 9694 test_DeletePrinterDriverEx_exp(tctx, b, server_name_slash, 9695 d2->info8.driver_name, 9696 d2->local.environment, 9697 DPD_DELETE_ALL_FILES, 9698 d2->info8.version, 9699 WERR_OK), 9700 "failed to delete driver"); 9701 9702 torture_assert(tctx, 9703 check_printer_driver_files(tctx, dcerpc_server_name(p), d2, false), 9704 "printer driver file check failed"); 9705 9706 talloc_free(d1); 9707 talloc_free(d2); 9708 return true; 9709 } 9710 9374 9711 struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx) 9375 9712 { … … 9392 9729 torture_rpc_tcase_add_test(tcase, "multiple_drivers", test_multiple_drivers); 9393 9730 9731 torture_rpc_tcase_add_test(tcase, "del_driver_all_files", test_del_driver_all_files); 9732 9733 torture_rpc_tcase_add_test(tcase, "del_driver_unused_files", test_del_driver_unused_files); 9734 9394 9735 return suite; 9395 9736 } -
vendor/current/source4/torture/smb2/compound.c
r740 r746 33 33 goto done; \ 34 34 }} while (0) 35 36 #define TARGET_IS_W2K8(_tctx) (torture_setting_bool(_tctx, "w2k8", false))37 #define TARGET_IS_WIN7(_tctx) (torture_setting_bool(_tctx, "win7", false))38 35 39 36 static bool test_compound_related1(struct torture_context *tctx, … … 167 164 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 168 165 status = smb2_close_recv(req[3], &cl); 169 CHECK_STATUS(status, NT_STATUS_ INVALID_PARAMETER);166 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 170 167 status = smb2_close_recv(req[4], &cl); 171 CHECK_STATUS(status, NT_STATUS_ INVALID_PARAMETER);168 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 172 169 173 170 tree->tid = saved_tid; … … 253 250 struct smb2_close cl; 254 251 bool ret = true; 255 struct smb2_request *req[ 2];256 257 smb2_transport_credits_ask_num(tree->session->transport, 2);252 struct smb2_request *req[3]; 253 254 smb2_transport_credits_ask_num(tree->session->transport, 3); 258 255 259 256 smb2_util_unlink(tree, fname); … … 279 276 cr.in.fname = fname; 280 277 281 smb2_transport_compound_start(tree->session->transport, 2);278 smb2_transport_compound_start(tree->session->transport, 3); 282 279 283 280 /* passing the first request with the related flag is invalid */ … … 292 289 cl.in.file.handle = hd; 293 290 req[1] = smb2_close_send(tree, &cl); 291 292 smb2_transport_compound_set_related(tree->session->transport, false); 293 req[2] = smb2_close_send(tree, &cl); 294 294 295 295 status = smb2_create_recv(req[0], tree, &cr); … … 298 298 status = smb2_close_recv(req[1], &cl); 299 299 CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER); 300 status = smb2_close_recv(req[2], &cl); 301 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 300 302 301 303 smb2_util_unlink(tree, fname); … … 368 370 CHECK_STATUS(status, NT_STATUS_OK); 369 371 status = smb2_close_recv(req[2], &cl); 370 CHECK_STATUS(status, NT_STATUS_ FILE_CLOSED);372 CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED); 371 373 status = smb2_close_recv(req[3], &cl); 372 CHECK_STATUS(status, NT_STATUS_ FILE_CLOSED);374 CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED); 373 375 status = smb2_close_recv(req[4], &cl); 374 376 CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER); … … 440 442 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 441 443 status = smb2_close_recv(req[3], &cl); 442 CHECK_STATUS(status, NT_STATUS_ INVALID_PARAMETER);444 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 443 445 status = smb2_close_recv(req[4], &cl); 444 CHECK_STATUS(status, NT_STATUS_ INVALID_PARAMETER);446 CHECK_STATUS(status, NT_STATUS_FILE_CLOSED); 445 447 446 448 smb2_util_unlink(tree, fname); … … 466 468 * SMB2 spec as noted in MS-SMB2 <159>, <162>. This, test currently 467 469 * verifies the Windows behavior, not the general spec behavior. */ 468 if (!TARGET_IS_WIN7(tctx) && !TARGET_IS_W2K8(tctx)) {469 torture_skip(tctx, "Interim test is specific to Windows server "470 "behavior.\n");471 }472 470 473 471 smb2_transport_credits_ask_num(tree->session->transport, 5); … … 537 535 * SMB2 spec as noted in MS-SMB2 <159>, <162>. This, test currently 538 536 * verifies the Windows behavior, not the general spec behavior. */ 539 if (!TARGET_IS_WIN7(tctx) && !TARGET_IS_W2K8(tctx)) {540 torture_skip(tctx, "Interim test is specific to Windows server "541 "behavior.\n");542 }543 537 544 538 smb2_transport_credits_ask_num(tree->session->transport, 5); -
vendor/current/source4/torture/smb2/connect.c
r740 r746 72 72 DATA_BLOB data; 73 73 int i; 74 uint32_t size = torture_setting_int(tctx, "smb2maxwrite", 64*1024); 74 75 75 if (torture_setting_bool(tctx, "dangerous", false)) { 76 data = data_blob_talloc(tree, NULL, 160000); 77 } else if (torture_setting_bool(tctx, "samba4", false)) { 78 data = data_blob_talloc(tree, NULL, UINT16_MAX); 79 } else { 80 data = data_blob_talloc(tree, NULL, torture_setting_int(tctx, "smb2maxwrite", 120000)); 81 } 76 data = data_blob_talloc(tree, NULL, size); 77 if (size != data.length) { 78 printf("data_blob_talloc(%s) failed\n", size); 79 return NT_STATUS_NO_MEMORY; 80 } 81 82 82 for (i=0;i<data.length;i++) { 83 83 data.data[i] = i; -
vendor/current/source4/torture/smb2/oplock.c
r740 r746 2385 2385 int te; 2386 2386 2387 if (torture_setting_bool(tctx, "samba3", false)) {2388 torture_skip(tctx, "BATCH22 disabled against samba3\n");2389 }2390 2391 2387 status = torture_smb2_testdir(tree1, BASEDIR, &h); 2392 2388 torture_assert_ntstatus_ok(tctx, status, "Error creating directory"); … … 2727 2723 {&fname_default_stream, true, SMB2_OPLOCK_LEVEL_EXCLUSIVE, SMB2_OPLOCK_LEVEL_II}, 2728 2724 }; 2729 2730 /* Only passes against windows at the moment. */2731 if (torture_setting_bool(tctx, "samba3", false) ||2732 torture_setting_bool(tctx, "samba4", false)) {2733 torture_skip(tctx, "STREAM1 disabled against samba3+4\n");2734 }2735 2725 2736 2726 fname_stream = talloc_asprintf(tctx, "%s:%s", fname_base, stream); -
vendor/current/source4/torture/smb2/read.c
r740 r746 52 52 NTSTATUS status; 53 53 struct smb2_handle h; 54 uint8_t buf[ 70000];54 uint8_t buf[64*1024]; 55 55 struct smb2_read rd; 56 56 TALLOC_CTX *tmp_ctx = talloc_new(tree); … … 135 135 NTSTATUS status; 136 136 struct smb2_handle h; 137 uint8_t buf[ 70000];137 uint8_t buf[64*1024]; 138 138 struct smb2_read rd; 139 139 TALLOC_CTX *tmp_ctx = talloc_new(tree); -
vendor/current/source4/torture/wscript_build
r740 r746 34 34 35 35 bld.SAMBA_SUBSYSTEM('TORTURE_NDR', 36 source='ndr/ndr.c ndr/winreg.c ndr/atsvc.c ndr/lsa.c ndr/epmap.c ndr/dfs.c ndr/netlogon.c ndr/drsuapi.c ndr/spoolss.c ndr/ samr.c ndr/dfsblob.c ndr/drsblobs.c ndr/nbt.c ndr/ntlmssp.c ndr/backupkey.c',36 source='ndr/ndr.c ndr/winreg.c ndr/atsvc.c ndr/lsa.c ndr/epmap.c ndr/dfs.c ndr/netlogon.c ndr/drsuapi.c ndr/spoolss.c ndr/ntprinting.c ndr/samr.c ndr/dfsblob.c ndr/drsblobs.c ndr/nbt.c ndr/ntlmssp.c ndr/backupkey.c', 37 37 autoproto='ndr/proto.h', 38 38 deps='torture'
Note:
See TracChangeset
for help on using the changeset viewer.