mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
UFS: disallow truncation to set file size past RLIMIT_FSIZE
This is mandated by POSIX. PR: 164793 Reviewed by: asomers, jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36625
This commit is contained in:
parent
2ac083f60f
commit
70385088ca
|
@ -755,6 +755,9 @@ ufs_setattr(
|
|||
*/
|
||||
return (0);
|
||||
}
|
||||
error = vn_rlimit_trunc(vap->va_size, td);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if ((error = UFS_TRUNCATE(vp, vap->va_size, IO_NORMAL |
|
||||
((vap->va_vaflags & VA_SYNC) != 0 ? IO_SYNC : 0),
|
||||
cred)) != 0)
|
||||
|
|
Loading…
Reference in a new issue