RPM Community Forums

Mailing List Message of <rpm-devel>

chroot(2) <-> db-4.6.19 problems

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 23 Sep 2007 - 20:03:06 CEST
Message-Id: <A56BD9BA-097A-4083-A3D3-AF465D7FAEEF@mac.com>
Berkeley DB 4.6.19 appears to be caching (and using) paths
within a dbenv, which breaks lazy table opens using rpm --root in
rather complicated ways. The fundamental cause is simply that
sometimes file paths need prefixing, and sometimes not.

The quick-n-dirty workaround if you are making extensive use of rpm -- 
is to open all tables before entering the chroot by setting this  
macro to 1:

     #       Open all indices before doing chroot(2).
     %_openall_before_chroot 0

I say "workaround" because opening all indices before entering chroot
assumes that
    a) the tables to be opened never change
    b) there is no outside attempt to access from within the chroot,  
i.e. doing
	chroot /path/to/chroot rpm -qa
     instead of doing
	rpm -qa --dbpath /path/to/chroot/var/lib/rpm
     as each of those accesses opens with different file paths.

However, there are no clear engineering solutions to any of the  
above, thank you POSIX and UGLIX.

Because of the often requested feature to be able to install using  
rpm --root as an
unprivileged user (chroot(2) is limited to uid=0), the forward  
looking development
answer will be to attempt to emulate chroot prefixing for  
unprivileged users,
but that too is a largish change that assumes that all file paths  
pass only
through a syscall wrapper, not through the syscall itself.

73 de Jeff
Received on Sun Sep 23 20:03:35 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.