kern/122047: [ext2fs] [patch] incorrect handling of
UF_IMMUTABLE / UF_APPEND flag on EXT2FS (maybe others)
Aditya Sarawgi
sarawgi.aditya at gmail.com
Fri May 29 16:00:15 UTC 2009
The following reply was made to PR kern/122047; it has been noted by GNATS.
From: Aditya Sarawgi <sarawgi.aditya at gmail.com>
To: bug-followup at freebsd.org
Cc: ighighi at freebsd.org, brde at optusnet.com.au, mckusick at chez.mckusick.com
Subject: Re: kern/122047: [ext2fs] [patch] incorrect handling of
UF_IMMUTABLE / UF_APPEND flag on EXT2FS (maybe others)
Date: Fri, 29 May 2009 15:57:13 +0530
--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
I have created a patch for this. Its a simple patch that maps EXT2_* flags to only SF_* flags and disallows setting of UF_* flags with an EOPNOTSUPP
error.
--
Aditya Sarawgi
--2oS5YaxWCcQjTEyO
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="uf.patch"
86,87c86,87
< ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? APPEND : 0;
< ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? IMMUTABLE : 0;
---
> ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? SF_APPEND : 0;
> ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? SF_IMMUTABLE : 0;
124,125c124,125
< ei->i_flags |= (ip->i_flags & APPEND) ? EXT2_APPEND_FL: 0;
< ei->i_flags |= (ip->i_flags & IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0;
---
> ei->i_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND_FL: 0;
> ei->i_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0;
250c250
< if ((VTOI(ap->a_vp)->i_flags & APPEND) &&
---
> if ((VTOI(ap->a_vp)->i_flags & SF_APPEND) &&
318c318
< if ((accmode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT)))
---
> if ((accmode & VWRITE) && (ip->i_flags & (SF_IMMUTABLE | SF_SNAPSHOT)))
394a395,399
> /*
> * Deny setting of UF_* flags
> */
> if(vap->va_flags & UF_SETTABLE)
> return (EOPNOTSUPP);
425c430
< if (vap->va_flags & (IMMUTABLE | APPEND))
---
> if (vap->va_flags & (SF_IMMUTABLE | SF_APPEND))
428c433
< if (ip->i_flags & (IMMUTABLE | APPEND))
---
> if (ip->i_flags & (SF_IMMUTABLE | SF_APPEND))
678,679c683,684
< if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) ||
< (VTOI(dvp)->i_flags & APPEND)) {
---
> if ((ip->i_flags & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) ||
> (VTOI(dvp)->i_flags & SF_APPEND)) {
722c727
< if (ip->i_flags & (IMMUTABLE | APPEND)) {
---
> if (ip->i_flags & (SF_IMMUTABLE | SF_APPEND)) {
789,790c794,795
< if (tvp && ((VTOI(tvp)->i_flags & (NOUNLINK | IMMUTABLE | APPEND)) ||
< (VTOI(tdvp)->i_flags & APPEND))) {
---
> if (tvp && ((VTOI(tvp)->i_flags & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) ||
> (VTOI(tdvp)->i_flags & SF_APPEND))) {
814,815c819,820
< if ((ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND))
< || (dp->i_flags & APPEND)) {
---
> if ((ip->i_flags & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND))
> || (dp->i_flags & SF_APPEND)) {
1274,1275c1279,1280
< if ((dp->i_flags & APPEND)
< || (ip->i_flags & (NOUNLINK | IMMUTABLE | APPEND))) {
---
> if ((dp->i_flags & SF_APPEND)
> || (ip->i_flags & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND))) {
--2oS5YaxWCcQjTEyO--
More information about the freebsd-fs
mailing list