summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-08-09 22:09:36 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-08-09 22:09:36 +0000
commitb6a2d2fa5d0fedd509584e3faa4c88e1982900b7 (patch)
treefb2717e05c3b2f7c9090cc205f043f37f1908671
parent70d689aed44d7568310dec851d0a773a850ba66a (diff)
downloadrtems-b6a2d2fa5d0fedd509584e3faa4c88e1982900b7.tar.bz2
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.
-rw-r--r--c/src/exec/libfs/ChangeLog5
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_eval.c19
-rw-r--r--c/src/libfs/ChangeLog5
-rw-r--r--c/src/libfs/src/imfs/imfs_eval.c19
-rw-r--r--cpukit/libfs/ChangeLog5
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c19
6 files changed, 63 insertions, 9 deletions
diff --git a/c/src/exec/libfs/ChangeLog b/c/src/exec/libfs/ChangeLog
index f8ede36d3b..34204f701d 100644
--- a/c/src/exec/libfs/ChangeLog
+++ b/c/src/exec/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/c/src/exec/libfs/src/imfs/imfs_eval.c b/c/src/exec/libfs/src/imfs/imfs_eval.c
index 9185ae8feb..e7479869b0 100644
--- a/c/src/exec/libfs/src/imfs/imfs_eval.c
+++ b/c/src/exec/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 ) {
diff --git a/c/src/libfs/ChangeLog b/c/src/libfs/ChangeLog
index f8ede36d3b..34204f701d 100644
--- a/c/src/libfs/ChangeLog
+++ b/c/src/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/c/src/libfs/src/imfs/imfs_eval.c b/c/src/libfs/src/imfs/imfs_eval.c
index 9185ae8feb..e7479869b0 100644
--- a/c/src/libfs/src/imfs/imfs_eval.c
+++ b/c/src/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 ) {
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 ) {