change log for rtems (2011-03-03)

rtems-vc at rtems.org rtems-vc at rtems.org
Thu Mar 3 07:10:29 UTC 2011


 *ccj* (on branch rtems-4-10-branch):
2011-03-03      Chris Johns <chrisj at rtems.org>

        * libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
        1749. Fix the incorrect handling of the file type in the mode
        value to reject invalid types as per the standard.

M 1.2759  cpukit/ChangeLog
M 1.2346.2.79  cpukit/ChangeLog
M   1.16  cpukit/libcsupport/src/mknod.c
M 1.14.2.1  cpukit/libcsupport/src/mknod.c
M    1.6  cpukit/libfs/src/rfs/rtems-rfs-inode.c
M 1.3.2.3  cpukit/libfs/src/rfs/rtems-rfs-inode.c

diff -u rtems/cpukit/ChangeLog:1.2758 rtems/cpukit/ChangeLog:1.2759
--- rtems/cpukit/ChangeLog:1.2758	Wed Mar  2 08:39:45 2011
+++ rtems/cpukit/ChangeLog	Thu Mar  3 00:22:47 2011
@@ -1,3 +1,9 @@
+2011-03-03	Chris Johns <chrisj at rtems.org>
+
+	* libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
+	1749. Fix the incorrect handling of the file type in the mode
+	value to reject invalid types as per the standard.
+ 
 2011-03-02	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* libnetworking/netinet/if_ether.c, 

diff -u rtems/cpukit/ChangeLog:1.2346.2.78 rtems/cpukit/ChangeLog:1.2346.2.79
--- rtems/cpukit/ChangeLog:1.2346.2.78	Mon Feb  7 16:34:09 2011
+++ rtems/cpukit/ChangeLog	Thu Mar  3 00:33:14 2011
@@ -1,3 +1,9 @@
+2011-03-03	Chris Johns <chrisj at rtems.org>
+
+	* libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
+	1749. Fix the incorrect handling of the file type in the mode
+	value to reject invalid types as per the standard.
+
 2011-02-08	Brett Swimley <bswimley at advanced.pro>
 
 	* libfs/src/rfs/rtems-rfs-rtems.c: Fix bug where the eval path did

diff -u rtems/cpukit/libcsupport/src/mknod.c:1.15 rtems/cpukit/libcsupport/src/mknod.c:1.16
--- rtems/cpukit/libcsupport/src/mknod.c:1.15	Thu Jul  1 10:12:37 2010
+++ rtems/cpukit/libcsupport/src/mknod.c	Thu Mar  3 00:22:48 2011
@@ -40,9 +40,21 @@
   const char                         *name_start;
   int                                 result;
 
-  if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
+  /*
+   * The file type is field within the mode. Check we have a sane mode set.
+   */
+  switch (mode & S_IFMT)
+  {
+    case S_IFDIR:
+    case S_IFCHR:
+    case S_IFBLK:
+    case S_IFREG:
+    case S_IFIFO:
+      break;
+    default:
+      rtems_set_errno_and_return_minus_one( EINVAL );
+  }
+  
   rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
 
   result = (*temp_loc.ops->evalformake_h)(

diff -u rtems/cpukit/libcsupport/src/mknod.c:1.14 rtems/cpukit/libcsupport/src/mknod.c:1.14.2.1
--- rtems/cpukit/libcsupport/src/mknod.c:1.14	Tue Oct 14 10:06:25 2008
+++ rtems/cpukit/libcsupport/src/mknod.c	Thu Mar  3 00:33:15 2011
@@ -40,9 +40,21 @@
   const char                         *name_start;
   int                                 result;
 
-  if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
+  /*
+   * The file type is field within the mode. Check we have a sane mode set.
+   */
+  switch (mode & S_IFMT)
+  {
+    case S_IFDIR:
+    case S_IFCHR:
+    case S_IFBLK:
+    case S_IFREG:
+    case S_IFIFO:
+      break;
+    default:
+      rtems_set_errno_and_return_minus_one( EINVAL );
+  }
+  
   rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
 
   if ( !temp_loc.ops->evalformake_h ) {

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.5 rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.6
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.5	Sun Oct 10 23:34:48 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c	Thu Mar  3 00:22:48 2011
@@ -211,6 +211,21 @@
     printf (" type:%s mode:%04x (%03o)\n", type, mode, mode & ((1 << 10) - 1));
   }
 
+  /*
+   * The file type is field within the mode. Check we have a sane mode set.
+   */
+  switch (mode & RTEMS_RFS_S_IFMT)
+  {
+    case RTEMS_RFS_S_IFDIR:
+    case RTEMS_RFS_S_IFCHR:
+    case RTEMS_RFS_S_IFBLK:
+    case RTEMS_RFS_S_IFREG:
+    case RTEMS_RFS_S_IFLNK:
+      break;
+    default:
+      return EINVAL;
+  }
+  
   rc = rtems_rfs_inode_alloc (fs, parent, ino);
   if (rc > 0)
     return rc;

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.3.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.3.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.3.2.2	Mon Oct 11 16:12:48 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c	Thu Mar  3 00:33:16 2011
@@ -211,6 +211,21 @@
     printf (" type:%s mode:%04x (%03o)\n", type, mode, mode & ((1 << 10) - 1));
   }
 
+  /*
+   * The file type is field within the mode. Check we have a sane mode set.
+   */
+  switch (mode & RTEMS_RFS_S_IFMT)
+  {
+    case RTEMS_RFS_S_IFDIR:
+    case RTEMS_RFS_S_IFCHR:
+    case RTEMS_RFS_S_IFBLK:
+    case RTEMS_RFS_S_IFREG:
+    case RTEMS_RFS_S_IFLNK:
+      break;
+    default:
+      return EINVAL;
+  }
+  
   rc = rtems_rfs_inode_alloc (fs, parent, ino);
   if (rc > 0)
     return rc;



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110303/7baa2ee1/attachment.html>


More information about the vc mailing list