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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to