Linux NFS development
 help / color / mirror / Atom feed
* NFS3PROC_ACCESS bug in 2.6.x
@ 2005-02-06 18:39 Frank van Maarseveen
  2005-02-15 20:23 ` Frank van Maarseveen
  0 siblings, 1 reply; 2+ messages in thread
From: Frank van Maarseveen @ 2005-02-06 18:39 UTC (permalink / raw)
  To: Linux NFS mailing list


Both server and client are the same machine and run unpatched
2.6.11-rc3. /proc/mounts says:

localhost:/loc/nfstest /mnt2 nfs rw,sync,v3,rsize=32768,wsize=32768,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,hard,udp,noac,nolock,addr=localhost 0 0

Problem is that we should have permission to create according to the
secondary group list but apparently we don't:

$ cd /mnt2/subdir
$ ls -ld .
drwxrwx---    2 root     owner        4096 Feb  6 18:39 .
$ id
uid=363(fvm) gid=215(sec) groups=215(sec),3972(owner),..
						^^^
$ strace -e mkdir /bin/mkdir aap
mkdir("aap", 0777)                      = -1 EACCES (Permission denied)
/bin/mkdir: cannot create directory `aap': Permission denied
$ ls -al
total 8
drwxrwx---    2 root     owner        4096 Feb  6 18:39 .
drwxr-xr-x    7 root     root         4096 Feb  6 18:39 ..
$ >pipo
bash: pipo: No such file or directory
$ strace touch pipo

	...
	open("pipo", O_WRONLY|O_NONBLOCK|O_CREAT|O_NOCTTY|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)

	(I give up, lets go back to the server side)

$ cd /loc/nfstest/subdir
$ ls -al
total 8
drwxrwx---    2 root     owner        4096 Feb  6 18:39 .
drwxr-xr-x    7 root     root         4096 Feb  6 18:39 ..
$ strace -e mkdir /bin/mkdir aap
mkdir("aap", 0777)                      = 0


Problem was originally found on 2.6.10 and looks like a server problem
because of the following and because 2.4.28 as server worked.  I have
tracked it down in 2.6.10 to the following client side call tree:

sys_mkdir() ->
vfs_mkdir() ->
may_create() ->
permission(MAY_WRITE | MAY_EXEC) ->
nfs_permission(MAY_WRITE | MAY_EXEC) ->
nfs_do_access(MAY_WRITE | MAY_EXEC):
	nfs_access_get_cached(): -ENOENT
	nfs3_proc_access(MAY_EXEC | MAY_WRITE | MAY_READ):
		arg.access = 0x1f (everything except NFS3_ACCESS_EXECUTE)
		RPC returns 0
		res.access = 0x3  (NFS3_ACCESS_READ|NFS3_ACCESS_LOOKUP)
		modify the cached mask: set it to 0x5 (MAY_EXEC | MAY_READ)
	if ((0x1f & 0x5) == 0x3)
		return 0;
	-EACCES

I think the server forgot to mention NFS3_ACCESS_MODIFY or
NFS3_ACCESS_EXTEND for the directory (I'm too lazy to look it up in
the RFCs right now).

-- 
Frank


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: NFS3PROC_ACCESS bug in 2.6.x
  2005-02-06 18:39 NFS3PROC_ACCESS bug in 2.6.x Frank van Maarseveen
@ 2005-02-15 20:23 ` Frank van Maarseveen
  0 siblings, 0 replies; 2+ messages in thread
From: Frank van Maarseveen @ 2005-02-15 20:23 UTC (permalink / raw)
  To: Linux NFS mailing list

On Sun, Feb 06, 2005 at 07:39:13PM +0100, Frank van Maarseveen wrote:
> 
> [blurb]

must have been a "ro" export (automatically appearently, unless "rw"
specified). user error (*blush*).

-- 
Frank


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-15 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-06 18:39 NFS3PROC_ACCESS bug in 2.6.x Frank van Maarseveen
2005-02-15 20:23 ` Frank van Maarseveen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox