Protect fsid in freebsd4_getfsstat() in simlar way as it is done in
getfsstat().
This commit is contained in:
parent
672d95c55d
commit
c95cbf7ec7
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user