Changeset 746 for vendor/current/source3/libsmb/cliconnect.c
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/libsmb/cliconnect.c
r740 r746 362 362 fail: 363 363 TALLOC_FREE(frame); 364 if (!NT_STATUS_IS_OK(status)) {365 cli_set_error(cli, status);366 }367 364 return status; 368 365 } … … 599 596 fail: 600 597 TALLOC_FREE(frame); 601 if (!NT_STATUS_IS_OK(status)) {602 cli_set_error(cli, status);603 }604 598 return status; 605 599 } … … 803 797 fail: 804 798 TALLOC_FREE(frame); 805 if (!NT_STATUS_IS_OK(status)) {806 cli_set_error(cli, status);807 }808 799 return status; 809 800 } … … 1171 1162 fail: 1172 1163 TALLOC_FREE(frame); 1173 if (!NT_STATUS_IS_OK(status)) {1174 cli_set_error(cli, status);1175 }1176 1164 return status; 1177 1165 } … … 1789 1777 fail: 1790 1778 TALLOC_FREE(ev); 1791 if (!NT_STATUS_IS_OK(status)) {1792 cli_set_error(cli, status);1793 }1794 1779 return status; 1795 1780 } … … 2013 1998 2014 1999 if (cli->protocol < PROTOCOL_LANMAN1) { 2000 /* 2001 * Ensure cli->server_domain, 2002 * cli->server_os and cli->server_type 2003 * are valid pointers. 2004 */ 2005 cli->server_domain = talloc_strdup(cli, ""); 2006 cli->server_os = talloc_strdup(cli, ""); 2007 cli->server_type = talloc_strdup(cli, ""); 2008 if (cli->server_domain == NULL || 2009 cli->server_os == NULL || 2010 cli->server_type == NULL) { 2011 return NT_STATUS_NO_MEMORY; 2012 } 2015 2013 return NT_STATUS_OK; 2016 2014 } … … 2176 2174 fail: 2177 2175 TALLOC_FREE(ev); 2178 if (!NT_STATUS_IS_OK(status)) {2179 cli_set_error(cli, status);2180 }2181 2176 return status; 2182 2177 } … … 2472 2467 fail: 2473 2468 TALLOC_FREE(frame); 2474 if (!NT_STATUS_IS_OK(status)) {2475 cli_set_error(cli, status);2476 }2477 2469 return status; 2478 2470 } … … 2555 2547 fail: 2556 2548 TALLOC_FREE(ev); 2557 if (!NT_STATUS_IS_OK(status)) {2558 cli_set_error(cli, status);2559 }2560 2549 return status; 2561 2550 } … … 2667 2656 struct timespec ts; 2668 2657 bool negotiated_smb_signing = false; 2658 DATA_BLOB blob = data_blob_null; 2659 2660 if (wct != 0x11) { 2661 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); 2662 return; 2663 } 2669 2664 2670 2665 /* NT protocol */ … … 2687 2682 if (!(cli->capabilities & CAP_EXTENDED_SECURITY) && 2688 2683 smb_buflen(inbuf) > 8) { 2684 blob = data_blob_const(bytes + 8, num_bytes - 8); 2685 } 2686 2687 if (blob.length > 0) { 2689 2688 ssize_t ret; 2690 status = smb_bytes_talloc_string( 2691 cli, (char *)inbuf, &cli->server_domain, 2692 bytes + 8, num_bytes - 8, &ret); 2693 if (tevent_req_nterror(req, status)) { 2689 char *server_domain = NULL; 2690 2691 ret = clistr_pull_talloc(cli, 2692 (const char *)inbuf, 2693 SVAL(inbuf, smb_flg2), 2694 &server_domain, 2695 (char *)blob.data, 2696 blob.length, 2697 STR_TERMINATE| 2698 STR_UNICODE| 2699 STR_NOALIGN); 2700 if (ret == -1) { 2701 tevent_req_nterror(req, NT_STATUS_NO_MEMORY); 2694 2702 return; 2703 } 2704 if (server_domain) { 2705 cli->server_domain = server_domain; 2695 2706 } 2696 2707 } … … 2741 2752 2742 2753 } else if (cli->protocol >= PROTOCOL_LANMAN1) { 2754 if (wct != 0x0D) { 2755 tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); 2756 return; 2757 } 2758 2743 2759 cli->use_spnego = False; 2744 2760 cli->sec_mode = SVAL(vwv + 1, 0); … … 2810 2826 fail: 2811 2827 TALLOC_FREE(frame); 2812 if (!NT_STATUS_IS_OK(status)) {2813 cli_set_error(cli, status);2814 }2815 2828 return status; 2816 2829 }
Note:
See TracChangeset
for help on using the changeset viewer.