Exemplo n.º 1
0
int sys_chown(const char* pathname, uid_t owner, gid_t group) {
	int fd = sys_open(pathname, O_RDONLY, 0);
	if(fd < 0)
		return -1;

	inode_t* inode = current_task->fd[fd].inode;

	if((current_task->uid == inode->uid) || (current_task->uid == TASK_ROOT_UID))
		return vfs_chown(inode, owner, group);

	errno = EPERM;
	return -1;
});
Exemplo n.º 2
0
SYSCALL_HANDLER3(sys_chown, const char *path, uid_t owner, gid_t *group) {
	*group = vfs_chown(path, owner, *group);
}
Exemplo n.º 3
0
/* Chown */
void msg_chown(message_t msg)
{
	msg->w1 = vfs_chown(msg->tid, msg->snd_ptr, msg->w4, msg->w5);
	reply_message(msg->tid, msg);
}