smb_rq.c (87565) | smb_rq.c (88741) |
---|---|
1/* 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 2000-2001, Boris Popov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/netsmb/smb_rq.c 87565 2001-12-09 17:48:08Z arr $ | 32 * $FreeBSD: head/sys/netsmb/smb_rq.c 88741 2001-12-31 19:29:43Z bp $ |
33 */ 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/malloc.h> 38#include <sys/proc.h> 39#include <sys/lock.h> 40#include <sys/sysctl.h> --- 405 unchanged lines hidden (view full) --- 446 * this is an interim response, ignore it. 447 */ 448 SMBRQ_SLOCK(rqp); 449 md_next_record(&rqp->sr_rp); 450 SMBRQ_SUNLOCK(rqp); 451 return 0; 452 } 453 /* | 33 */ 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/malloc.h> 38#include <sys/proc.h> 39#include <sys/lock.h> 40#include <sys/sysctl.h> --- 405 unchanged lines hidden (view full) --- 446 * this is an interim response, ignore it. 447 */ 448 SMBRQ_SLOCK(rqp); 449 md_next_record(&rqp->sr_rp); 450 SMBRQ_SUNLOCK(rqp); 451 return 0; 452 } 453 /* |
454 * Now we have to get all subseqent responses. The CIFS specification 455 * says that they can be misordered which is weird. | 454 * Now we have to get all subsequent responses. The CIFS specification 455 * says that they can be disordered which is weird. |
456 * TODO: timo 457 */ 458 totpgot = totdgot = 0; 459 totpcount = totdcount = 0xffff; 460 mdp = &rqp->sr_rp; 461 for (;;) { 462 m_dumpm(mdp->md_top); 463 if ((error = md_get_uint8(mdp, &wc)) != 0) --- 10 unchanged lines hidden (view full) --- 474 if (totdcount > tmp) 475 totdcount = tmp; 476 if ((error = md_get_uint16le(mdp, &tmp)) != 0 || /* reserved */ 477 (error = md_get_uint16le(mdp, &pcount)) != 0 || 478 (error = md_get_uint16le(mdp, &poff)) != 0 || 479 (error = md_get_uint16le(mdp, &pdisp)) != 0) 480 break; 481 if (pcount != 0 && pdisp != totpgot) { | 456 * TODO: timo 457 */ 458 totpgot = totdgot = 0; 459 totpcount = totdcount = 0xffff; 460 mdp = &rqp->sr_rp; 461 for (;;) { 462 m_dumpm(mdp->md_top); 463 if ((error = md_get_uint8(mdp, &wc)) != 0) --- 10 unchanged lines hidden (view full) --- 474 if (totdcount > tmp) 475 totdcount = tmp; 476 if ((error = md_get_uint16le(mdp, &tmp)) != 0 || /* reserved */ 477 (error = md_get_uint16le(mdp, &pcount)) != 0 || 478 (error = md_get_uint16le(mdp, &poff)) != 0 || 479 (error = md_get_uint16le(mdp, &pdisp)) != 0) 480 break; 481 if (pcount != 0 && pdisp != totpgot) { |
482 SMBERROR("Can't handle misordered parameters %d:%d\n", | 482 SMBERROR("Can't handle disordered parameters %d:%d\n", |
483 pdisp, totpgot); 484 error = EINVAL; 485 break; 486 } 487 if ((error = md_get_uint16le(mdp, &dcount)) != 0 || 488 (error = md_get_uint16le(mdp, &doff)) != 0 || 489 (error = md_get_uint16le(mdp, &ddisp)) != 0) 490 break; 491 if (dcount != 0 && ddisp != totdgot) { | 483 pdisp, totpgot); 484 error = EINVAL; 485 break; 486 } 487 if ((error = md_get_uint16le(mdp, &dcount)) != 0 || 488 (error = md_get_uint16le(mdp, &doff)) != 0 || 489 (error = md_get_uint16le(mdp, &ddisp)) != 0) 490 break; 491 if (dcount != 0 && ddisp != totdgot) { |
492 SMBERROR("Can't handle misordered data\n"); | 492 SMBERROR("Can't handle disordered data\n"); |
493 error = EINVAL; 494 break; 495 } 496 md_get_uint8(mdp, &wc); 497 md_get_uint8(mdp, NULL); 498 tmp = wc; 499 while (tmp--) 500 md_get_uint16(mdp, NULL); --- 252 unchanged lines hidden --- | 493 error = EINVAL; 494 break; 495 } 496 md_get_uint8(mdp, &wc); 497 md_get_uint8(mdp, NULL); 498 tmp = wc; 499 while (tmp--) 500 md_get_uint16(mdp, NULL); --- 252 unchanged lines hidden --- |