Changeset b3c3864 in rtems


Ignore:
Timestamp:
Mar 3, 2011, 6:33:16 AM (8 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10
Children:
280f82d7
Parents:
c204c27
Message:

2011-03-03 Chris Johns <chrisj@…>

  • libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
  1. Fix the incorrect handling of the file type in the mode value to reject invalid types as per the standard.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rc204c27 rb3c3864  
     12011-03-03      Chris Johns <chrisj@rtems.org>
     2
     3        * libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
     4        1749. Fix the incorrect handling of the file type in the mode
     5        value to reject invalid types as per the standard.
     6
    172011-02-08      Brett Swimley <bswimley@advanced.pro>
    28
  • cpukit/libcsupport/src/mknod.c

    rc204c27 rb3c3864  
    4141  int                                 result;
    4242
    43   if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
    44     rtems_set_errno_and_return_minus_one( EINVAL );
    45 
     43  /*
     44   * The file type is field within the mode. Check we have a sane mode set.
     45   */
     46  switch (mode & S_IFMT)
     47  {
     48    case S_IFDIR:
     49    case S_IFCHR:
     50    case S_IFBLK:
     51    case S_IFREG:
     52    case S_IFIFO:
     53      break;
     54    default:
     55      rtems_set_errno_and_return_minus_one( EINVAL );
     56  }
     57 
    4658  rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
    4759
  • cpukit/libfs/src/rfs/rtems-rfs-inode.c

    rc204c27 rb3c3864  
    212212  }
    213213
     214  /*
     215   * The file type is field within the mode. Check we have a sane mode set.
     216   */
     217  switch (mode & RTEMS_RFS_S_IFMT)
     218  {
     219    case RTEMS_RFS_S_IFDIR:
     220    case RTEMS_RFS_S_IFCHR:
     221    case RTEMS_RFS_S_IFBLK:
     222    case RTEMS_RFS_S_IFREG:
     223    case RTEMS_RFS_S_IFLNK:
     224      break;
     225    default:
     226      return EINVAL;
     227  }
     228 
    214229  rc = rtems_rfs_inode_alloc (fs, parent, ino);
    215230  if (rc > 0)
Note: See TracChangeset for help on using the changeset viewer.