Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2007 13:03:55 GMT
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 118829 for review
Message-ID:  <200704261303.l3QD3tXP025157@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=118829

Change 118829 by rdivacky@rdivacky_witten on 2007/04/26 13:03:49

	This should implement the NOFOLLOW semantics.

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_stats.c#4 edit

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_stats.c#4 (text+ko) ====

@@ -585,12 +585,15 @@
 {
 	int error;
 	char *path, *newpath;
-	int fd, dfd;
+	int fd, dfd, flags = O_RDONLY;
 	struct stat buf;
 
 	if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW)
 		return (EINVAL);
 
+	if (args->flag & LINUX_AT_SYMLINK_NOFOLLOW)
+		flags |= O_NOFOLLOW;		
+
 	/* open the file */
 	path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
 	error = copyinstr(args->pathname, path, MAXPATHLEN, NULL);
@@ -612,7 +615,7 @@
 	else
 		dfd = args->dfd;
 
-	error = kern_openat(td, newpath, UIO_SYSSPACE, O_RDONLY, 0, dfd);
+	error = kern_openat(td, newpath, UIO_SYSSPACE, flags, 0, dfd);
 	if (error) {
 		LFREEPATH(newpath);
 		return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704261303.l3QD3tXP025157>