diff options
Diffstat (limited to 'cpukit/libfs/src/imfs/imfs_fchmod.c')
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_fchmod.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cpukit/libfs/src/imfs/imfs_fchmod.c b/cpukit/libfs/src/imfs/imfs_fchmod.c index 6cb56aa629..54a093de2f 100644 --- a/cpukit/libfs/src/imfs/imfs_fchmod.c +++ b/cpukit/libfs/src/imfs/imfs_fchmod.c @@ -46,11 +46,9 @@ int IMFS_fchmod( /* * Change only the RWX permissions on the jnode to mode. */ - if ( mode & (~ (S_IRWXU | S_IRWXG | S_IRWXO ) ) ) - rtems_set_errno_and_return_minus_one( EPERM ); - jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO); - jnode->st_mode |= mode; + jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); + jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); |