Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312937
b: refs/heads/master
c: 55e4def
h: refs/heads/master
i:
  312935: 399df60
v: v3
  • Loading branch information
David Howells authored and Al Viro committed Jul 14, 2012
1 parent a0ac0f8 commit 3154bc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3c4f69424db0760239762d36d0b1b6ae524008b
refs/heads/master: 55e4def0a6e79e7eb53017c4935adfed76510cd7
41 changes: 7 additions & 34 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,25 +537,6 @@ static int chown_common(struct path *path, uid_t user, gid_t group)
return error;
}

SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
{
struct path path;
int error;

error = user_path(filename, &path);
if (error)
goto out;
error = mnt_want_write(path.mnt);
if (error)
goto out_release;
error = chown_common(&path, user, group);
mnt_drop_write(path.mnt);
out_release:
path_put(&path);
out:
return error;
}

SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
gid_t, group, int, flag)
{
Expand Down Expand Up @@ -583,23 +564,15 @@ SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
return error;
}

SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
{
struct path path;
int error;
return sys_fchownat(AT_FDCWD, filename, user, group, 0);
}

error = user_lpath(filename, &path);
if (error)
goto out;
error = mnt_want_write(path.mnt);
if (error)
goto out_release;
error = chown_common(&path, user, group);
mnt_drop_write(path.mnt);
out_release:
path_put(&path);
out:
return error;
SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
{
return sys_fchownat(AT_FDCWD, filename, user, group,
AT_SYMLINK_NOFOLLOW);
}

SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
Expand Down

0 comments on commit 3154bc2

Please sign in to comment.