PATCH: Handle symlink to directory in ldconfig.
Hideki IWAMOTO
h-iwamoto@kit.hi-ho.ne.jp
Wed Jun 23 11:18:00 GMT 2004
On Wed, 23 Jun 2004 00:26:48 -0700, H. J. Lu wrote...
>
> Here is a patch.
>
>
> H.J.
It works for me. However, the following change is needed in order to avoid leak.
--- ldconfig.c-hjl 2004-06-23 20:04:23.000000000 +0900
+++ ldconfig.c 2004-06-23 20:07:11.000000000 +0900
@@ -364,15 +364,20 @@
else
path = entry->path;
- if (stat64 (path, &stat_buf))
+ if (path == NULL || stat64 (path, &stat_buf))
{
if (opt_verbose)
error (0, errno, _("Can't stat %s"), entry->path);
free (entry->path);
free (entry);
+ if (opt_chroot && path)
+ free (path);
return;
}
+ if (opt_chroot)
+ free (path);
+
entry->ino = stat_buf.st_ino;
entry->dev = stat_buf.st_dev;
----
Hideki IWAMOTO h-iwamoto@kit.hi-ho.ne.jp
More information about the Libc-alpha
mailing list