patch-2.1.47 linux/fs/open.c
Next file: linux/fs/romfs/inode.c
Previous file: linux/fs/nfsd/vfs.c
Back to the patch index
Back to the overall index
- Lines: 51
- Date:
Wed Jul 23 09:48:11 1997
- Orig file:
v2.1.46/linux/fs/open.c
- Orig date:
Sun Jul 20 20:41:58 1997
diff -u --recursive --new-file v2.1.46/linux/fs/open.c linux/fs/open.c
@@ -543,44 +543,21 @@
return error;
}
-asmlinkage int sys_lchown(const char * filename, uid_t user, gid_t group)
-{
- struct dentry * dentry;
- int error;
-
- lock_kernel();
- dentry = lnamei(filename);
-
- error = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- goto out;
-
- error = chown_common(dentry, user, group);
-
- dput(dentry);
-out:
- unlock_kernel();
- return(error);
-}
-
asmlinkage int sys_chown(const char * filename, uid_t user, gid_t group)
{
struct dentry * dentry;
int error;
lock_kernel();
- dentry = namei(filename);
+ dentry = lnamei(filename);
error = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- goto out;
-
- error = chown_common(dentry, user, group);
-
- dput(dentry);
-out:
+ if (!IS_ERR(dentry)) {
+ error = chown_common(dentry, user, group);
+ dput(dentry);
+ }
unlock_kernel();
- return(error);
+ return error;
}
asmlinkage int sys_fchown(unsigned int fd, uid_t user, gid_t group)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov