summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/unlink.c
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2003-11-25 17:26:45 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2003-11-25 17:26:45 +0000
commitde691e68f72c525b1204e8e1a6ea24261ea6d124 (patch)
treedbe503fb3816bfd59d30ccb531435beeb3ff3101 /cpukit/libcsupport/src/unlink.c
parent2003-11-25 Joel Sherrill <joel@OARcorp.com> (diff)
downloadrtems-de691e68f72c525b1204e8e1a6ea24261ea6d124.tar.bz2
2003-11-25 Jennifer Averett <jennifer@OARcorp.com>
PR 519/filesystem * include/rtems/libio_.h, src/eval.c, src/rmdir.c, src/unlink.c: Check write permissions in parent directory for file or directory delete
Diffstat (limited to 'cpukit/libcsupport/src/unlink.c')
-rw-r--r--cpukit/libcsupport/src/unlink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/unlink.c b/cpukit/libcsupport/src/unlink.c
index ce9ce74295..95f2b064a1 100644
--- a/cpukit/libcsupport/src/unlink.c
+++ b/cpukit/libcsupport/src/unlink.c
@@ -35,6 +35,12 @@ int unlink(
if ( result != 0 )
return -1;
+ result = rtems_filesystem_evaluate_parent(RTEMS_LIBIO_PERMS_WRITE, &loc );
+ if (result != 0){
+ rtems_filesystem_freenode( &loc );
+ return -1;
+ }
+
if ( !loc.ops->node_type_h ) {
rtems_filesystem_freenode( &loc );
rtems_set_errno_and_return_minus_one( ENOTSUP );