o Replace two direct uid!=0 comparisons with suser_xxx() calls.

Obtained from:	TrustedBSD Project
This commit is contained in:
rwatson 2001-10-02 14:41:43 +00:00
parent bf46cc0b03
commit 63b7da3bb4

View File

@ -126,7 +126,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp)
#endif /* DIAGNOSTIC */
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
if (cred->cr_uid != 0 &&
if (suser_xxx(cred, NULL, PRISON_ROOT) &&
freespace(fs, fs->fs_minfree) - numfrags(fs, size) < 0)
goto nospace;
#ifdef QUOTA
@ -198,7 +198,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if (cred == NOCRED)
panic("ffs_realloccg: missing credential");
#endif /* DIAGNOSTIC */
if (cred->cr_uid != 0 &&
if (suser_xxx(cred, NULL, PRISON_ROOT) &&
freespace(fs, fs->fs_minfree) - numfrags(fs, nsize - osize) < 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {