mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 14:58:38 +08:00
2010-08-27 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1692/filesystem * libcsupport/include/rtems/libio.h, libfs/src/devfs/devfs_eval.c, libfs/src/imfs/imfs_eval.c: Fix implementation and use of rtems_libio_is_valid_perms().
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2010-08-27 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
PR 1692/filesystem
|
||||
* libcsupport/include/rtems/libio.h, libfs/src/devfs/devfs_eval.c,
|
||||
libfs/src/imfs/imfs_eval.c: Fix implementation and use of
|
||||
rtems_libio_is_valid_perms().
|
||||
|
||||
2010-08-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* libfs/src/defaults/default_evalpath.c,
|
||||
|
||||
@@ -1287,7 +1287,7 @@ static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
|
||||
* Verifies that the permission flag is valid.
|
||||
*/
|
||||
#define rtems_libio_is_valid_perms( _perm ) \
|
||||
(~ ((~RTEMS_LIBIO_PERMS_RWX) & _perm ))
|
||||
(((~RTEMS_LIBIO_PERMS_RWX) & _perm ) == 0)
|
||||
|
||||
/*
|
||||
* Prototypes for filesystem
|
||||
|
||||
@@ -40,10 +40,8 @@ int devFS_evaluate_path(
|
||||
rtems_device_name_t *device_name_table;
|
||||
|
||||
/* see if 'flags' is valid */
|
||||
if ( !rtems_libio_is_valid_perms( flags ) ) {
|
||||
assert( 0 );
|
||||
rtems_set_errno_and_return_minus_one( EIO );
|
||||
}
|
||||
if ( !rtems_libio_is_valid_perms( flags ) )
|
||||
rtems_set_errno_and_return_minus_one( EPERM );
|
||||
|
||||
/* get the device name table */
|
||||
device_name_table = (rtems_device_name_t *)pathloc->node_access;
|
||||
|
||||
@@ -80,9 +80,8 @@ int IMFS_evaluate_permission(
|
||||
IMFS_jnode_t *jnode;
|
||||
int flags_to_test;
|
||||
|
||||
if ( !rtems_libio_is_valid_perms( flags ) ) {
|
||||
rtems_set_errno_and_return_minus_one( EIO );
|
||||
}
|
||||
if ( !rtems_libio_is_valid_perms( flags ) )
|
||||
rtems_set_errno_and_return_minus_one( EPERM );
|
||||
|
||||
jnode = node->node_access;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user