Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Feb 2003 20:29:38 -0000
From:      "Patrick Stinson" <ajole@br.logorrhea.com>
To:        "Tim Robbins" <tjr@FreeBSD.ORG>
Cc:        "freebsd-current" <freebsd-current@FreeBSD.ORG>
Subject:   RE: appending files on smbfs
Message-ID:  <DGEJJGCKEJIEOAABJNHMCENBCIAA.ajole@br.logorrhea.com>
In-Reply-To: <20030203165852.A58080@dilbert.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
hello, tim. the patch you sent me did fix the problem stated, but now I've
noticed some interesting characteristics of the files that are created by a
unix machine on a share mounted by mount_smbfs, which itself resides on a
windows 200 machine.

I haven't looked into the details, but I'm using kdevelop to create a blank
c++ project with no lsm/GNU files, on that share. the problems come up in
configure with conftest and its corresponsing files. the configure script
fails with permission problems in deleteing the file. that unix machine
thinks conftest is a file, and the windows machine thinks it's a directory.
the windows machine can delete the directory, the unix machine can't delete
the file. hmm. There are also several similar errors with conftest.cc, etc.
Also, the configure script complains about not being able to find
Makefile.in, which is actually there. This could have something to do with
the conftest thing.
Copying files works fine from both directions, and I haven't seen any other
problems but this one. it probably has something to do with the way the
files are created, don't know. The symptoms are slightly worse with windows
98 machines.

The box is still a relatively clean 5.0-release, with only the patch below
applied to the smbfs source.

hope that helps, thanks!

-P

-----Original Message-----
From: owner-freebsd-current@FreeBSD.ORG
[mailto:owner-freebsd-current@FreeBSD.ORG]On Behalf Of Tim Robbins
Sent: Monday, February 03, 2003 5:59 AM
To: Patrick Stinson
Cc: freebsd-current
Subject: Re: appending files on smbfs


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


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DGEJJGCKEJIEOAABJNHMCENBCIAA.ajole>