summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/eval.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/eval.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/eval.c')
-rw-r--r--cpukit/libcsupport/src/eval.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/eval.c b/cpukit/libcsupport/src/eval.c
index 1e970d47ca..4d57219e39 100644
--- a/cpukit/libcsupport/src/eval.c
+++ b/cpukit/libcsupport/src/eval.c
@@ -97,3 +97,28 @@ int rtems_filesystem_evaluate_path(
return result;
}
+
+int rtems_filesystem_evaluate_parent(
+ int flags,
+ rtems_filesystem_location_info_t *pathloc
+)
+{
+ rtems_filesystem_location_info_t parent;
+ int result;
+
+ if ( !pathloc )
+ rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
+
+ if ( !pathloc->ops->evalpath_h )
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
+
+ parent = *pathloc;
+ result = (*pathloc->ops->evalpath_h)( "..", flags, &parent );
+ if (result != 0){
+ return -1;
+ }
+ rtems_filesystem_freenode( &parent );
+
+ return result;
+}
+