[issue63] [PATCH] Added 'rpm-dbpath' option; enhanced chroot operations

Enrico Scholz at Labix Tracker tracker at labix.org
Mon Jan 2 11:16:38 PST 2006


Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> added the comment:

I can not change the dbpath outside the chroot because rpmlib does not support
dbpaths outside of the chroot.

The patch is necessary because smart is doing insecure operations. You CAN NOT
emulate a chroot environment just by concatenating two paths.

E.g. old smart code did

| tmpdir = os.path.join(getTS.root, "var/tmp")
| os.makedirs(tmpdir)

When '<chroot>/var' is a symlink to /etc, then /etc/tmp will be created outside
of the chroot.

Or

|        path = os.path.join(sysconf.get("rpm-root", "/"),
|                            "var/lib/rpm/Packages")
|        digest = os.path.getmtime(path)

When <chroot>/var/lib/rpm is a symlink to somewhere else (e.g. linux-vserver
makes it a symlink to /.rpmdb by default), the wrong 'Packages' file will be read.

This patch fixes the chroot handling in smart but it can not fix/change the
handling in rpmlib.

_______________________________________
Labix issue tracker <tracker at labix.org>
<http://tracker.labix.org/issue63>
_______________________________________



More information about the Smart mailing list