[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1021577: libc-bin.postinst: please create /var/cache/ldconfig with DPKG_ROOT



Hi,

On 2022-10-11 21:50, Johannes Schauer Marin Rodrigues wrote:
> Hi,
> 
> Quoting Aurelien Jarno (2022-10-11 21:41:05)
> > On 2022-10-11 07:57, Johannes Schauer Marin Rodrigues wrote:
> > > Package: glibc
> > > Version: 2.35-3
> > > Severity: normal
> > > Tags: patch
> > > 
> > > Hi,
> > > 
> > > when running libc-bin.postinst with DPKG_ROOT non-empty, ldconfig from
> > > the outside is used to operate on the chroot and thus ldconfig will
> > > never create the empty /var/cache/ldconfig directory inside the chroot.
> > 
> > I don't get why this is needed. The point of calling ldconfig -r is to
> > create that directory and create the aux-cache file in it. In my tests
> > ldconfig does create that directory properly when ran with -r.
> > 
> > > Please consider creating that directory if DPKG_ROOT is non-empty.
> > 
> > Even if it ends up that in some conditions yet to be found, the
> > directory is not created, this doesn't seems correct. This means that
> > aux-cache file is also not created, which is more problematic.
> 
> I now have a much better understanding about what is happening and filed this
> patch:
> 
> https://sourceware.org/pipermail/libc-alpha/2022-October/142592.html
> 
> The problem occurs only if the opt_chroot variable is not NULL. This happens
> when you pass -r but the chroot() call fails, for example because you are
> running as an unprivileged user with fakeroot. In that case, chroot_canon()
> will return NULL because /var/cache/ldconfig doesn't exist in the chroot yet.
> This leads to aux_cache_file being set to NULL and that means that in the end
> save_aux_cache() doesn't get called.

Ok, thanks for the details, I'll look at the patch.

Anyway that makes me wonder if we should ship that directory in the
libc6 package, just like apt ships /var/cache/apt and debconf ships
/var/cache/debconf.

Regards
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

Attachment: signature.asc
Description: PGP signature


Reply to: