<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-04-16)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>ccj</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-04-16      Chris Johns <chrisj@rtems.org>

        PR 1774/filesystem
        * libfs/src/imfs/imfs_eval.c: Fix the IMFS eval and eval for make
        handlers to not inspect a mounted file sytems path.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2800&r2=text&tr2=1.2801&diff_format=h">M</a></td><td width='1%'>1.2801</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/imfs/imfs_eval.c.diff?r1=text&tr1=1.31&r2=text&tr2=1.32&diff_format=h">M</a></td><td width='1%'>1.32</td><td width='100%'>cpukit/libfs/src/imfs/imfs_eval.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2800 rtems/cpukit/ChangeLog:1.2801
--- rtems/cpukit/ChangeLog:1.2800       Fri Apr 15 06:13:20 2011
+++ rtems/cpukit/ChangeLog      Fri Apr 15 23:40:11 2011
</font><font color='#997700'>@@ -1,5 +1,10 @@
</font><font color='#880000'>-2011-04-15    Sebastian Huber <sebastian.huber@embedded-brains.de>
</font><font color='#000088'>+2011-04-16    Chris Johns <chrisj@rtems.org>
+
+       PR 1774/filesystem
+       * libfs/src/imfs/imfs_eval.c: Fix the IMFS eval and eval for make
+       handlers to not inspect a mounted file sytems path.
</font> 
<font color='#000088'>+2011-04-15 Sebastian Huber <sebastian.huber@embedded-brains.de>
</font>   * libcsupport/src/ioctl.c, libfs/src/pipe/fifo.c: Fixed integer type.
 
 2011-04-11     Joel Sherrill <joel.sherrill@oarcorp.com>

<font color='#006600'>diff -u rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.31 rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.32
--- rtems/cpukit/libfs/src/imfs/imfs_eval.c:1.31        Fri Aug 27 12:32:59 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_eval.c     Fri Apr 15 23:40:11 2011
</font><font color='#997700'>@@ -292,6 +292,7 @@
</font>    * Get the path length.
    */
   pathlen = strlen( path );
<font color='#000088'>+
</font>   /*
    *  Evaluate all tokens until we are done or an error occurs.
    */
<font color='#997700'>@@ -321,56 +322,58 @@
</font>       case IMFS_UP_DIR:
        /*
         *  Am I at the root of all filesystems? (chroot'ed?)
<font color='#880000'>-   */
</font><font color='#000088'>+        */
</font> 
        if ( pathloc->node_access == rtems_filesystem_root.node_access )
          break;       /* Throw out the .. in this case */
 
 
<font color='#880000'>-   /*
-        * Am I at the root of this mounted filesystem?
-        */
</font><font color='#000088'>+       /*
+        * Am I at the root of this mounted filesystem?
+        */
</font> 
<font color='#880000'>-        if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){
</font><font color='#000088'>+        if (pathloc->node_access ==
+            pathloc->mt_entry->mt_fs_root.node_access){
</font> 
           /*
<font color='#880000'>-      *  Am I at the root of all filesystems?
-          */
</font><font color='#000088'>+           *  Am I at the root of all filesystems?
+           */
</font> 
           if ( pathloc->node_access == rtems_filesystem_root.node_access ) {
             break;
<font color='#880000'>-
-         } else {
</font><font color='#000088'>+          } else {
</font>             newloc = pathloc->mt_entry->mt_point_node;
             *pathloc = newloc;
<font color='#880000'>-            return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
-         }
-       } else {
-
</font><font color='#000088'>+            return (*pathloc->ops->evalformake_h)( &path[i], pathloc, name );
+          }
+        } else {
</font>           if ( !node->Parent )
             rtems_set_errno_and_return_minus_one( ENOENT );
 
           node = node->Parent;
<font color='#880000'>-   }
</font><font color='#000088'>+        }
</font> 
         pathloc->node_access = node;
         break;
 
       case IMFS_NAME:
<font color='#000088'>+        /*
+         *  If we are at a link follow it.
+         */
</font> 
<font color='#880000'>-   if ( node->type == IMFS_HARD_LINK ) {
</font><font color='#000088'>+        if ( node->type == IMFS_HARD_LINK ) {
</font> 
           result = IMFS_evaluate_link( pathloc, 0 );
           if ( result == -1 )
             return -1;
 
<font color='#880000'>-   } else if ( node->type == IMFS_SYM_LINK ) {
</font><font color='#000088'>+        } else if ( node->type == IMFS_SYM_LINK ) {
</font> 
           result = IMFS_evaluate_link( pathloc, 0 );
 
           if ( result == -1 )
             return -1;
<font color='#880000'>-   }
</font><font color='#000088'>+        }
</font> 
         node = pathloc->node_access;
         if ( !node )
<font color='#997700'>@@ -378,38 +381,38 @@
</font> 
         /*
          * Only a directory can be decended into.
<font color='#880000'>-    */
</font><font color='#000088'>+         */
</font> 
         if ( node->type != IMFS_DIRECTORY )
           rtems_set_errno_and_return_minus_one( ENOTDIR );
 
