| To: | Nathan Straz <nstraz@xxxxxxx>, linux-xfs@xxxxxxxxxxx |
|---|---|
| Subject: | Re: PATCH: RH7.3 with XFS : /usr/bin/test -x seems broken |
| From: | David Greaves <david@xxxxxxxxxxxx> |
| Date: | Thu, 22 Aug 2002 11:28:02 +0100 |
| References: | <3D6396DE.9050008@dgreaves.com> <20020821141135.GA20157@sgi.com> <3D63A6DE.4050200@dgreaves.com> <20020821144913.GB20157@sgi.com> |
| Sender: | owner-linux-xfs@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530 |
Thanks Nathan In order to apply cleanly the diff between 1.340 and 1.342 is needed... Rebuilt and tested and this seems to fix the problem. (Of course it took a few hours to diagnose and fix a dodgy CPU fan that was SIG11'ing the build! - nothin's ever straightforward) Is it worth summarising this in an errata at ftp://oss.sgi.com/projects/xfs/download/Release-1.1/installer/installer/i386/ Cheers David
/* * Verify that the MAC policy allows the requested access. */ if ((error = _MAC_XFS_IACCESS(ip, mode, cr))) return XFS_ERROR(error); - if ((mode & IWRITE) && !WRITEALLOWED(XFS_ITOV(ip))) - return XFS_ERROR(EROFS); + if (mode & IWRITE) { + umode_t imode = inode->i_mode; + if (IS_RDONLY(inode) && + (S_ISREG(imode) || S_ISDIR(imode) || S_ISLNK(imode))) + return XFS_ERROR(EROFS); + } + /* * If there's an Access Control List it's used instead of * the mode bits. */ if ((error = _ACL_XFS_IACCESS(ip, mode, cr)) != -1) @@ -3450,12 +3456,23 @@ if (current->fsuid != ip->i_d.di_uid) { mode >>= 3; if (!in_group_p((gid_t)ip->i_d.di_gid)) mode >>= 3; } - if (((ip->i_d.di_mode & mode) == mode) || capable_cred(cr, CAP_DAC_OVERRIDE)) + + /* + * If the DACs are ok we don't need any capability check. + */ + if ((ip->i_d.di_mode & mode) == mode) return 0; + /* + * Read/write DACs are always overridable. + * Executable DACs are overridable if at least one exec bit is set. + */ + if ((orgmode & (IREAD|IWRITE)) || (inode->i_mode & S_IXUGO)) + if (capable_cred(cr, CAP_DAC_OVERRIDE)) + return 0; if ((orgmode == IREAD) ||
(((ip->i_d.di_mode & IFMT) == IFDIR) &&
(!(orgmode & ~(IWRITE|IEXEC))))) {
if (capable_cred(cr, CAP_DAC_READ_SEARCH))
On Wed, Aug 21, 2002 at 03:42:38PM +0100, David Greaves wrote: [snip] |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Updated XFS merge status, Ralf G. R. Bergs |
|---|---|
| Next by Date: | PATCH: Confure.in Libtool location problem, Ben Rockwood |
| Previous by Thread: | Re: RH7.3 with XFS : /usr/bin/test -x seems broken, David Greaves |
| Next by Thread: | TAKE - Put vn_remove stats back in, Eric Sandeen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |