Ignore:
Timestamp:
Nov 29, 2012, 1:59:04 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/libsmb/clifile.c

    r745 r751  
    359359 fail:
    360360        TALLOC_FREE(frame);
    361         if (!NT_STATUS_IS_OK(status)) {
    362                 cli_set_error(cli, status);
    363         }
    364361        return status;
    365362}
     
    504501 fail:
    505502        TALLOC_FREE(frame);
    506         if (!NT_STATUS_IS_OK(status)) {
    507                 cli_set_error(cli, status);
    508         }
    509503        return status;
    510504}
     
    571565 fail:
    572566        TALLOC_FREE(frame);
    573         if (!NT_STATUS_IS_OK(status)) {
    574                 cli_set_error(cli, status);
    575         }
    576567        return status;
    577568}
     
    779770 fail:
    780771        TALLOC_FREE(frame);
    781         if (!NT_STATUS_IS_OK(status)) {
    782                 cli_set_error(cli, status);
    783         }
    784772        return status;
    785773}
     
    913901 fail:
    914902        TALLOC_FREE(frame);
    915         if (!NT_STATUS_IS_OK(status)) {
    916                 cli_set_error(cli, status);
    917         }
    918903        return status;
    919904}
     
    10301015 fail:
    10311016        TALLOC_FREE(frame);
    1032         if (!NT_STATUS_IS_OK(status)) {
    1033                 cli_set_error(cli, status);
    1034         }
    10351017        return status;
    10361018}
     
    11031085 fail:
    11041086        TALLOC_FREE(frame);
    1105         if (!NT_STATUS_IS_OK(status)) {
    1106                 cli_set_error(cli, status);
    1107         }
    11081087        return status;
    11091088}
     
    12251204 fail:
    12261205        TALLOC_FREE(frame);
    1227         if (!NT_STATUS_IS_OK(status)) {
    1228                 cli_set_error(cli, status);
    1229         }
    12301206        return status;
    12311207}
     
    13691345 fail:
    13701346        TALLOC_FREE(frame);
    1371         if (!NT_STATUS_IS_OK(status)) {
    1372                 cli_set_error(cli, status);
    1373         }
    13741347        return status;
    13751348}
     
    14341407 fail:
    14351408        TALLOC_FREE(frame);
    1436         if (!NT_STATUS_IS_OK(status)) {
    1437                 cli_set_error(cli, status);
    1438         }
    14391409        return status;
    14401410}
     
    15441514 fail:
    15451515        TALLOC_FREE(frame);
    1546         if (!NT_STATUS_IS_OK(status)) {
    1547                 cli_set_error(cli, status);
    1548         }
    15491516        return status;
    15501517}
     
    16511618 fail:
    16521619        TALLOC_FREE(frame);
    1653         if (!NT_STATUS_IS_OK(status)) {
    1654                 cli_set_error(cli, status);
    1655         }
    16561620        return status;
    16571621}
     
    17581722 fail:
    17591723        TALLOC_FREE(frame);
    1760         if (!NT_STATUS_IS_OK(status)) {
    1761                 cli_set_error(cli, status);
    1762         }
    17631724        return status;
    17641725}
     
    18751836 fail:
    18761837        TALLOC_FREE(frame);
    1877         if (!NT_STATUS_IS_OK(status)) {
    1878                 cli_set_error(cli, status);
    1879         }
    18801838        return status;
    18811839}
     
    20391997 fail:
    20401998        TALLOC_FREE(frame);
    2041         if (!NT_STATUS_IS_OK(status)) {
    2042                 cli_set_error(cli, status);
    2043         }
    20441999        return status;
    20452000}
     
    20512006
    20522007struct cli_open_state {
     2008
     2009
     2010
    20532011        uint16_t vwv[15];
    20542012        uint16_t fnum;
     2013
     2014
     2015
    20552016        struct iovec bytes;
    20562017};
    20572018
    20582019static void cli_open_done(struct tevent_req *subreq);
     2020
    20592021
    20602022struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
     
    20662028        struct tevent_req *req, *subreq;
    20672029        struct cli_open_state *state;
    2068         unsigned openfn;
    2069         unsigned accessmode;
    2070         uint8_t additional_flags;
    20712030        uint8_t *bytes;
    20722031
     
    20752034                return NULL;
    20762035        }
    2077 
    2078         openfn = 0;
     2036        state->ev = ev;
     2037        state->cli = cli;
     2038        state->fname = fname;
     2039
    20792040        if (flags & O_CREAT) {
    2080                 openfn |= (1<<4);
     2041                openfn |= (1<<4);
    20812042        }
    20822043        if (!(flags & O_EXCL)) {
    20832044                if (flags & O_TRUNC)
    2084                         openfn |= (1<<1);
     2045                        openfn |= (1<<1);
    20852046                else
    2086                         openfn |= (1<<0);
    2087         }
    2088 
    2089         accessmode = (share_mode<<4);
     2047                        openfn |= (1<<0);
     2048        }
     2049
     2050        = (share_mode<<4);
    20902051
    20912052        if ((flags & O_ACCMODE) == O_RDWR) {
    2092                 accessmode |= 2;
     2053                |= 2;
    20932054        } else if ((flags & O_ACCMODE) == O_WRONLY) {
    2094                 accessmode |= 1;
     2055                |= 1;
    20952056        }
    20962057
    20972058#if defined(O_SYNC)
    20982059        if ((flags & O_SYNC) == O_SYNC) {
    2099                 accessmode |= (1<<14);
     2060                |= (1<<14);
    21002061        }
    21012062#endif /* O_SYNC */
    21022063
    21032064        if (share_mode == DENY_FCB) {
    2104                 accessmode = 0xFF;
     2065                = 0xFF;
    21052066        }
    21062067
     
    21092070        SSVAL(state->vwv + 1, 0, 0);
    21102071        SSVAL(state->vwv + 2, 0, 0);  /* no additional info */
    2111         SSVAL(state->vwv + 3, 0, accessmode);
     2072        SSVAL(state->vwv + 3, 0, );
    21122073        SSVAL(state->vwv + 4, 0, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
    21132074        SSVAL(state->vwv + 5, 0, 0);
    21142075        SIVAL(state->vwv + 6, 0, 0);
    2115         SSVAL(state->vwv + 8, 0, openfn);
     2076        SSVAL(state->vwv + 8, 0, openfn);
    21162077        SIVAL(state->vwv + 9, 0, 0);
    21172078        SIVAL(state->vwv + 11, 0, 0);
    21182079        SIVAL(state->vwv + 13, 0, 0);
    21192080
    2120         additional_flags = 0;
    2121 
    21222081        if (cli->use_oplocks) {
    21232082                /* if using oplocks then ask for a batch oplock via
    21242083                   core and extended methods */
    2125                 additional_flags =
     2084                additional_flags =
    21262085                        FLAG_REQUEST_OPLOCK|FLAG_REQUEST_BATCH_OPLOCK;
    21272086                SSVAL(state->vwv+2, 0, SVAL(state->vwv+2, 0) | 6);
     
    21392098        state->bytes.iov_len = talloc_get_size(bytes);
    21402099
    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,
    21422102                                    15, state->vwv, 1, &state->bytes);
    21432103        if (subreq == NULL) {
     
    21802140        uint8_t *inbuf;
    21812141        NTSTATUS status;
     2142
    21822143
    21832144        status = cli_smb_recv(subreq, state, &inbuf, 3, &wct, &vwv, NULL,
    21842145                              NULL);
    21852146        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
    21862192        if (tevent_req_nterror(req, status)) {
    21872193                return;
    21882194        }
    2189         state->fnum = SVAL(vwv+2, 0);
    21902195        tevent_req_done(req);
    21912196}
     
    22402245 fail:
    22412246        TALLOC_FREE(frame);
    2242         if (!NT_STATUS_IS_OK(status)) {
    2243                 cli_set_error(cli, status);
    2244         }
    22452247        return status;
    22462248}
     
    23582360 fail:
    23592361        TALLOC_FREE(frame);
    2360         if (!NT_STATUS_IS_OK(status)) {
    2361                 cli_set_error(cli, status);
    2362         }
    23632362        return status;
    23642363}
     
    24762475 fail:
    24772476        TALLOC_FREE(frame);
    2478         if (!NT_STATUS_IS_OK(status)) {
    2479                 cli_set_error(cli, status);
    2480         }
    24812477        return status;
    24822478}
     
    25382534        status = cli_locktype(cli, fnum, offset, len, timeout,
    25392535                              (lock_type == READ_LOCK? 1 : 0));
    2540         cli_set_error(cli, status);
    25412536        return NT_STATUS_IS_OK(status);
    25422537}
     
    26492644 fail:
    26502645        TALLOC_FREE(frame);
    2651         if (!NT_STATUS_IS_OK(status)) {
    2652                 cli_set_error(cli, status);
    2653         }
    26542646        return status;
    26552647}
     
    27022694        cli->timeout = saved_timeout;
    27032695
    2704         cli_set_error(cli, status);
    27052696        return NT_STATUS_IS_OK(status);
    27062697}
     
    28172808 fail:
    28182809        TALLOC_FREE(frame);
    2819         if (!NT_STATUS_IS_OK(status)) {
    2820                 cli_set_error(cli, status);
    2821         }
    28222810        return status;
    28232811}
     
    29912979 fail:
    29922980        TALLOC_FREE(frame);
    2993         if (!NT_STATUS_IS_OK(status)) {
    2994                 cli_set_error(cli, status);
    2995         }
    29962981        return status;
    29972982}
     
    30583043 fail:
    30593044        TALLOC_FREE(frame);
    3060         if (!NT_STATUS_IS_OK(status)) {
    3061                 cli_set_error(cli, status);
    3062         }
    30633045        return status;
    30643046}
     
    32123194 fail:
    32133195        TALLOC_FREE(frame);
    3214         if (!NT_STATUS_IS_OK(status)) {
    3215                 cli_set_error(cli, status);
    3216         }
    32173196        return status;
    32183197}
     
    33613340 fail:
    33623341        TALLOC_FREE(frame);
    3363         if (!NT_STATUS_IS_OK(status)) {
    3364                 cli_set_error(cli, status);
    3365         }
    33663342        return status;
    33673343}
     
    34763452 fail:
    34773453        TALLOC_FREE(frame);
    3478         if (!NT_STATUS_IS_OK(status)) {
    3479                 cli_set_error(cli, status);
    3480         }
    34813454        return status;
    34823455}
     
    36023575 fail:
    36033576        TALLOC_FREE(frame);
    3604         if (!NT_STATUS_IS_OK(status)) {
    3605                 cli_set_error(cli, status);
    3606         }
    36073577        return status;
    36083578}
     
    37243694 fail:
    37253695        TALLOC_FREE(frame);
    3726         if (!NT_STATUS_IS_OK(status)) {
    3727                 cli_set_error(cli, status);
    3728         }
    37293696        return status;
    37303697}
     
    38383805 fail:
    38393806        TALLOC_FREE(frame);
    3840         if (!NT_STATUS_IS_OK(status)) {
    3841                 cli_set_error(cli, status);
    3842         }
    38433807        return status;
    38443808}
     
    39953959 fail:
    39963960        TALLOC_FREE(frame);
    3997         if (!NT_STATUS_IS_OK(status)) {
    3998                 cli_set_error(cli, status);
    3999         }
    40003961        return status;
    40013962}
     
    43264287 fail:
    43274288        TALLOC_FREE(frame);
    4328         if (!NT_STATUS_IS_OK(status)) {
    4329                 cli_set_error(cli, status);
    4330         }
    43314289        return status;
    43324290}
     
    45554513 fail:
    45564514        TALLOC_FREE(frame);
    4557         if (!NT_STATUS_IS_OK(status)) {
    4558                 cli_set_error(cli, status);
    4559         }
    45604515        return status;
    45614516}
     
    46164571 fail:
    46174572        TALLOC_FREE(frame);
    4618         if (!NT_STATUS_IS_OK(status)) {
    4619                 cli_set_error(cli, status);
    4620         }
    46214573        return status;
    46224574}
     
    47244676 fail:
    47254677        TALLOC_FREE(frame);
    4726         if (!NT_STATUS_IS_OK(status)) {
    4727                 cli_set_error(cli, status);
    4728         }
    47294678        return status;
    47304679}
     
    47884737 fail:
    47894738        TALLOC_FREE(frame);
    4790         if (!NT_STATUS_IS_OK(status)) {
    4791                 cli_set_error(cli, status);
    4792         }
    47934739        return status;
    47944740}
     
    50735019 fail:
    50745020        TALLOC_FREE(frame);
    5075         if (!NT_STATUS_IS_OK(status)) {
    5076                 cli_set_error(cli, status);
    5077         }
    50785021        return status;
    50795022}
     
    52055148 fail:
    52065149        TALLOC_FREE(frame);
    5207         if (!NT_STATUS_IS_OK(status)) {
    5208                 cli_set_error(cli, status);
    5209         }
    52105150        return status;
    52115151}
     
    52875227 fail:
    52885228        TALLOC_FREE(frame);
    5289         if (!NT_STATUS_IS_OK(status)) {
    5290                 cli_set_error(cli, status);
    5291         }
    52925229        return status;
    52935230}
     
    53225259        SIVAL(state->setup + 0, 0, FSCTL_GET_SHADOW_COPY_DATA);
    53235260        SSVAL(state->setup + 2, 0, fnum);
    5324         SCVAL(state->setup + 3, 0, 0); /* isFsctl */
     5261        SCVAL(state->setup + 3, 0, ); /* isFsctl */
    53255262        SCVAL(state->setup + 3, 1, 0); /* compfilter, isFlags (WSSP) */
    53265263
     
    54355372 fail:
    54365373        TALLOC_FREE(frame);
    5437         if (!NT_STATUS_IS_OK(status)) {
    5438                 cli_set_error(cli, status);
    5439         }
    54405374        return status;
    54415375}
Note: See TracChangeset for help on using the changeset viewer.