o Replace two direct uid!=0 comparisons with suser_xxx() calls.
Obtained from: TrustedBSD Project
This commit is contained in:
parent
bf46cc0b03
commit
63b7da3bb4
@ -126,7 +126,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp)
|
|||||||
#endif /* DIAGNOSTIC */
|
#endif /* DIAGNOSTIC */
|
||||||
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
|
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
|
||||||
goto nospace;
|
goto nospace;
|
||||||
if (cred->cr_uid != 0 &&
|
if (suser_xxx(cred, NULL, PRISON_ROOT) &&
|
||||||
freespace(fs, fs->fs_minfree) - numfrags(fs, size) < 0)
|
freespace(fs, fs->fs_minfree) - numfrags(fs, size) < 0)
|
||||||
goto nospace;
|
goto nospace;
|
||||||
#ifdef QUOTA
|
#ifdef QUOTA
|
||||||
@ -198,7 +198,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
|
|||||||
if (cred == NOCRED)
|
if (cred == NOCRED)
|
||||||
panic("ffs_realloccg: missing credential");
|
panic("ffs_realloccg: missing credential");
|
||||||
#endif /* DIAGNOSTIC */
|
#endif /* DIAGNOSTIC */
|
||||||
if (cred->cr_uid != 0 &&
|
if (suser_xxx(cred, NULL, PRISON_ROOT) &&
|
||||||
freespace(fs, fs->fs_minfree) - numfrags(fs, nsize - osize) < 0)
|
freespace(fs, fs->fs_minfree) - numfrags(fs, nsize - osize) < 0)
|
||||||
goto nospace;
|
goto nospace;
|
||||||
if ((bprev = ip->i_db[lbprev]) == 0) {
|
if ((bprev = ip->i_db[lbprev]) == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user