summaryrefslogtreecommitdiffstats
path: root/cpukit/libfs
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-12-22 07:56:57 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-05 14:29:09 +0100
commitf9f7321e0a7d6f1178687668bec7fe2edb378d42 (patch)
tree8793dff4f74f616291084b08db3e2652bade344c /cpukit/libfs
parentdoc: Mention potential SMP scheduler improvement (diff)
downloadrtems-f9f7321e0a7d6f1178687668bec7fe2edb378d42.tar.bz2
Filesystem: Remove superfluous permission checks
The permission is check by the upper layer.
Diffstat (limited to 'cpukit/libfs')
-rw-r--r--cpukit/libfs/src/imfs/imfs_chown.c16
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-rtems.c17
2 files changed, 1 insertions, 32 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_chown.c b/cpukit/libfs/src/imfs/imfs_chown.c
index 9f96133556..ca48eee006 100644
--- a/cpukit/libfs/src/imfs/imfs_chown.c
+++ b/cpukit/libfs/src/imfs/imfs_chown.c
@@ -30,24 +30,10 @@ int IMFS_chown(
gid_t group
)
{
- IMFS_jnode_t *jnode;
-#if defined(RTEMS_POSIX_API)
- uid_t st_uid;
-#endif
+ IMFS_jnode_t *jnode;
jnode = (IMFS_jnode_t *) loc->node_access;
- /*
- * Verify I am the owner of the node or the super user.
- */
-
-#if defined(RTEMS_POSIX_API)
- st_uid = geteuid();
-
- if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) )
- rtems_set_errno_and_return_minus_one( EPERM );
-#endif
-
jnode->st_uid = owner;
jnode->st_gid = group;
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
index a0ade04ba0..d3393d672a 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c
@@ -274,9 +274,6 @@ rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (pathloc);
rtems_rfs_inode_handle inode;
-#if defined (RTEMS_POSIX_API)
- uid_t uid;
-#endif
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_CHOWN))
@@ -289,20 +286,6 @@ rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
return rtems_rfs_rtems_error ("chown: opening inode", rc);
}
- /*
- * Verify I am the owner of the node or the super user.
- */
-
-#if defined (RTEMS_POSIX_API)
- uid = geteuid();
-
- if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
- {
- rtems_rfs_inode_close (fs, &inode);
- return rtems_rfs_rtems_error ("chown: not able", EPERM);
- }
-#endif
-
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);