|
|
@ -0,0 +1,99 @@ |
|
|
|
# --- 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 - 2006 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 --- |
|
|
|
|
|
|
|
|
|
|
|
This is an alternative ldconfig wildcard expansion (glob) patch for |
|
|
|
recent glibc's. |
|
|
|
|
|
|
|
- Valentin Ziegler <valentin@rocklinux-consulting.de> |
|
|
|
|
|
|
|
--- ./elf/ldconfig.c.orig 2004-09-14 13:28:34.000000000 +0200
|
|
|
|
+++ ./elf/ldconfig.c 2004-09-14 14:19:07.000000000 +0200
|
|
|
|
@@ -359,21 +359,57 @@
|
|
|
|
if (opt_chroot) |
|
|
|
path = chroot_canon (opt_chroot, path); |
|
|
|
|
|
|
|
- struct stat64 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);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- entry->ino = stat_buf.st_ino;
|
|
|
|
- entry->dev = stat_buf.st_dev;
|
|
|
|
+ /* assume path is a pattern. - Valentin */
|
|
|
|
|
|
|
|
- add_single_dir (entry, 1);
|
|
|
|
- }
|
|
|
|
+ glob_t result;
|
|
|
|
+ if (glob(path, GLOB_ONLYDIR, NULL, &result) == 0) {
|
|
|
|
+
|
|
|
|
+ for (int j = 0; j < result.gl_pathc; j++)
|
|
|
|
+ {
|
|
|
|
+ /* create a copy entry with expanded path */
|
|
|
|
+ struct dir_entry *real_entry = xmalloc (sizeof (struct dir_entry));
|
|
|
|
+ memcpy (real_entry, entry, sizeof (struct dir_entry));
|
|
|
|
+ real_entry->path = xstrdup (result.gl_pathv[j]);
|
|
|
|
+
|
|
|
|
+ struct stat64 stat_buf;
|
|
|
|
+ if (real_entry -> path == NULL || 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);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ /* fallback to code from glibc with orig. error handling */
|
|
|
|
+ struct stat64 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);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ entry->ino = stat_buf.st_ino;
|
|
|
|
+ entry->dev = stat_buf.st_dev;
|
|
|
|
+
|
|
|
|
+ add_single_dir (entry, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ globfree (&result);
|
|
|
|
+
|
|
|
|
+ /* ******************************* */
|
|
|
|
|
|
|
|
if (opt_chroot) |
|
|
|
free (path); |