PERFORCE change 118829 for review
Roman Divacky
rdivacky at FreeBSD.org
Thu Apr 26 13:03:56 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=118829
Change 118829 by rdivacky at 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);
More information about the p4-projects
mailing list