Changeset 5357e24 in rtems


Ignore:
Timestamp:
Mar 3, 2011, 1:38:52 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.9
Children:
9ec55e63
Parents:
3601c29
Message:

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

PR 1749/filesystem

  • libcsupport/src/mknod.c: Fix the incorrect handling of the file type in the mode value o reject invalid types as per the standard.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r3601c29 r5357e24  
     12011-03-03      Chris Johns <chrisj@rtems.org>
     2
     3        PR 1749/filesystem
     4        * libcsupport/src/mknod.c: Fix the incorrect handling of the file type
     5        in the mode value o reject invalid types as per the standard.
     6
    172011-01-21      Eric Norum <wenorum@lbl.gov>
    28
  • cpukit/libcsupport/src/mknod.c

    r3601c29 r5357e24  
    4141  int                                 result;
    4242
    43   if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
    44     rtems_set_errno_and_return_minus_one( EINVAL );
     43  /*
     44   * The file type is field within the mode. Check we have a sane mode set.
     45   */
     46  switch (mode & S_IFMT) {
     47    case S_IFDIR:
     48    case S_IFCHR:
     49    case S_IFBLK:
     50    case S_IFREG:
     51    case S_IFIFO:
     52      break;
     53    default:
     54      rtems_set_errno_and_return_minus_one( EINVAL );
     55  }
    4556
    4657  if ( S_ISFIFO(mode) )
Note: See TracChangeset for help on using the changeset viewer.