From owner-freebsd-current Sun Feb 2 21:59: 9 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF39537B401 for ; Sun, 2 Feb 2003 21:59:07 -0800 (PST) Received: from smtp04.iprimus.com.au (smtp04.iprimus.com.au [210.50.76.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97F4643F43 for ; Sun, 2 Feb 2003 21:59:06 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from smtp02.iprimus.net.au (210.50.76.70) by smtp04.iprimus.com.au (6.7.010) id 3E3608DE00119CAD for freebsd-current@FreeBSD.org; Mon, 3 Feb 2003 16:59:00 +1100 Received: from dilbert.robbins.dropbear.id.au ([210.50.112.47]) by smtp02.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.5600); Mon, 3 Feb 2003 16:58:58 +1100 Received: from dilbert.robbins.dropbear.id.au (q8sfdw1rkewc3y92@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h135wtVY058147; Mon, 3 Feb 2003 16:58:56 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h135wrb2058146; Mon, 3 Feb 2003 16:58:53 +1100 (EST) (envelope-from tim) Date: Mon, 3 Feb 2003 16:58:52 +1100 From: Tim Robbins To: Patrick Stinson Cc: freebsd-current Subject: Re: appending files on smbfs Message-ID: <20030203165852.A58080@dilbert.robbins.dropbear.id.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from ajole-1@gci.net on Thu, Jan 30, 2003 at 07:37:04PM -0000 X-OriginalArrivalTime: 03 Feb 2003 05:58:59.0398 (UTC) FILETIME=[58484E60:01C2CB49] Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jan 30, 2003 at 07:37:04PM -0000, Patrick Stinson wrote: > has anyone every had problems with appending existing files on volumes > mounted by smbfs or shlight? > > $ echo "sdsad" >> hey > $ echo "sdsad" >> hey > cannot create hey: Permission denied Please try this patch and let me know whether it solves the problem. Index: src/sys/fs/smbfs/smbfs_vnops.c =================================================================== RCS file: /x/freebsd/src/sys/fs/smbfs/smbfs_vnops.c,v retrieving revision 1.28 diff -u -r1.28 smbfs_vnops.c --- src/sys/fs/smbfs/smbfs_vnops.c 29 Jan 2003 13:41:52 -0000 1.28 +++ src/sys/fs/smbfs/smbfs_vnops.c 3 Feb 2003 05:51:45 -0000 @@ -139,10 +139,9 @@ } */ *ap; { struct vnode *vp = ap->a_vp; - struct ucred *cred = ap->a_cred; - u_int mode = ap->a_mode; + mode_t mode = ap->a_mode; + mode_t smbmode; struct smbmount *smp = VTOSMBFS(vp); - int error = 0; SMBVDEBUG("\n"); if ((mode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) { @@ -153,15 +152,10 @@ break; } } - if (cred->cr_uid == 0) - return 0; - if (cred->cr_uid != smp->sm_args.uid) { - mode >>= 3; - if (!groupmember(smp->sm_args.gid, cred)) - mode >>= 3; - } - error = (((vp->v_type == VREG) ? smp->sm_args.file_mode : smp->sm_args.dir_mode) & mode) == mode ? 0 : EACCES; - return error; + smbmode = vp->v_type == VREG ? smp->sm_args.file_mode : + smp->sm_args.dir_mode; + return (vaccess(vp->v_type, smbmode, smp->sm_args.uid, + smp->sm_args.gid, ap->a_mode, ap->a_cred, NULL)); } /* ARGSUSED */ Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message