forked from Imagelibrary/rtems
2011-03-03 Chris Johns <chrisj@rtems.org>
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.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2011-03-03 Chris Johns <chrisj@rtems.org>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
2011-01-21 Eric Norum <wenorum@lbl.gov>
|
2011-01-21 Eric Norum <wenorum@lbl.gov>
|
||||||
|
|
||||||
* libmisc/capture/capture.c: Avoid using TCB of task just deleted.
|
* libmisc/capture/capture.c: Avoid using TCB of task just deleted.
|
||||||
|
|||||||
@@ -40,8 +40,19 @@ int mknod(
|
|||||||
const char *name_start;
|
const char *name_start;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
|
/*
|
||||||
|
* 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_set_errno_and_return_minus_one( EINVAL );
|
||||||
|
}
|
||||||
|
|
||||||
if ( S_ISFIFO(mode) )
|
if ( S_ISFIFO(mode) )
|
||||||
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
rtems_set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|||||||
Reference in New Issue
Block a user