patch-2.1.132 linux/fs/qnx4/namei.c
Next file: linux/fs/smbfs/dir.c
Previous file: linux/fs/proc/root.c
Back to the patch index
Back to the overall index
- Lines: 54
- Date:
Fri Dec 18 07:09:35 1998
- Orig file:
v2.1.131/linux/fs/qnx4/namei.c
- Orig date:
Wed Dec 16 10:32:56 1998
diff -u --recursive --new-file v2.1.131/linux/fs/qnx4/namei.c linux/fs/qnx4/namei.c
@@ -168,29 +168,9 @@
if (bh == NULL) {
return -ENOENT;
}
- if ((inode = iget(dir->i_sb, ino)) == NULL) {
- QNX4DEBUG(("qnx4: lookup->iget -> NULL\n"));
- retval = -EACCES;
- goto end_rmdir;
- }
- retval = -EPERM;
- if ((dir->i_mode & S_ISVTX) &&
- current->fsuid != inode->i_uid &&
- current->fsuid != dir->i_uid && !capable(CAP_FOWNER)) {
- QNX4DEBUG(("qnx4: rmdir->capabilities\n"));
- goto end_rmdir;
- }
- if (inode->i_dev != dir->i_dev) {
- QNX4DEBUG(("qnx4: rmdir->different devices\n"));
- goto end_rmdir;
- }
- if (inode == dir) { /* we may not delete ".", but "../dir" is ok */
- QNX4DEBUG(("qnx4: inode==dir\n"));
- goto end_rmdir;
- }
- if (!S_ISDIR(inode->i_mode)) {
- QNX4DEBUG(("qnx4: rmdir->not a directory\n"));
- retval = -ENOTDIR;
+ inode = dentry->d_inode;
+ if (inode->i_ino != ino) {
+ retval = -EIO;
goto end_rmdir;
}
#if 0
@@ -239,17 +219,12 @@
if (bh == NULL) {
return -ENOENT;
}
- if ((inode = iget(dir->i_sb, ino)) == NULL) {
- QNX4DEBUG(("qnx4: lookup->iget -> NULL\n"));
- retval = -EACCES;
+ inode = dentry->d_inode;
+ if (inode->i_ino != ino) {
+ retval = -EIO;
goto end_unlink;
}
retval = -EPERM;
- if ((dir->i_mode & S_ISVTX) &&
- current->fsuid != inode->i_uid &&
- current->fsuid != dir->i_uid && !capable(CAP_FOWNER)) {
- goto end_unlink;
- }
if (!inode->i_nlink) {
QNX4DEBUG(("Deleting nonexistent file (%s:%lu), %d\n",
kdevname(inode->i_dev),
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov