6 /*===========================================================================*
8 *===========================================================================*/
9 int fs_chmod(ino_t ino_nr
, mode_t
*mode
)
11 /* Perform the chmod(name, mode) system call. */
12 register struct inode
*rip
;
14 /* Temporarily open the file. */
15 if( (rip
= get_inode(fs_dev
, ino_nr
)) == NULL
)
18 if(rip
->i_sp
->s_rd_only
) {
23 /* Now make the change. Clear setgid bit if file is not in caller's grp */
24 rip
->i_mode
= (rip
->i_mode
& ~ALL_MODES
) | (*mode
& ALL_MODES
);
25 rip
->i_update
|= CTIME
;
28 /* Return full new mode to caller. */
36 /*===========================================================================*
38 *===========================================================================*/
39 int fs_chown(ino_t ino_nr
, uid_t uid
, gid_t gid
, mode_t
*mode
)
41 register struct inode
*rip
;
43 /* Temporarily open the file. */
44 if( (rip
= get_inode(fs_dev
, ino_nr
)) == NULL
)
49 rip
->i_mode
&= ~(I_SET_UID_BIT
| I_SET_GID_BIT
);
50 rip
->i_update
|= CTIME
;
53 /* Update caller on current mode, as it may have changed. */