summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-01-05 12:36:35 +0000
committerkib <kib@FreeBSD.org>2008-01-05 12:36:35 +0000
commit39cc81f40e5031a21dad85eecfb14a26af12beed (patch)
tree65c4ca811e0b1e2a19576f3676a477ed76906ba0 /sys/compat
parentcf4bbeccc5e179299e77b7cfef991f450bc9144c (diff)
downloadFreeBSD-src-39cc81f40e5031a21dad85eecfb14a26af12beed.zip
FreeBSD-src-39cc81f40e5031a21dad85eecfb14a26af12beed.tar.gz
After applying LCONVPATH() to the path, do use the converted path
instead of original user-mode string in the linux_stat() and linux_lstat() syscalls. Tested by: Peter Holm MFC after: 3 days
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_stats.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 048a401..374ce39 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -270,13 +270,15 @@ linux_stat(struct thread *td, struct linux_stat_args *args)
#ifdef DEBUG
if (ldebug(stat))
- printf(ARGS(stat, "%s, *"), args->path);
+ printf(ARGS(stat, "%s, *"), path);
#endif
error = kern_stat(td, path, UIO_SYSSPACE, &buf);
- LFREEPATH(path);
- if (error)
+ if (error) {
+ LFREEPATH(path);
return (error);
- translate_path_major_minor(td, args->path, &buf);
+ }
+ translate_path_major_minor(td, path, &buf);
+ LFREEPATH(path);
return(stat_copyout(&buf, args->up));
}
@@ -291,13 +293,15 @@ linux_lstat(struct thread *td, struct linux_lstat_args *args)
#ifdef DEBUG
if (ldebug(lstat))
- printf(ARGS(lstat, "%s, *"), args->path);
+ printf(ARGS(lstat, "%s, *"), path);
#endif
- error = kern_lstat(td, args->path, UIO_SYSSPACE, &buf);
- LFREEPATH(path);
- if (error)
+ error = kern_lstat(td, path, UIO_SYSSPACE, &buf);
+ if (error) {
+ LFREEPATH(path);
return (error);
- translate_path_major_minor(td, args->path, &buf);
+ }
+ translate_path_major_minor(td, path, &buf);
+ LFREEPATH(path);
return(stat_copyout(&buf, args->up));
}
OpenPOWER on IntegriCloud