diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-27 17:33:42 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-27 17:33:42 +0000 |
commit | efc6811853f0b9f0b445254d14c0b75ef64f8159 (patch) | |
tree | fdea3e99cf46664be9aed9014eb39caf97d419be | |
parent | ebe25393f2842134ce34c0c7c88faf86233644ee (diff) |
2010-08-27 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1692/filesystem
* libcsupport/include/rtems/libio.h, libfs/src/imfs/imfs_eval.c: Fix
implementation and use of rtems_libio_is_valid_perms().
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_eval.c | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 4d0b480e9a..3bf0819724 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2010-08-27 Joel Sherrill <joel.sherrilL@OARcorp.com> + + PR 1692/filesystem + * libcsupport/include/rtems/libio.h, libfs/src/imfs/imfs_eval.c: Fix + implementation and use of rtems_libio_is_valid_perms(). + 2010-06-21 Peter Dufault <dufault@hda.com> PR 1570/cpukit diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index cf0441cbac..be2a14bce7 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -529,7 +529,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) /* diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c index 3d8df0b2e0..ee5ddea520 100644 --- a/cpukit/libfs/src/imfs/imfs_eval.c +++ b/cpukit/libfs/src/imfs/imfs_eval.c @@ -79,10 +79,8 @@ int IMFS_evaluate_permission( IMFS_jnode_t *jnode; int flags_to_test; - 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 ); jnode = node->node_access; |