This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Handle symlink to directory in ldconfig.
- From: Hideki IWAMOTO <h-iwamoto at kit dot hi-ho dot ne dot jp>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 23 Jun 2004 20:18:25 +0900
- Subject: Re: PATCH: Handle symlink to directory in ldconfig.
- References: <20040623072648.GA9497@lucon.org>
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