<font color='#880000'>-   /*
-        * If we are at a node that is a mount point. Set loc to the
-        * new fs root node and let them finish evaluating the path.
-        */
-
-        if ( node->info.directory.mt_fs != NULL ) {
-          newloc  = node->info.directory.mt_fs->mt_fs_root;
-          *pathloc = newloc;
-          return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name );
-       }
-
-       /*
-        * Otherwise find the token name in the present location.
-        */
</font><font color='#000088'>+        /*
+         * Otherwise find the token name in the present location.
+         */
</font> 
         node = IMFS_find_match_in_dir( node, token );
 
<font color='#880000'>-   /*
-        * If there is no node we have found the name of the node we
</font><font color='#000088'>+        /*
+         * If there is no node we have found the name of the node we
</font>          * wish to create.
<font color='#880000'>-    */
</font><font color='#000088'>+         */
</font> 
         if ( ! node )
           done = true;
<font color='#880000'>-        else
-          pathloc->node_access = node;
</font><font color='#000088'>+        else {
+          /*
+           * If we are at a node that is a mount point. Set loc to the
+           * new fs root node and let them finish evaluating the path.
+           */
</font> 
<font color='#000088'>+          if ( node->info.directory.mt_fs != NULL ) {
+            newloc  = node->info.directory.mt_fs->mt_fs_root;
+            *pathloc = newloc;
+            return (*pathloc->ops->evalformake_h)( &path[i], pathloc, name );
+          }
+<span style="background-color: #FF0000">          </span>
+          pathloc->node_access = node;
+        }
</font>         break;
 
       case IMFS_NO_MORE_PATH:
<font color='#997700'>@@ -543,18 +546,15 @@
</font>           } else {
             newloc = pathloc->mt_entry->mt_point_node;
             *pathloc = newloc;
<font color='#880000'>-            return (*pathloc->ops->evalpath_h)(&(pathname[i-len]),
-                                               pathnamelen+len,
</font><font color='#000088'>+            return (*pathloc->ops->evalpath_h)(&(pathname[i]),
+                                               pathnamelen,
</font>                                                flags,pathloc);
           }
         } else {
<font color='#880000'>-
</font>           if ( !node->Parent )
             rtems_set_errno_and_return_minus_one( ENOENT );
 
           node = node->Parent;
<font color='#880000'>-          pathloc->node_access = node;
-
</font>         }
 
         pathloc->node_access = node;
<font color='#997700'>@@ -564,17 +564,17 @@
</font>         /*
          *  If we are at a link follow it.
          */
<font color='#000088'>+
</font>         if ( node->type == IMFS_HARD_LINK ) {
<font color='#000088'>+
</font>           IMFS_evaluate_hard_link( pathloc, 0 );
<font color='#000088'>+
</font>           node = pathloc->node_access;
<font color='#880000'>-<span style="background-color: #FF0000">       </span>
-          /*
-          * It would be a design error if we evaluated the link and
-          * was broken.
-          */
-          IMFS_assert( node );
</font><font color='#000088'>+          if ( !node )
+            rtems_set_errno_and_return_minus_one( ENOTDIR );
</font> 
         } else if ( node->type == IMFS_SYM_LINK ) {
<font color='#000088'>+
</font>           result = IMFS_evaluate_sym_link( pathloc, 0 );
 
           /*
<font color='#997700'>@@ -589,25 +589,16 @@
</font>         /*
          *  Only a directory can be decended into.
          */
<font color='#000088'>+
</font>         if ( node->type != IMFS_DIRECTORY )
           rtems_set_errno_and_return_minus_one( ENOTDIR );
 
         /*
<font color='#880000'>-         *  If we are at a node that is a mount point. Set loc to the
-         *  new fs root node and let them finish evaluating the path.
-         */
-        if ( node->info.directory.mt_fs != NULL ) {
-          newloc   = node->info.directory.mt_fs->mt_fs_root;
-          *pathloc = newloc;
-          return (*pathloc->ops->evalpath_h)( &pathname[i-len],
-                                              pathnamelen+len,
-                                              flags, pathloc );
-        }
-
-        /*
</font>          *  Otherwise find the token name in the present location.
          */
<font color='#000088'>+
</font>         node = IMFS_find_match_in_dir( node, token );
<font color='#000088'>+
</font>         if ( !node )
           rtems_set_errno_and_return_minus_one( ENOENT );
 
<font color='#997700'>@@ -616,6 +607,19 @@
</font>          */
 
         pathloc->node_access = node;
<font color='#000088'>+<span style="background-color: #FF0000">        </span>
+        /*
+         *  If we are at a node that is a mount point. Set loc to the
+         *  new fs root node and let them finish evaluating the path.
+         */
+
+        if ( node->info.directory.mt_fs != NULL ) {
+          newloc   = node->info.directory.mt_fs->mt_fs_root;
+          *pathloc = newloc;
+          return (*pathloc->ops->evalpath_h)( &pathname[i],
+                                              pathnamelen,
+                                              flags, pathloc );
+        }
</font>         break;
 
       case IMFS_NO_MORE_PATH:
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>