From b6a2d2fa5d0fedd509584e3faa4c88e1982900b7 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 9 Aug 2001 22:09:36 +0000 Subject: 2001-08-09 Fernando-Ruiz Casas * src/imfs/imfs_eval.c: The CD_UP problem in imfs_eval has been touched. The order of the questions is the key. --- cpukit/libfs/ChangeLog | 5 +++++ cpukit/libfs/src/imfs/imfs_eval.c | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'cpukit') 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 + + * 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 * 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 ) { -- cgit v1.2.3