# --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/base/glibc/glibc23/ldconfig-glob.patch # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # --- ROCK-COPYRIGHT-NOTE-END --- --- ./elf/ldconfig.c.orig 2002-09-14 12:12:51.000000000 +0200 +++ ./elf/ldconfig.c 2002-09-14 12:52:50.000000000 +0200 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -302,8 +303,10 @@ { char *equal_sign; struct dir_entry *entry; + struct dir_entry *real_entry; unsigned int i; struct stat64 stat_buf; + glob_t globres; entry = xmalloc (sizeof (struct dir_entry)); entry->next = NULL; @@ -338,19 +341,50 @@ --i; } - if (stat64 (entry->path, &stat_buf)) - { - if (opt_verbose) - error (0, errno, _("Can't stat %s"), entry->path); - free (entry->path); - free (entry); - return; - } + if ( glob(entry->path, GLOB_ONLYDIR, NULL, &globres) == 0 ) + { + for (i=0; ipath = xstrdup (globres.gl_pathv[i]); - entry->ino = stat_buf.st_ino; - entry->dev = stat_buf.st_dev; + if (stat64 (real_entry->path, &stat_buf)) + { + if (opt_verbose) + error (0, errno, _("Can't stat %s"), real_entry->path); + free (real_entry->path); + free (real_entry); + } + else + { + real_entry->ino = stat_buf.st_ino; + real_entry->dev = stat_buf.st_dev; + + add_single_dir (real_entry, 1); + } + } + globfree (&globres); + free (entry->path); + free (entry); + } + else + { + if (stat64 (entry->path, &stat_buf)) + { + if (opt_verbose) + error (0, errno, _("Can't stat %s"), entry->path); + free (entry->path); + free (entry); + } + else + { + entry->ino = stat_buf.st_ino; + entry->dev = stat_buf.st_dev; - add_single_dir (entry, 1); + add_single_dir (entry, 1); + } + } }