Protect fsid in freebsd4_getfsstat() in simlar way as it is done in

getfsstat().
This commit is contained in:
Pawel Jakub Dawidek 2005-05-22 23:05:27 +00:00
parent 672d95c55d
commit c95cbf7ec7
2 changed files with 12 additions and 6 deletions

View File

@ -516,7 +516,7 @@ freebsd4_getfsstat(td, uap)
} */ *uap;
{
struct mount *mp, *nmp;
struct statfs *sp;
struct statfs *sp, sb;
struct ostatfs osb;
caddr_t sfsp;
long count, maxcount, error;
@ -556,9 +556,12 @@ freebsd4_getfsstat(td, uap)
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;
}
cvtstatfs(td, sp, &osb);
if (suser(td))
osb.f_fsid.val[0] = osb.f_fsid.val[1] = 0;
error = copyout(&osb, sfsp, sizeof(osb));
if (error) {
vfs_unbusy(mp, td);

View File

@ -516,7 +516,7 @@ freebsd4_getfsstat(td, uap)
} */ *uap;
{
struct mount *mp, *nmp;
struct statfs *sp;
struct statfs *sp, sb;
struct ostatfs osb;
caddr_t sfsp;
long count, maxcount, error;
@ -556,9 +556,12 @@ freebsd4_getfsstat(td, uap)
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;
}
cvtstatfs(td, sp, &osb);
if (suser(td))
osb.f_fsid.val[0] = osb.f_fsid.val[1] = 0;
error = copyout(&osb, sfsp, sizeof(osb));
if (error) {
vfs_unbusy(mp, td);