From b2067230354500e86d125c788c94238e78d95b03 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 29 Oct 2001 23:24:54 +0000 Subject: 2001-10-30 Marcus Brinkmann * dir-lookup.c (diskfs_S_dir_lookup): When looking up the next pathname component, remove assertion for DS and allocate DS if 0. Allow creation of files through symlink with non-existant target. From Roland McGrath . --- libdiskfs/dir-lookup.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'libdiskfs/dir-lookup.c') diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index 402371d4..018b7503 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -118,8 +118,8 @@ diskfs_S_dir_lookup (struct protid *dircred, /* diskfs_lookup the next pathname component */ if (lastcomp && create) { - assert (!ds); - ds = alloca (diskfs_dirstat_size); + if (!ds) + ds = alloca (diskfs_dirstat_size); error = diskfs_lookup (dnp, path, CREATE, &np, ds, dircred); } else @@ -367,12 +367,7 @@ diskfs_S_dir_lookup (struct protid *dircred, } if (lastcomp) - { - lastcomp = 0; - /* Symlinks to nonexistent files aren't allowed to cause - creation, so clear the flag here. */ - create = 0; - } + lastcomp = 0; diskfs_nput (np); np = 0; -- cgit v1.2.3