14bff34e3Sthurlow /* 24bff34e3Sthurlow * Copyright (c) 2000, Boris Popov 34bff34e3Sthurlow * All rights reserved. 44bff34e3Sthurlow * 54bff34e3Sthurlow * Redistribution and use in source and binary forms, with or without 64bff34e3Sthurlow * modification, are permitted provided that the following conditions 74bff34e3Sthurlow * are met: 84bff34e3Sthurlow * 1. Redistributions of source code must retain the above copyright 94bff34e3Sthurlow * notice, this list of conditions and the following disclaimer. 104bff34e3Sthurlow * 2. Redistributions in binary form must reproduce the above copyright 114bff34e3Sthurlow * notice, this list of conditions and the following disclaimer in the 124bff34e3Sthurlow * documentation and/or other materials provided with the distribution. 134bff34e3Sthurlow * 3. All advertising materials mentioning features or use of this software 144bff34e3Sthurlow * must display the following acknowledgement: 154bff34e3Sthurlow * This product includes software developed by Boris Popov. 164bff34e3Sthurlow * 4. Neither the name of the author nor the names of any co-contributors 174bff34e3Sthurlow * may be used to endorse or promote products derived from this software 184bff34e3Sthurlow * without specific prior written permission. 194bff34e3Sthurlow * 204bff34e3Sthurlow * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 214bff34e3Sthurlow * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 224bff34e3Sthurlow * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 234bff34e3Sthurlow * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 244bff34e3Sthurlow * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 254bff34e3Sthurlow * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 264bff34e3Sthurlow * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 274bff34e3Sthurlow * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 284bff34e3Sthurlow * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 294bff34e3Sthurlow * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 304bff34e3Sthurlow * SUCH DAMAGE. 314bff34e3Sthurlow * 324bff34e3Sthurlow * $Id: rap.c,v 1.5 2004/12/13 00:25:23 lindak Exp $ 334bff34e3Sthurlow * 344bff34e3Sthurlow * This is very simple implementation of RAP protocol. 354bff34e3Sthurlow */ 364bff34e3Sthurlow 374bff34e3Sthurlow #include <sys/param.h> 384bff34e3Sthurlow #include <sys/errno.h> 394bff34e3Sthurlow #include <sys/stat.h> 404bff34e3Sthurlow #include <sys/isa_defs.h> 414bff34e3Sthurlow 424bff34e3Sthurlow #include <ctype.h> 434bff34e3Sthurlow #include <stdio.h> 444bff34e3Sthurlow #include <unistd.h> 454bff34e3Sthurlow #include <strings.h> 464bff34e3Sthurlow #include <stdlib.h> 474bff34e3Sthurlow #include <libintl.h> 484bff34e3Sthurlow #include <sysexits.h> 494bff34e3Sthurlow 504bff34e3Sthurlow #include <netsmb/mchain.h> 514bff34e3Sthurlow #include <netsmb/smb_lib.h> 524bff34e3Sthurlow #include <netsmb/smb_rap.h> 539c9af259SGordon Ross #include "private.h" 544bff34e3Sthurlow 554bff34e3Sthurlow static int 564bff34e3Sthurlow smb_rap_parserqparam(const char *s, char **next, int *rlen) 574bff34e3Sthurlow { 584bff34e3Sthurlow char *np; 594bff34e3Sthurlow int len; 604bff34e3Sthurlow 614bff34e3Sthurlow switch (*s++) { 624bff34e3Sthurlow case 'L': 634bff34e3Sthurlow case 'T': 644bff34e3Sthurlow case 'W': 654bff34e3Sthurlow len = 2; 664bff34e3Sthurlow break; 674bff34e3Sthurlow case 'D': 684bff34e3Sthurlow case 'O': 694bff34e3Sthurlow len = 4; 704bff34e3Sthurlow break; 714bff34e3Sthurlow case 'b': 724bff34e3Sthurlow case 'F': 734bff34e3Sthurlow len = 1; 744bff34e3Sthurlow break; 754bff34e3Sthurlow case 'r': 764bff34e3Sthurlow case 's': 774bff34e3Sthurlow len = 0; 784bff34e3Sthurlow break; 794bff34e3Sthurlow default: 804bff34e3Sthurlow return (EINVAL); 814bff34e3Sthurlow } 824bff34e3Sthurlow if (isdigit(*s)) { 834bff34e3Sthurlow len *= strtoul(s, &np, 10); 844bff34e3Sthurlow s = np; 854bff34e3Sthurlow } 864bff34e3Sthurlow *rlen = len; 874bff34e3Sthurlow *(const char **)next = s; 884bff34e3Sthurlow return (0); 894bff34e3Sthurlow } 904bff34e3Sthurlow 914bff34e3Sthurlow static int 924bff34e3Sthurlow smb_rap_parserpparam(const char *s, char **next, int *rlen) 934bff34e3Sthurlow { 944bff34e3Sthurlow char *np; 954bff34e3Sthurlow int len = 0; 964bff34e3Sthurlow 974bff34e3Sthurlow switch (*s++) { 984bff34e3Sthurlow case 'e': 994bff34e3Sthurlow case 'h': 1004bff34e3Sthurlow len = 2; 1014bff34e3Sthurlow break; 1024bff34e3Sthurlow case 'i': 1034bff34e3Sthurlow len = 4; 1044bff34e3Sthurlow break; 1054bff34e3Sthurlow case 'g': 1064bff34e3Sthurlow len = 1; 1074bff34e3Sthurlow break; 1084bff34e3Sthurlow default: 1094bff34e3Sthurlow return (EINVAL); 1104bff34e3Sthurlow } 1114bff34e3Sthurlow if (isdigit(*s)) { 1124bff34e3Sthurlow len *= strtoul(s, &np, 10); 1134bff34e3Sthurlow s = np; 1144bff34e3Sthurlow } 1154bff34e3Sthurlow *rlen = len; 1164bff34e3Sthurlow *(const char **)next = s; 1174bff34e3Sthurlow return (0); 1184bff34e3Sthurlow } 1194bff34e3Sthurlow 1204bff34e3Sthurlow static int 1214bff34e3Sthurlow smb_rap_parserpdata(const char *s, char **next, int *rlen) 1224bff34e3Sthurlow { 1234bff34e3Sthurlow char *np; 1244bff34e3Sthurlow int len; 1254bff34e3Sthurlow 1264bff34e3Sthurlow switch (*s++) { 1274bff34e3Sthurlow case 'B': 1284bff34e3Sthurlow len = 1; 1294bff34e3Sthurlow break; 1304bff34e3Sthurlow case 'W': 1314bff34e3Sthurlow len = 2; 1324bff34e3Sthurlow break; 1334bff34e3Sthurlow case 'D': 1344bff34e3Sthurlow case 'O': 1354bff34e3Sthurlow case 'z': 1364bff34e3Sthurlow len = 4; 1374bff34e3Sthurlow break; 1384bff34e3Sthurlow default: 1394bff34e3Sthurlow return (EINVAL); 1404bff34e3Sthurlow } 1414bff34e3Sthurlow if (isdigit(*s)) { 1424bff34e3Sthurlow len *= strtoul(s, &np, 10); 1434bff34e3Sthurlow s = np; 1444bff34e3Sthurlow } 1454bff34e3Sthurlow *rlen = len; 1464bff34e3Sthurlow *(const char **)next = s; 1474bff34e3Sthurlow return (0); 1484bff34e3Sthurlow } 1494bff34e3Sthurlow 1504bff34e3Sthurlow static int 1514bff34e3Sthurlow smb_rap_rqparam_z(struct smb_rap *rap, const char *value) 1524bff34e3Sthurlow { 1534bff34e3Sthurlow int len = strlen(value) + 1; 1544bff34e3Sthurlow 1554bff34e3Sthurlow bcopy(value, rap->r_npbuf, len); 1564bff34e3Sthurlow rap->r_npbuf += len; 1574bff34e3Sthurlow rap->r_plen += len; 1584bff34e3Sthurlow return (0); 1594bff34e3Sthurlow } 1604bff34e3Sthurlow 1614bff34e3Sthurlow /* 1624bff34e3Sthurlow * Marshal RAP request parameters. 1634bff34e3Sthurlow * Note: value is in host order. 1644bff34e3Sthurlow */ 1654bff34e3Sthurlow static int 1664bff34e3Sthurlow smb_rap_rqparam(struct smb_rap *rap, char ptype, char plen, int value) 1674bff34e3Sthurlow { 1684bff34e3Sthurlow int len = 0; 1694bff34e3Sthurlow uint_t uv = (uint_t)value; 1709c9af259SGordon Ross uint32_t *lp; 1719c9af259SGordon Ross uint16_t *sp; 1729c9af259SGordon Ross char *p; 1734bff34e3Sthurlow 1744bff34e3Sthurlow switch (ptype) { 1754bff34e3Sthurlow case 'L': 1764bff34e3Sthurlow case 'W': 1774bff34e3Sthurlow /* LINTED */ 1789c9af259SGordon Ross sp = (uint16_t *)rap->r_npbuf; 1799c9af259SGordon Ross *sp = htoles(uv); 1809c9af259SGordon Ross len = sizeof (*sp); 1814bff34e3Sthurlow break; 1824bff34e3Sthurlow case 'D': 1834bff34e3Sthurlow /* LINTED */ 1849c9af259SGordon Ross lp = (uint32_t *)rap->r_npbuf; 1859c9af259SGordon Ross *lp = htolel(uv); 1869c9af259SGordon Ross len = sizeof (*lp); 1874bff34e3Sthurlow break; 1884bff34e3Sthurlow case 'b': 1899c9af259SGordon Ross p = rap->r_npbuf; 1904bff34e3Sthurlow memset(p, uv, plen); 1914bff34e3Sthurlow len = plen; 1924bff34e3Sthurlow default: 1934bff34e3Sthurlow return (EINVAL); 1944bff34e3Sthurlow } 1954bff34e3Sthurlow rap->r_npbuf += len; 1964bff34e3Sthurlow rap->r_plen += len; 1974bff34e3Sthurlow return (0); 1984bff34e3Sthurlow } 1994bff34e3Sthurlow 2004bff34e3Sthurlow int 2014bff34e3Sthurlow smb_rap_create(int fn, const char *param, const char *data, 2024bff34e3Sthurlow struct smb_rap **rapp) 2034bff34e3Sthurlow { 2044bff34e3Sthurlow struct smb_rap *rap; 2054bff34e3Sthurlow char *p; 2064bff34e3Sthurlow int plen = 0, len = 0; 2074bff34e3Sthurlow 2084bff34e3Sthurlow rap = malloc(sizeof (*rap)); 2094bff34e3Sthurlow if (rap == NULL) 2104bff34e3Sthurlow return (ENOMEM); 2114bff34e3Sthurlow bzero(rap, sizeof (*rap)); 2124bff34e3Sthurlow p = rap->r_sparam = rap->r_nparam = strdup(param); 2134bff34e3Sthurlow rap->r_sdata = rap->r_ndata = strdup(data); 2144bff34e3Sthurlow 2154bff34e3Sthurlow /* 2164bff34e3Sthurlow * Calculate length of request parameter block 2174bff34e3Sthurlow */ 2184bff34e3Sthurlow len = 2 + strlen(param) + 1 + strlen(data) + 1; 2194bff34e3Sthurlow while (*p) { 2204bff34e3Sthurlow if (smb_rap_parserqparam(p, &p, &plen) != 0) 2214bff34e3Sthurlow break; 2224bff34e3Sthurlow len += plen; 2234bff34e3Sthurlow } 2244bff34e3Sthurlow rap->r_pbuf = rap->r_npbuf = malloc(len); 2254bff34e3Sthurlow smb_rap_rqparam(rap, 'W', 1, fn); 2264bff34e3Sthurlow smb_rap_rqparam_z(rap, rap->r_sparam); 2274bff34e3Sthurlow smb_rap_rqparam_z(rap, rap->r_sdata); 2284bff34e3Sthurlow *rapp = rap; 2294bff34e3Sthurlow return (0); 2304bff34e3Sthurlow } 2314bff34e3Sthurlow 2324bff34e3Sthurlow void 2334bff34e3Sthurlow smb_rap_done(struct smb_rap *rap) 2344bff34e3Sthurlow { 2354bff34e3Sthurlow if (rap->r_sparam) 2364bff34e3Sthurlow free(rap->r_sparam); 2374bff34e3Sthurlow if (rap->r_sdata) 2384bff34e3Sthurlow free(rap->r_sdata); 2394bff34e3Sthurlow if (rap->r_pbuf) 2404bff34e3Sthurlow free(rap->r_pbuf); 2414bff34e3Sthurlow #ifdef NOTYETDEFINED 2424bff34e3Sthurlow if (rap->r_npbuf) 2434bff34e3Sthurlow free(rap->r_npbuf); 2444bff34e3Sthurlow if (rap->r_dbuf) 2454bff34e3Sthurlow free(rap->r_dbuf); 2464bff34e3Sthurlow if (rap->r_rcvbuf) 2474bff34e3Sthurlow free(rap->r_rcvbuf); 2484bff34e3Sthurlow #endif 2494bff34e3Sthurlow free(rap); 2504bff34e3Sthurlow } 2514bff34e3Sthurlow 2524bff34e3Sthurlow int 2534bff34e3Sthurlow smb_rap_setNparam(struct smb_rap *rap, int value) 2544bff34e3Sthurlow { 2554bff34e3Sthurlow char *p = rap->r_nparam; 2564bff34e3Sthurlow char ptype = *p; 2574bff34e3Sthurlow int error, plen; 2584bff34e3Sthurlow 2594bff34e3Sthurlow error = smb_rap_parserqparam(p, &p, &plen); 2604bff34e3Sthurlow if (error) 2614bff34e3Sthurlow return (error); 2624bff34e3Sthurlow switch (ptype) { 2634bff34e3Sthurlow case 'L': 2644bff34e3Sthurlow rap->r_rcvbuflen = value; 2654bff34e3Sthurlow /* FALLTHROUGH */ 2664bff34e3Sthurlow case 'W': 2674bff34e3Sthurlow case 'D': 2684bff34e3Sthurlow case 'b': 2694bff34e3Sthurlow error = smb_rap_rqparam(rap, ptype, plen, value); 2704bff34e3Sthurlow break; 2714bff34e3Sthurlow default: 2724bff34e3Sthurlow return (EINVAL); 2734bff34e3Sthurlow } 2744bff34e3Sthurlow rap->r_nparam = p; 2754bff34e3Sthurlow return (0); 2764bff34e3Sthurlow } 2774bff34e3Sthurlow 2784bff34e3Sthurlow int 2794bff34e3Sthurlow smb_rap_setPparam(struct smb_rap *rap, void *value) 2804bff34e3Sthurlow { 2814bff34e3Sthurlow char *p = rap->r_nparam; 2824bff34e3Sthurlow char ptype = *p; 2834bff34e3Sthurlow int error, plen; 2844bff34e3Sthurlow 2854bff34e3Sthurlow error = smb_rap_parserqparam(p, &p, &plen); 2864bff34e3Sthurlow if (error) 2874bff34e3Sthurlow return (error); 2884bff34e3Sthurlow switch (ptype) { 2894bff34e3Sthurlow case 'r': 2904bff34e3Sthurlow rap->r_rcvbuf = value; 2914bff34e3Sthurlow break; 2924bff34e3Sthurlow default: 2934bff34e3Sthurlow return (EINVAL); 2944bff34e3Sthurlow } 2954bff34e3Sthurlow rap->r_nparam = p; 2964bff34e3Sthurlow return (0); 2974bff34e3Sthurlow } 2984bff34e3Sthurlow 2999c9af259SGordon Ross int 3004bff34e3Sthurlow smb_rap_getNparam(struct smb_rap *rap, long *value) 3014bff34e3Sthurlow { 3024bff34e3Sthurlow char *p = rap->r_nparam; 3034bff34e3Sthurlow char ptype = *p; 3044bff34e3Sthurlow int error, plen; 3054bff34e3Sthurlow uint16_t *te; 3064bff34e3Sthurlow 3074bff34e3Sthurlow error = smb_rap_parserpparam(p, &p, &plen); 3084bff34e3Sthurlow if (error) 3094bff34e3Sthurlow return (error); 3104bff34e3Sthurlow switch (ptype) { 3114bff34e3Sthurlow case 'h': 3124bff34e3Sthurlow /* LINTED */ 3134bff34e3Sthurlow te = (uint16_t *)rap->r_npbuf; 3144bff34e3Sthurlow *value = letohs(*te); 3154bff34e3Sthurlow break; 3164bff34e3Sthurlow default: 3174bff34e3Sthurlow return (EINVAL); 3184bff34e3Sthurlow } 3194bff34e3Sthurlow rap->r_npbuf += plen; 3204bff34e3Sthurlow rap->r_nparam = p; 3214bff34e3Sthurlow return (0); 3224bff34e3Sthurlow } 3234bff34e3Sthurlow 3244bff34e3Sthurlow int 3254bff34e3Sthurlow smb_rap_request(struct smb_rap *rap, struct smb_ctx *ctx) 3264bff34e3Sthurlow { 3274bff34e3Sthurlow uint16_t *rp, conv, *tmp; 328*613a2f6bSGordon Ross uint32_t *p32; 3294bff34e3Sthurlow char *dp, *p = rap->r_nparam; 3304bff34e3Sthurlow char ptype; 331*613a2f6bSGordon Ross int error, rdatacnt, rparamcnt, entries, done, dlen, buffer_oflow; 3324bff34e3Sthurlow 3334bff34e3Sthurlow rdatacnt = rap->r_rcvbuflen; 3344bff34e3Sthurlow rparamcnt = rap->r_plen; 3354bff34e3Sthurlow error = smb_t2_request(ctx, 0, NULL, "\\PIPE\\LANMAN", 3364bff34e3Sthurlow rap->r_plen, rap->r_pbuf, /* int tparamcnt,void *tparam */ 3374bff34e3Sthurlow 0, NULL, /* int tdatacnt, void *tdata */ 3384bff34e3Sthurlow &rparamcnt, rap->r_pbuf, /* rparamcnt, void *rparam */ 3394bff34e3Sthurlow &rdatacnt, rap->r_rcvbuf, /* int *rdatacnt, void *rdata */ 3404bff34e3Sthurlow &buffer_oflow); 3414bff34e3Sthurlow if (error) 3424bff34e3Sthurlow return (error); 3434bff34e3Sthurlow 3444bff34e3Sthurlow /* LINTED */ 3454bff34e3Sthurlow rp = (uint16_t *)rap->r_pbuf; 3464bff34e3Sthurlow 3474bff34e3Sthurlow /* 3484bff34e3Sthurlow * Note: First is a "LanMan API" error code. 3494bff34e3Sthurlow * See: usr/src/uts/common/smbsrv/lmerr.h 3504bff34e3Sthurlow */ 3514bff34e3Sthurlow if (rparamcnt < 2) 3524bff34e3Sthurlow return (EBADRPC); 3534bff34e3Sthurlow rap->r_result = letohs(*rp); 3544bff34e3Sthurlow rp++; rparamcnt -= 2; 3554bff34e3Sthurlow 3564bff34e3Sthurlow if (rap->r_result != 0) { 3574bff34e3Sthurlow /* 3584bff34e3Sthurlow * Could also return zero and let the caller 3594bff34e3Sthurlow * come get r_result via smb_rap_error(), 3604bff34e3Sthurlow * but in case they dont... 3614bff34e3Sthurlow */ 3624bff34e3Sthurlow return (rap->r_result | SMB_RAP_ERROR); 3634bff34e3Sthurlow } 3644bff34e3Sthurlow 3654bff34e3Sthurlow if (rparamcnt < 2) 3664bff34e3Sthurlow return (EBADRPC); 3674bff34e3Sthurlow conv = letohs(*rp); 3684bff34e3Sthurlow rp++; rparamcnt -= 2; 3694bff34e3Sthurlow 3704bff34e3Sthurlow rap->r_npbuf = (char *)rp; 3714bff34e3Sthurlow rap->r_entries = entries = 0; 3724bff34e3Sthurlow /* Save the returned data length */ 3734bff34e3Sthurlow rap->r_rcvbuflen = rdatacnt; 3744bff34e3Sthurlow done = 0; 3754bff34e3Sthurlow 3764bff34e3Sthurlow while (!done && *p) { 3774bff34e3Sthurlow ptype = *p; 3784bff34e3Sthurlow switch (ptype) { 3794bff34e3Sthurlow case 'e': 3804bff34e3Sthurlow if (rparamcnt < 2) 3814bff34e3Sthurlow return (EBADRPC); 3824bff34e3Sthurlow /* LINTED */ 3834bff34e3Sthurlow tmp = (uint16_t *)rap->r_npbuf; 3844bff34e3Sthurlow rap->r_entries = entries = letohs(*tmp); 3854bff34e3Sthurlow rap->r_npbuf += 2; 3864bff34e3Sthurlow rparamcnt -= 2; 3874bff34e3Sthurlow p++; 3884bff34e3Sthurlow break; 3894bff34e3Sthurlow default: 3904bff34e3Sthurlow done = 1; 3914bff34e3Sthurlow } 3924bff34e3Sthurlow #if 0 /* commented out in Darwin. Why? */ 3934bff34e3Sthurlow error = smb_rap_parserpparam(p, &p, &plen); 3944bff34e3Sthurlow if (error) { 3954bff34e3Sthurlow smb_error(dgettext(TEXT_DOMAIN, 3964bff34e3Sthurlow "reply parameter mismatch %s"), 0, p); 3974bff34e3Sthurlow return (EBADRPC); 3984bff34e3Sthurlow } 3994bff34e3Sthurlow #endif 4004bff34e3Sthurlow } 4014bff34e3Sthurlow rap->r_nparam = p; 4024bff34e3Sthurlow /* 4034bff34e3Sthurlow * In general, unpacking entries we may need to relocate 4044bff34e3Sthurlow * entries for proper aligning. For now use them as is. 4054bff34e3Sthurlow */ 4064bff34e3Sthurlow dp = rap->r_rcvbuf; 4074bff34e3Sthurlow while (entries--) { 4084bff34e3Sthurlow p = rap->r_sdata; 4094bff34e3Sthurlow while (*p) { 4104bff34e3Sthurlow ptype = *p; 4114bff34e3Sthurlow error = smb_rap_parserpdata(p, &p, &dlen); 4124bff34e3Sthurlow if (error) { 4134bff34e3Sthurlow smb_error(dgettext(TEXT_DOMAIN, 4144bff34e3Sthurlow "reply data mismatch %s"), 0, p); 4154bff34e3Sthurlow return (EBADRPC); 4164bff34e3Sthurlow } 4174bff34e3Sthurlow if (rdatacnt < dlen) 4184bff34e3Sthurlow return (EBADRPC); 4194bff34e3Sthurlow switch (ptype) { 4204bff34e3Sthurlow case 'z': 4214bff34e3Sthurlow /* LINTED */ 4224bff34e3Sthurlow p32 = (uint32_t *)dp; 4234bff34e3Sthurlow *p32 = (letohl(*p32) & 0xffff) - conv; 4244bff34e3Sthurlow break; 4254bff34e3Sthurlow } 4264bff34e3Sthurlow dp += dlen; 4274bff34e3Sthurlow rdatacnt -= dlen; 4284bff34e3Sthurlow } 4294bff34e3Sthurlow } 4304bff34e3Sthurlow return (error); 4314bff34e3Sthurlow } 4324bff34e3Sthurlow 4334bff34e3Sthurlow int 4344bff34e3Sthurlow smb_rap_error(struct smb_rap *rap, int error) 4354bff34e3Sthurlow { 4364bff34e3Sthurlow if (error) 4374bff34e3Sthurlow return (error); 4384bff34e3Sthurlow if (rap->r_result == 0) 4394bff34e3Sthurlow return (0); 4404bff34e3Sthurlow return (rap->r_result | SMB_RAP_ERROR); 4414bff34e3Sthurlow } 442