X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libsysio%2Fsrc%2Funlink.c;h=8732efa4cf08c0b22df123516ffe1bbf035ee785;hb=09fe7811cb076a00a905b747d0048294a0ef2e4d;hp=c6726510b33c68893f5f4f5f5e74f2e5b48591c6;hpb=58fa00472edb92e5cef936727774625b47e70ec3;p=fs%2Flustre-release.git diff --git a/libsysio/src/unlink.c b/libsysio/src/unlink.c index c672651..8732efa4 100644 --- a/libsysio/src/unlink.c +++ b/libsysio/src/unlink.c @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2003 Sandia Corporation. + * Cplant(TM) Copyright 1998-2006 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States @@ -68,11 +68,12 @@ SYSIO_INTERFACE_NAME(unlink)(const char *path) err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); if (err) goto out; - ino = pno->p_base->pb_ino; - if (IS_RDONLY(pno, ino)) { - err = -EROFS; + + err = _sysio_permitted(pno->p_parent, W_OK); + if (err) goto error; - } + + ino = pno->p_base->pb_ino; /* * Use the parent node operations to request the task in case the * driver is implemented using differentiated inode operations based