[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PATCH -> Re: Filesystem corruption bug in libdiskfs
From: |
M.P.Anand Babu |
Subject: |
Re: PATCH -> Re: Filesystem corruption bug in libdiskfs |
Date: |
09 Dec 2002 10:32:05 -0800 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 |
,---- "Alfred M. Szmidt" <ams@kemisten.nu> writes:
| You might also want to note that this was reported by Richard Smith.
`----
Sure we should do that. And thanks for correcting me that bug was not
fixed in the CVS.
Here is the updated ChangeLog.
file: libdiskfs/ChangeLog
======================================================================
2002-12-09 M.P. Anand Babu <ab@gnu.org.in>
* dir-renamed.c (diskfs_rename_dir): check if fromcred->user
has enough permissions to unlink node fnp from its parent fdp
before moving. Bug reported by Richard Smith <rgs26@hermes.cam.ac.uk>
======================================================================
Patch dir-rename-parentdir-perm-bug
======================================================================
diff -pruN hurd/libdiskfs/dir-renamed.c hurd-ab/libdiskfs/dir-renamed.c
--- hurd/libdiskfs/dir-renamed.c 2001-10-11 19:49:17.000000000 -0700
+++ hurd-ab/libdiskfs/dir-renamed.c 2002-12-08 23:54:17.000000000 -0800
@@ -91,6 +91,11 @@ diskfs_rename_dir (struct node *fdp, str
if (fdp != tdp)
mutex_lock (&tdp->lock);
+ /* Check if we are allowed to modify "ftp" with respect to "fnp" */
+ err = fshelp_checkdirmod (&fdp->dn_stat, &fnp->dn_stat, fromcred->user);
+ if (err)
+ goto out;
+
/* 1: Lookup target; if it exists, make sure it's an empty directory. */
ds = buf;
err = diskfs_lookup (tdp, toname, RENAME, &tnp, ds, tocred);
======================================================================
--
_.|_
(_||_)
Free as in Freedom <www.gnu.org>