aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2003-11-05 23:52:54 +0000
committerEric Anholt <anholt@FreeBSD.org>2003-11-05 23:52:54 +0000
commit0b399cc8a666d5a5fa3f2720f7d163b5508d0d04 (patch)
tree1f95fe8b9273c36a25c88eea1b0b7fee57dfa63f /sys/compat/linux
parentd3be1471c71fdfb310846f91308f29f40eb8ce2f (diff)
Notes
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_stats.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 8d90b1ffb139..ec6e0677047e 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -268,8 +268,13 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args)
linux_statfs.f_bavail = bsd_statfs->f_bavail;
linux_statfs.f_ffree = bsd_statfs->f_ffree;
linux_statfs.f_files = bsd_statfs->f_files;
- linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0];
- linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1];
+ if (suser(td)) {
+ linux_statfs.f_fsid.val[0] = 0;
+ linux_statfs.f_fsid.val[1] = 0;
+ } else {
+ linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0];
+ linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1];
+ }
linux_statfs.f_namelen = MAXNAMLEN;
return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
}
@@ -312,8 +317,13 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args)
linux_statfs.f_bavail = bsd_statfs->f_bavail;
linux_statfs.f_ffree = bsd_statfs->f_ffree;
linux_statfs.f_files = bsd_statfs->f_files;
- linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0];
- linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1];
+ if (suser(td)) {
+ linux_statfs.f_fsid.val[0] = 0;
+ linux_statfs.f_fsid.val[1] = 0;
+ } else {
+ linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0];
+ linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1];
+ }
linux_statfs.f_namelen = MAXNAMLEN;
error = copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
fdrop(fp, td);