summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-27 17:33:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2010-08-27 17:33:11 +0000
commited4a3f6e367796fdc6343790d9fa60bcfe7e5f31 (patch)
treed3a036cb0fd27003cdf513d2c4f637119ddd5fb5 /cpukit
parent2010-08-26 Chris Johns <chrisj@rtems.org> (diff)
downloadrtems-ed4a3f6e367796fdc6343790d9fa60bcfe7e5f31.tar.bz2
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().
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog7
-rw-r--r--cpukit/libcsupport/include/rtems/libio.h2
-rw-r--r--cpukit/libfs/src/devfs/devfs_eval.c6
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c6
4 files changed, 12 insertions, 9 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 6dded78421..3171eff752 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -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 Chris Johns <chrisj@rtems.org>
* libfs/src/rfs/rtems-rfs-file.c: Check then load the inode is not
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index 7db9524ef7..9f04db96d5 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -537,7 +537,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
diff --git a/cpukit/libfs/src/devfs/devfs_eval.c b/cpukit/libfs/src/devfs/devfs_eval.c
index 0df5754ad5..a3169fb3fa 100644
--- a/cpukit/libfs/src/devfs/devfs_eval.c
+++ b/cpukit/libfs/src/devfs/devfs_eval.c
@@ -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;
diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c
index b282e7c9a4..7aba2b535e 100644
--- a/cpukit/libfs/src/imfs/imfs_eval.c
+++ b/cpukit/libfs/src/imfs/imfs_eval.c
@@ -82,10 +82,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;