Subject: bin/17245: xlatecookie support for amd.
To: None <gnats-bugs@gnats.netbsd.org>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: netbsd-bugs
Date: 06/13/2002 16:33:44
>Number:         17245
>Category:       bin
>Synopsis:       xlatecookie support for amd.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 12 21:53:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mark Davies
>Release:        NetBSD 1.5ZC
>Organization:
Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand.
>Environment:
	
	
System: NetBSD city-art.mcs.vuw.ac.nz 1.5ZC NetBSD 1.5ZC (MCS_WORKSTATION) #3: Tue May 28 16:40:27 NZST 2002 mark@turakirae.mcs.vuw.ac.nz:/src/work/src/sys/arch/i386/compile/MCS_WORKSTATION i386
Architecture: i386
Machine: i386
>Description:
	NFS filesystems need to be mounted with "-X" for linux applications
	that use the linux_sys_getdents64 to work properly.  See thread with
	subject "Linux emulation under -current" in current-users list.

	amd currently has no way of doing the equivalent of "-X" (setting the
	NFSMNT_XLATECOOKIE flag).  The below patch provides an option to 
	set this.
	
>How-To-Repeat:
	Use amd to nfs mount a users home directory.
	Use netscape messenger (with suse*7.3 packages) to read email
	Note that it fails to find INBOX.
	
>Fix:
	

Index: usr.sbin/amd/include/config.h
===================================================================
RCS file: /src/cvs/netbsd/basesrc/usr.sbin/amd/include/config.h,v
retrieving revision 1.20
diff -u -r1.20 config.h
--- usr.sbin/amd/include/config.h	2002/03/22 18:10:25	1.20
+++ usr.sbin/amd/include/config.h	2002/06/04 02:29:44
@@ -437,6 +437,9 @@
 /* Mount Table option string: support property lists (ACLs) */
 /* #undef MNTTAB_OPT_PROPLIST */
 
+/* 32<->64 dir cookie translation */
+#define MNTTAB_OPT_XLATECOOKIE "xlatecookie"
+
 /*
  * Generic mount(2) options (hex numbers)
  */
Index: dist/am-utils/libamu/mount_fs.c
===================================================================
RCS file: /src/cvs/netbsd/basesrc/dist/am-utils/libamu/mount_fs.c,v
retrieving revision 1.3
diff -u -r1.3 mount_fs.c
--- dist/am-utils/libamu/mount_fs.c	2001/05/13 18:07:00	1.3
+++ dist/am-utils/libamu/mount_fs.c	2002/06/04 02:22:31
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_fs.c,v 1.3 2001/05/13 18:07:00 veego Exp $	*/
+/*	$NetBSD: mount_fs.c,v 1.1.1.4 2001/05/13 17:50:32 veego Exp $	*/
 
 /*
  * Copyright (c) 1997-2001 Erez Zadok
@@ -115,6 +115,10 @@
   {MNTTAB_OPT_NOLOCK, MNT2_NFS_OPT_NONLM},
 #endif /* defined(MNT2_NFS_OPT_NONLM) && defined(MNTTAB_OPT_NOLOCK) */
 
+#if defined(MNT2_NFS_OPT_XLATECOOKIE) && defined(MNTTAB_OPT_XLATECOOKIE)
+  {MNTTAB_OPT_XLATECOOKIE, MNT2_NFS_OPT_XLATECOOKIE},
+#endif /* defined(MNT2_NFS_OPT_XLATECOOKIE) && defined(MNTTAB_OPT_XLATECOOKIE) */
+
   {0, 0}
 };
 
@@ -715,6 +719,11 @@
   if (nap->maxgrouplist != NULL)
     nap->flags |= MNT2_NFS_OPT_MAXGRPS;
 #endif /* defined(MNT2_NFS_OPT_MAXGRPS) && defined(MNTTAB_OPT_MAXGROUPS) */
+
+#if defined(MNT2_NFS_OPT_XLATECOOKIE) && defined(MNTTAB_OPT_XLATECOOKIE)
+  if (hasmntopt(mntp, MNTTAB_OPT_XLATECOOKIE) != NULL)
+    nap->flags |= MNT2_NFS_OPT_XLATECOOKIE;
+#endif /* defined(MNT2_NFS_OPT_XLATECOOKIE) && defined(MNTTAB_OPT_XLATECOOKIE) */
 
 #ifdef HAVE_FIELD_NFS_ARGS_T_OPTSTR
   nap->optstr = mntp->mnt_opts;
>Release-Note:
>Audit-Trail:
>Unformatted: