예제 #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;
});
예제 #2
0
파일: kunistd.c 프로젝트: TacOS-team/tacos
SYSCALL_HANDLER3(sys_chown, const char *path, uid_t owner, gid_t *group) {
	*group = vfs_chown(path, owner, *group);
}
예제 #3
0
파일: msg.c 프로젝트: bishisht/manrix
/* 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);
}