summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/ChangeLog5
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c19
2 files changed, 21 insertions, 3 deletions
diff --git a/cpukit/libfs/ChangeLog b/cpukit/libfs/ChangeLog
index f8ede36d3b..34204f701d 100644
--- a/cpukit/libfs/ChangeLog
+++ b/cpukit/libfs/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-09 Fernando-Ruiz Casas <correo@fernando-ruiz.com>
+
+ * src/imfs/imfs_eval.c: The CD_UP problem in imfs_eval has been
+ touched. The order of the questions is the key.
+
2001-07-06 Thomas Doerfler <Thomas.Doerfler@imd-systems.de>
* src/imfs/deviceio.c: Make sure errno gets set to reflect
diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c
index 9185ae8feb..e7479869b0 100644
--- a/cpukit/libfs/src/imfs/imfs_eval.c
+++ b/cpukit/libfs/src/imfs/imfs_eval.c
@@ -31,7 +31,7 @@
#define MAXSYMLINK 5
-int IMFS_Set_handlers(
+int IMFS_Set_handlers(
rtems_filesystem_location_info_t *loc
)
{
@@ -292,7 +292,7 @@ int IMFS_evaluate_for_make(
int result;
/*
- * This was filled in by the caller and is valid in the
+ * This was filled in by the caller and is valid in the
* mount table.
*/
node = pathloc->node_access;
@@ -323,6 +323,13 @@ int IMFS_evaluate_for_make(
switch( type ) {
case IMFS_UP_DIR:
+ /*
+ * Am I at the root of all filesystems? (chroot'ed?)
+ */
+
+ if ( pathloc->node_access == rtems_filesystem_root.node_access )
+ break; /* Throw out the .. in this case */
+
/*
* Am I at the root of this mounted filesystem?
@@ -516,6 +523,12 @@ int IMFS_eval_path(
switch( type ) {
case IMFS_UP_DIR:
+ /*
+ * Am I at the root of all filesystems? (chroot'ed?)
+ */
+
+ if ( pathloc->node_access == rtems_filesystem_root.node_access )
+ break; /* Throw out the .. in this case */
/*
* Am I at the root of this mounted filesystem?
@@ -559,7 +572,7 @@ int IMFS_eval_path(
node = pathloc->node_access;
if ( !node )
- set_errno_and_return_minus_one( ENOTDIR );
+ set_errno_and_return_minus_one( ENOTDIR );
} else if ( node->type == IMFS_SYM_LINK ) {