smb_conn.c (100831) | smb_conn.c (109623) |
---|---|
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_conn.c 100831 2002-07-28 19:59:31Z truckman $ | 32 * $FreeBSD: head/sys/netsmb/smb_conn.c 109623 2003-01-21 08:56:16Z alfred $ |
33 */ 34 35/* 36 * Connection engine. 37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> --- 347 unchanged lines hidden (view full) --- 388 /* 389 * Only superuser can create VCs with different uid and gid 390 */ 391 if (uid != SMBM_ANY_OWNER && uid != realuid && !isroot) 392 return EPERM; 393 if (gid != SMBM_ANY_GROUP && !groupmember(gid, cred) && !isroot) 394 return EPERM; 395 | 33 */ 34 35/* 36 * Connection engine. 37 */ 38 39#include <sys/param.h> 40#include <sys/systm.h> --- 347 unchanged lines hidden (view full) --- 388 /* 389 * Only superuser can create VCs with different uid and gid 390 */ 391 if (uid != SMBM_ANY_OWNER && uid != realuid && !isroot) 392 return EPERM; 393 if (gid != SMBM_ANY_GROUP && !groupmember(gid, cred) && !isroot) 394 return EPERM; 395 |
396 vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, M_WAITOK); | 396 vcp = smb_zmalloc(sizeof(*vcp), M_SMBCONN, 0); |
397 smb_co_init(VCTOCP(vcp), SMBL_VC, "smb_vc", td); 398 vcp->obj.co_free = smb_vc_free; 399 vcp->obj.co_gone = smb_vc_gone; 400 vcp->vc_number = smb_vcnext++; 401 vcp->vc_timo = SMB_DEFRQTIMO; 402 vcp->vc_smbuid = SMB_UID_UNKNOWN; 403 vcp->vc_mode = vcspec->rights & SMBM_MASK; 404 vcp->obj.co_flags = vcspec->flags & (SMBV_PRIVATE | SMBV_SINGLESHARE); --- 280 unchanged lines hidden (view full) --- 685 if (!error) { 686 smb_share_put(ssp, scred); 687 return EEXIST; 688 } 689 if (uid == SMBM_ANY_OWNER) 690 uid = realuid; 691 if (gid == SMBM_ANY_GROUP) 692 gid = cred->cr_groups[0]; | 397 smb_co_init(VCTOCP(vcp), SMBL_VC, "smb_vc", td); 398 vcp->obj.co_free = smb_vc_free; 399 vcp->obj.co_gone = smb_vc_gone; 400 vcp->vc_number = smb_vcnext++; 401 vcp->vc_timo = SMB_DEFRQTIMO; 402 vcp->vc_smbuid = SMB_UID_UNKNOWN; 403 vcp->vc_mode = vcspec->rights & SMBM_MASK; 404 vcp->obj.co_flags = vcspec->flags & (SMBV_PRIVATE | SMBV_SINGLESHARE); --- 280 unchanged lines hidden (view full) --- 685 if (!error) { 686 smb_share_put(ssp, scred); 687 return EEXIST; 688 } 689 if (uid == SMBM_ANY_OWNER) 690 uid = realuid; 691 if (gid == SMBM_ANY_GROUP) 692 gid = cred->cr_groups[0]; |
693 ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, M_WAITOK); | 693 ssp = smb_zmalloc(sizeof(*ssp), M_SMBCONN, 0); |
694 smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss", td); 695 ssp->obj.co_free = smb_share_free; 696 ssp->obj.co_gone = smb_share_gone; 697 smb_sl_init(&ssp->ss_stlock, "ssstlock"); 698 ssp->ss_name = smb_strdup(shspec->name); 699 if (shspec->pass && shspec->pass[0]) 700 ssp->ss_pass = smb_strdup(shspec->pass); 701 ssp->ss_type = shspec->stype; --- 172 unchanged lines hidden --- | 694 smb_co_init(SSTOCP(ssp), SMBL_SHARE, "smbss", td); 695 ssp->obj.co_free = smb_share_free; 696 ssp->obj.co_gone = smb_share_gone; 697 smb_sl_init(&ssp->ss_stlock, "ssstlock"); 698 ssp->ss_name = smb_strdup(shspec->name); 699 if (shspec->pass && shspec->pass[0]) 700 ssp->ss_pass = smb_strdup(shspec->pass); 701 ssp->ss_type = shspec->stype; --- 172 unchanged lines hidden --- |