diff options
author | pjd <pjd@FreeBSD.org> | 2005-05-22 22:20:46 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-05-22 22:20:46 +0000 |
commit | b963a259c1507011d174a0087ad73ca502ed0f74 (patch) | |
tree | c0c4836050288dd2022870e1712c04afce86e7d5 /sys/alpha | |
parent | a6e0e217b2f0f56ca79b81d2969a21d07a1d5039 (diff) | |
download | FreeBSD-src-b963a259c1507011d174a0087ad73ca502ed0f74.zip FreeBSD-src-b963a259c1507011d174a0087ad73ca502ed0f74.tar.gz |
This code seems to be dead, but anyway:
- Don't leak fsid.
- Don't forget about prison_check_mount().
- Don't use additional variable when there is no need to.
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/osf1/osf1_mount.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/alpha/osf1/osf1_mount.c b/sys/alpha/osf1/osf1_mount.c index 19c76cf..1591c10 100644 --- a/sys/alpha/osf1/osf1_mount.c +++ b/sys/alpha/osf1/osf1_mount.c @@ -158,7 +158,7 @@ osf1_getfsstat(td, uap) long count, error, maxcount; caddr_t osf_sfsp; struct mount *mp, *nmp; - struct statfs *sp; + struct statfs *sp, sb; struct osf1_statfs osfs; if (uap->flags & ~OSF1_GETFSSTAT_FLAGS) @@ -169,9 +169,10 @@ osf1_getfsstat(td, uap) for (count = 0, mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { nmp = TAILQ_NEXT(mp, mnt_list); if (osf_sfsp && count < maxcount) { + if (!prison_check_mount(td->td_ucred, mp)) + continue; #ifdef MAC - error = mac_check_mount_stat(td->td_ucred, mp); - if (error) + if (mac_check_mount_stat(td->td_ucred, mp) != 0) continue; #endif sp = &mp->mnt_stat; @@ -185,6 +186,11 @@ osf1_getfsstat(td, uap) (error = VFS_STATFS(mp, sp, td))) continue; sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + if (suser(td)) { + bcopy(sp, &sb, sizeof(sb)); + sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; + sp = &sb; + } bsd2osf_statfs(sp, &osfs); if ((error = copyout(&osfs, osf_sfsp, sizeof (struct osf1_statfs)))) |