Changeset 751 for trunk/server/source3/libsmb/clifile.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/server/source3/libsmb/clifile.c (modified) (47 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/libsmb/clifile.c
r745 r751 359 359 fail: 360 360 TALLOC_FREE(frame); 361 if (!NT_STATUS_IS_OK(status)) {362 cli_set_error(cli, status);363 }364 361 return status; 365 362 } … … 504 501 fail: 505 502 TALLOC_FREE(frame); 506 if (!NT_STATUS_IS_OK(status)) {507 cli_set_error(cli, status);508 }509 503 return status; 510 504 } … … 571 565 fail: 572 566 TALLOC_FREE(frame); 573 if (!NT_STATUS_IS_OK(status)) {574 cli_set_error(cli, status);575 }576 567 return status; 577 568 } … … 779 770 fail: 780 771 TALLOC_FREE(frame); 781 if (!NT_STATUS_IS_OK(status)) {782 cli_set_error(cli, status);783 }784 772 return status; 785 773 } … … 913 901 fail: 914 902 TALLOC_FREE(frame); 915 if (!NT_STATUS_IS_OK(status)) {916 cli_set_error(cli, status);917 }918 903 return status; 919 904 } … … 1030 1015 fail: 1031 1016 TALLOC_FREE(frame); 1032 if (!NT_STATUS_IS_OK(status)) {1033 cli_set_error(cli, status);1034 }1035 1017 return status; 1036 1018 } … … 1103 1085 fail: 1104 1086 TALLOC_FREE(frame); 1105 if (!NT_STATUS_IS_OK(status)) {1106 cli_set_error(cli, status);1107 }1108 1087 return status; 1109 1088 } … … 1225 1204 fail: 1226 1205 TALLOC_FREE(frame); 1227 if (!NT_STATUS_IS_OK(status)) {1228 cli_set_error(cli, status);1229 }1230 1206 return status; 1231 1207 } … … 1369 1345 fail: 1370 1346 TALLOC_FREE(frame); 1371 if (!NT_STATUS_IS_OK(status)) {1372 cli_set_error(cli, status);1373 }1374 1347 return status; 1375 1348 } … … 1434 1407 fail: 1435 1408 TALLOC_FREE(frame); 1436 if (!NT_STATUS_IS_OK(status)) {1437 cli_set_error(cli, status);1438 }1439 1409 return status; 1440 1410 } … … 1544 1514 fail: 1545 1515 TALLOC_FREE(frame); 1546 if (!NT_STATUS_IS_OK(status)) {1547 cli_set_error(cli, status);1548 }1549 1516 return status; 1550 1517 } … … 1651 1618 fail: 1652 1619 TALLOC_FREE(frame); 1653 if (!NT_STATUS_IS_OK(status)) {1654 cli_set_error(cli, status);1655 }1656 1620 return status; 1657 1621 } … … 1758 1722 fail: 1759 1723 TALLOC_FREE(frame); 1760 if (!NT_STATUS_IS_OK(status)) {1761 cli_set_error(cli, status);1762 }1763 1724 return status; 1764 1725 } … … 1875 1836 fail: 1876 1837 TALLOC_FREE(frame); 1877 if (!NT_STATUS_IS_OK(status)) {1878 cli_set_error(cli, status);1879 }1880 1838 return status; 1881 1839 } … … 2039 1997 fail: 2040 1998 TALLOC_FREE(frame); 2041 if (!NT_STATUS_IS_OK(status)) {2042 cli_set_error(cli, status);2043 }2044 1999 return status; 2045 2000 } … … 2051 2006 2052 2007 struct cli_open_state { 2008 2009 2010 2053 2011 uint16_t vwv[15]; 2054 2012 uint16_t fnum; 2013 2014 2015 2055 2016 struct iovec bytes; 2056 2017 }; 2057 2018 2058 2019 static void cli_open_done(struct tevent_req *subreq); 2020 2059 2021 2060 2022 struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx, … … 2066 2028 struct tevent_req *req, *subreq; 2067 2029 struct cli_open_state *state; 2068 unsigned openfn;2069 unsigned accessmode;2070 uint8_t additional_flags;2071 2030 uint8_t *bytes; 2072 2031 … … 2075 2034 return NULL; 2076 2035 } 2077 2078 openfn = 0; 2036 state->ev = ev; 2037 state->cli = cli; 2038 state->fname = fname; 2039 2079 2040 if (flags & O_CREAT) { 2080 openfn |= (1<<4);2041 openfn |= (1<<4); 2081 2042 } 2082 2043 if (!(flags & O_EXCL)) { 2083 2044 if (flags & O_TRUNC) 2084 openfn |= (1<<1);2045 openfn |= (1<<1); 2085 2046 else 2086 openfn |= (1<<0);2087 } 2088 2089 accessmode= (share_mode<<4);2047 openfn |= (1<<0); 2048 } 2049 2050 = (share_mode<<4); 2090 2051 2091 2052 if ((flags & O_ACCMODE) == O_RDWR) { 2092 accessmode|= 2;2053 |= 2; 2093 2054 } else if ((flags & O_ACCMODE) == O_WRONLY) { 2094 accessmode|= 1;2055 |= 1; 2095 2056 } 2096 2057 2097 2058 #if defined(O_SYNC) 2098 2059 if ((flags & O_SYNC) == O_SYNC) { 2099 accessmode|= (1<<14);2060 |= (1<<14); 2100 2061 } 2101 2062 #endif /* O_SYNC */ 2102 2063 2103 2064 if (share_mode == DENY_FCB) { 2104 accessmode= 0xFF;2065 = 0xFF; 2105 2066 } 2106 2067 … … 2109 2070 SSVAL(state->vwv + 1, 0, 0); 2110 2071 SSVAL(state->vwv + 2, 0, 0); /* no additional info */ 2111 SSVAL(state->vwv + 3, 0, accessmode);2072 SSVAL(state->vwv + 3, 0, ); 2112 2073 SSVAL(state->vwv + 4, 0, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); 2113 2074 SSVAL(state->vwv + 5, 0, 0); 2114 2075 SIVAL(state->vwv + 6, 0, 0); 2115 SSVAL(state->vwv + 8, 0, openfn);2076 SSVAL(state->vwv + 8, 0, openfn); 2116 2077 SIVAL(state->vwv + 9, 0, 0); 2117 2078 SIVAL(state->vwv + 11, 0, 0); 2118 2079 SIVAL(state->vwv + 13, 0, 0); 2119 2080 2120 additional_flags = 0;2121 2122 2081 if (cli->use_oplocks) { 2123 2082 /* if using oplocks then ask for a batch oplock via 2124 2083 core and extended methods */ 2125 additional_flags =2084 additional_flags = 2126 2085 FLAG_REQUEST_OPLOCK|FLAG_REQUEST_BATCH_OPLOCK; 2127 2086 SSVAL(state->vwv+2, 0, SVAL(state->vwv+2, 0) | 6); … … 2139 2098 state->bytes.iov_len = talloc_get_size(bytes); 2140 2099 2141 subreq = cli_smb_req_create(state, ev, cli, SMBopenX, additional_flags, 2100 subreq = cli_smb_req_create(state, ev, cli, SMBopenX, 2101 state->additional_flags, 2142 2102 15, state->vwv, 1, &state->bytes); 2143 2103 if (subreq == NULL) { … … 2180 2140 uint8_t *inbuf; 2181 2141 NTSTATUS status; 2142 2182 2143 2183 2144 status = cli_smb_recv(subreq, state, &inbuf, 3, &wct, &vwv, NULL, 2184 2145 NULL); 2185 2146 TALLOC_FREE(subreq); 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2186 2192 if (tevent_req_nterror(req, status)) { 2187 2193 return; 2188 2194 } 2189 state->fnum = SVAL(vwv+2, 0);2190 2195 tevent_req_done(req); 2191 2196 } … … 2240 2245 fail: 2241 2246 TALLOC_FREE(frame); 2242 if (!NT_STATUS_IS_OK(status)) {2243 cli_set_error(cli, status);2244 }2245 2247 return status; 2246 2248 } … … 2358 2360 fail: 2359 2361 TALLOC_FREE(frame); 2360 if (!NT_STATUS_IS_OK(status)) {2361 cli_set_error(cli, status);2362 }2363 2362 return status; 2364 2363 } … … 2476 2475 fail: 2477 2476 TALLOC_FREE(frame); 2478 if (!NT_STATUS_IS_OK(status)) {2479 cli_set_error(cli, status);2480 }2481 2477 return status; 2482 2478 } … … 2538 2534 status = cli_locktype(cli, fnum, offset, len, timeout, 2539 2535 (lock_type == READ_LOCK? 1 : 0)); 2540 cli_set_error(cli, status);2541 2536 return NT_STATUS_IS_OK(status); 2542 2537 } … … 2649 2644 fail: 2650 2645 TALLOC_FREE(frame); 2651 if (!NT_STATUS_IS_OK(status)) {2652 cli_set_error(cli, status);2653 }2654 2646 return status; 2655 2647 } … … 2702 2694 cli->timeout = saved_timeout; 2703 2695 2704 cli_set_error(cli, status);2705 2696 return NT_STATUS_IS_OK(status); 2706 2697 } … … 2817 2808 fail: 2818 2809 TALLOC_FREE(frame); 2819 if (!NT_STATUS_IS_OK(status)) {2820 cli_set_error(cli, status);2821 }2822 2810 return status; 2823 2811 } … … 2991 2979 fail: 2992 2980 TALLOC_FREE(frame); 2993 if (!NT_STATUS_IS_OK(status)) {2994 cli_set_error(cli, status);2995 }2996 2981 return status; 2997 2982 } … … 3058 3043 fail: 3059 3044 TALLOC_FREE(frame); 3060 if (!NT_STATUS_IS_OK(status)) {3061 cli_set_error(cli, status);3062 }3063 3045 return status; 3064 3046 } … … 3212 3194 fail: 3213 3195 TALLOC_FREE(frame); 3214 if (!NT_STATUS_IS_OK(status)) {3215 cli_set_error(cli, status);3216 }3217 3196 return status; 3218 3197 } … … 3361 3340 fail: 3362 3341 TALLOC_FREE(frame); 3363 if (!NT_STATUS_IS_OK(status)) {3364 cli_set_error(cli, status);3365 }3366 3342 return status; 3367 3343 } … … 3476 3452 fail: 3477 3453 TALLOC_FREE(frame); 3478 if (!NT_STATUS_IS_OK(status)) {3479 cli_set_error(cli, status);3480 }3481 3454 return status; 3482 3455 } … … 3602 3575 fail: 3603 3576 TALLOC_FREE(frame); 3604 if (!NT_STATUS_IS_OK(status)) {3605 cli_set_error(cli, status);3606 }3607 3577 return status; 3608 3578 } … … 3724 3694 fail: 3725 3695 TALLOC_FREE(frame); 3726 if (!NT_STATUS_IS_OK(status)) {3727 cli_set_error(cli, status);3728 }3729 3696 return status; 3730 3697 } … … 3838 3805 fail: 3839 3806 TALLOC_FREE(frame); 3840 if (!NT_STATUS_IS_OK(status)) {3841 cli_set_error(cli, status);3842 }3843 3807 return status; 3844 3808 } … … 3995 3959 fail: 3996 3960 TALLOC_FREE(frame); 3997 if (!NT_STATUS_IS_OK(status)) {3998 cli_set_error(cli, status);3999 }4000 3961 return status; 4001 3962 } … … 4326 4287 fail: 4327 4288 TALLOC_FREE(frame); 4328 if (!NT_STATUS_IS_OK(status)) {4329 cli_set_error(cli, status);4330 }4331 4289 return status; 4332 4290 } … … 4555 4513 fail: 4556 4514 TALLOC_FREE(frame); 4557 if (!NT_STATUS_IS_OK(status)) {4558 cli_set_error(cli, status);4559 }4560 4515 return status; 4561 4516 } … … 4616 4571 fail: 4617 4572 TALLOC_FREE(frame); 4618 if (!NT_STATUS_IS_OK(status)) {4619 cli_set_error(cli, status);4620 }4621 4573 return status; 4622 4574 } … … 4724 4676 fail: 4725 4677 TALLOC_FREE(frame); 4726 if (!NT_STATUS_IS_OK(status)) {4727 cli_set_error(cli, status);4728 }4729 4678 return status; 4730 4679 } … … 4788 4737 fail: 4789 4738 TALLOC_FREE(frame); 4790 if (!NT_STATUS_IS_OK(status)) {4791 cli_set_error(cli, status);4792 }4793 4739 return status; 4794 4740 } … … 5073 5019 fail: 5074 5020 TALLOC_FREE(frame); 5075 if (!NT_STATUS_IS_OK(status)) {5076 cli_set_error(cli, status);5077 }5078 5021 return status; 5079 5022 } … … 5205 5148 fail: 5206 5149 TALLOC_FREE(frame); 5207 if (!NT_STATUS_IS_OK(status)) {5208 cli_set_error(cli, status);5209 }5210 5150 return status; 5211 5151 } … … 5287 5227 fail: 5288 5228 TALLOC_FREE(frame); 5289 if (!NT_STATUS_IS_OK(status)) {5290 cli_set_error(cli, status);5291 }5292 5229 return status; 5293 5230 } … … 5322 5259 SIVAL(state->setup + 0, 0, FSCTL_GET_SHADOW_COPY_DATA); 5323 5260 SSVAL(state->setup + 2, 0, fnum); 5324 SCVAL(state->setup + 3, 0, 0); /* isFsctl */5261 SCVAL(state->setup + 3, 0, ); /* isFsctl */ 5325 5262 SCVAL(state->setup + 3, 1, 0); /* compfilter, isFlags (WSSP) */ 5326 5263 … … 5435 5372 fail: 5436 5373 TALLOC_FREE(frame); 5437 if (!NT_STATUS_IS_OK(status)) {5438 cli_set_error(cli, status);5439 }5440 5374 return status; 5441 5375 }
Note:
See TracChangeset
for help on using the changeset viewer.
