summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/015-setattr.patch
blob: 3b86d43bc2e6e203ab0d1f13e2bb322b36b85179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Upstream-Status: Inappropriate [other]
Upstream is not making further releases of this software.

Signed-off-by: Scott Garman <scott.a.garman@intel.com>

# Patch origin: nfs-server source RPM from openSUSE 10.3

--- nfs-server/setattr.c.orig	2006-07-28 16:38:26.000000000 +0200
+++ nfs-server/setattr.c	2006-07-28 16:42:28.000000000 +0200
@@ -97,7 +97,20 @@
 				tvp[1].tv_sec  = s->st_mtime;
 				tvp[1].tv_usec = 0;
 			}
-			if (efs_utimes(path, tvp) < 0)
+			if (m_secs != IGNORE_TIME && attr->mtime.useconds == 1000000) {
+		/*      
+		 * from kernel/fs/nfsd/nfsxdr.c:
+                 * Passing the invalid value useconds=1000000 for mtime
+                 * is a Sun convention for "set both mtime and atime 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
+                 */
+				if (utime(path, (struct utimbuf *)0) < 0)
+					goto failure;
+			} else if (efs_utimes(path, tvp) < 0)
 				goto failure;
 		}
 	}