Subject: bin/4144: amd pcfs umask bug
To: None <gnats-bugs@gnats.netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: netbsd-bugs
Date: 09/23/1997 12:03:02
>Number:         4144
>Category:       bin
>Synopsis:       amd mounts pcfs with umask of '0'
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 12:05:01 1997
>Last-Modified:
>Originator:     Wolfgang Rupprecht
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Release:        netbsd-current 9/22/97
>Environment:

System: NetBSD capsicum.wsrcc.com 1.2G NetBSD 1.2G (WSRCC) #0: Mon Sep 22 18:34:03 PDT 1997 root@capsicum.wsrcc.com:/v/netbsd-current/sys/arch/i386/compile/WSRCC i386


>Description:
	amd mounts pcfs with a umask of '0'.  This makes all files unreadable.

>How-To-Repeat:

	add this to an amd map file for /local.  restart amd.
	
	----
	/defaults	fs:=${autodir}/${key};opts:=nosuid,nodev;

	pcfs		dev:=/dev/fd0a;type:=pcfs;
	----

	cd /local
	<fails>

	Note that the top-level directory (all files below) have the
	following permissions:

	ll /amd/
	total 7
	 7 d---------  1 root  wheel  7168 Dec 31  1979 pcfs/

>Fix:

	This isn't the recomended fix.  It lacks all the nice autoconfig 
	goop, but it does illustrate the underlying problem and the fix.

	(Note this problem still exists in am-utils-6.0a11 .)

cd /usr/src/usr.sbin/amd/amd/
diff -c /usr/src/usr.sbin/amd/amd/ops_pcfs.c.\~1\~ /usr/src/usr.sbin/amd/amd/ops_pcfs.c
*** /usr/src/usr.sbin/amd/amd/ops_pcfs.c.~1~	Tue Sep 23 04:39:04 1997
--- /usr/src/usr.sbin/amd/amd/ops_pcfs.c	Tue Sep 23 11:46:05 1997
***************
*** 136,141 ****
--- 136,156 ----
    pcfs_args.dsttime = 0;	/* XXX: fill in correct values */
  #endif /* HAVE_FIELD_PCFS_ARGS_T_DSTTIME */
  
+ #ifdef __NetBSD__
+ /*
+ 	char	*fspec;		 blocks special holding the fs to mount 
+ 	struct	export_args export;	 network export information 
+ 	uid_t	uid;		 uid that owns msdosfs files 
+ 	gid_t	gid;		 gid that owns msdosfs files 
+ 	mode_t  mask;		 mask to be applied for msdosfs perms 
+ 	int	flags;		 see below 
+ */
+ 
+   pcfs_args.uid = 0;		/* root */
+   pcfs_args.gid = 0;		/* wheel */
+   pcfs_args.mask = 0777;	/* no mashing of permission bits */
+ #endif  
+ 
    /*
     * Call generic mount routine
     */

Diff finished at Tue Sep 23 11:46:52

>Audit-Trail:
>Unformatted: