Package: nfs-user-server
Version: 2.2beta47-25
Severity important

The NFS client within the Linux kernel passes the invalid value
"1million" in the usec field to request "server time", which should
map the a NULL argument to utimes(2).  Without this patch most
nfs-accesses failed, and I got mad a few days before looking at the
source.

The client code (fs/nfs/nfs2xdr.c) has this
comment:

        /*
         * Passing the invalid value useconds=1000000 is a
         * Sun convention for "set to current server time".
         * It's needed to make permissions checks for the
         * "touch" program across v2 mounts to Solaris and
         * Irix boxes work correctly. See description of
         * sattr in section 6.1 of "NFS Illustrated" by
         * Brent Callaghan, Addison-Wesley, ISBN 0-201-32750-5
         */

The kernel nfs server handles the 1million value as a special case, so
let's do it here in the same way.

/alessandro

--- ./setattr.c.orig    2009-04-30 13:03:50.000000000 +0200
+++ ./setattr.c 2009-04-30 13:03:53.000000000 +0200
@@ -95,7 +95,15 @@
                                tvp[1].tv_sec  = s->st_mtime;
                                tvp[1].tv_usec = 0;
                        }
-                       if (efs_utimes(path, tvp) < 0 
+                       /*
+                        * Kernel (fs/nfs/nfs2xdr.c) says:
+                        * ``Passing the invalid value useconds=1000000 is a
+                        * Sun convention for "set to current server time".''
+                        * So in this case pass a NULL pointer --ARub
+                        */
+                       if (tvp[1].tv_usec == 1000000) tvp[1].tv_usec = 0;
+                       if (efs_utimes(path, tvp[0].tv_usec == 1000000
+                                      ? NULL : tvp) < 0
                                && (errno != ENOENT || lstat(path, &sbuf)))
                                goto failure;
                }




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to