Skip to content

Commit

Permalink
Allow aux_cache_file open()ing to fail silently even in the chroot mode.
Browse files Browse the repository at this point in the history
The aux_cache fix of bug 11149 introduced a new bug - normally,
ldconfig -r never cares if the auxiliary cache is not available and
that is not a fatal problem, however this is not the case in case
of ldconfig -r when executed as non-root. In that case, ldconfig -r
fails hard unless var/cache/ldconfig/ exists within the chroot. This
patch fixes that.

Conflicts:

	ChangeLog
(cherry picked from commit 6db52fb)
  • Loading branch information
Petr Baudis committed Nov 30, 2010
1 parent 491e947 commit 977bbf5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-05-31 Petr Baudis <pasky@suse.cz>

[BZ #11149]
* elf/ldconfig.c (main): Allow aux_cache_file open()ing to fail
silently even in the chroot mode.

2010-05-31 Petr Baudis <pasky@suse.cz>

[BZ #10085]
Expand Down
12 changes: 4 additions & 8 deletions elf/ldconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,14 +1359,9 @@ main (int argc, char **argv)

const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
if (opt_chroot)
{
aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
if (aux_cache_file == NULL)
error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
_PATH_LDCONFIG_AUX_CACHE);
}
aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);

if (! opt_ignore_aux_cache)
if (! opt_ignore_aux_cache && aux_cache_file)
load_aux_cache (aux_cache_file);
else
init_aux_cache ();
Expand All @@ -1376,7 +1371,8 @@ main (int argc, char **argv)
if (opt_build_cache)
{
save_cache (cache_file);
save_aux_cache (aux_cache_file);
if (aux_cache_file)
save_aux_cache (aux_cache_file);
}

return 0;
Expand Down

0 comments on commit 977bbf5

Please sign in to comment.