summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-05-19 18:12:20 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-05-19 19:21:53 +0200
commite840329de670757720cec729556b9b1f7d655ab5 (patch)
tree730c89867208bb55244f5b5262e7c1d862ef2c46 /libdiskfs
parent09964a022f1c1e969d8258c7a38879b0fa983402 (diff)
libdiskfs: fix renaming of directories
Previously, file permissions and ownership of the target directory were ignored when renaming a directory: % mkdir a b % chmod 555 a % mv b a % ls a b * libdiskfs/dir-renamed.c (diskfs_rename_dir): Fix error handling.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/dir-renamed.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c
index 9e37e234..a4878f3d 100644
--- a/libdiskfs/dir-renamed.c
+++ b/libdiskfs/dir-renamed.c
@@ -94,6 +94,8 @@ diskfs_rename_dir (struct node *fdp, struct node *fnp, const char *fromname,
ds = buf;
err = diskfs_lookup (tdp, toname, RENAME, &tnp, ds, tocred);
assert (err != EAGAIN); /* <-> assert (TONAME != "..") */
+ if (err && err != ENOENT)
+ goto out;
if (tnp == fnp)
{