Bug 146650 - RFE: enhance chroot-installation
RFE: enhance chroot-installation
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2005-01-31 09:50 EST by Enrico Scholz
Modified: 2014-01-21 17:51 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-21 15:24:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Allows to specify (non-)chroot relative paths with 'hostfs://' resp. 'chrootfs://' prefixes (4.50 KB, patch)
2005-02-25 14:23 EST, Enrico Scholz
no flags Details | Diff
Patch for yum-2.3.2 (7.65 KB, patch)
2005-04-10 08:24 EDT, Enrico Scholz
no flags Details | Diff
patch for yum-2.2.1 (7.26 KB, patch)
2005-04-10 08:25 EDT, Enrico Scholz
no flags Details | Diff
patch against yum-2.3.3 (7.51 KB, patch)
2005-06-18 15:59 EDT, Enrico Scholz
no flags Details | Diff
patch against yum-2.3.4 (7.46 KB, patch)
2005-07-10 13:25 EDT, Enrico Scholz
no flags Details | Diff
patch against yum-2.6.0 (7.29 KB, patch)
2006-03-26 06:26 EST, Enrico Scholz
no flags Details | Diff

  None (edit)
Description Enrico Scholz 2005-01-31 09:50:33 EST
Description of problem:

Some ideas how to enhance the '--installroot' mode:

* let override '$releasever' directly; this allows to use the
  same yum.repos.d directory for both the host and the guest

* allow to specify that 'cachedir', 'reposdir' and 'logfile' are located
  outside of the chroot. Currently, some magic is used to test where
  this directories are located.  This causes both an undeterministic and
  an insecure behaviour. E.g. an attacker withing the chroot could make
  /var/cache/yum a symlink into the host and cause fileremovals there.

  Shareing a 'cachedir' between several guests could save diskspace
  and network traffic also.

* it would be nice when the paths mentioned above could be overridden on
  the CLI. So the same configuration could be used for all guestsystems.

Version-Release number of selected component (if applicable):

Comment 1 Enrico Scholz 2005-02-25 14:23:24 EST
Created attachment 111435 [details]
Allows to specify (non-)chroot relative paths with 'hostfs://' resp. 'chrootfs://' prefixes

This patch solves the second point by introducing two new prefixes for
pathnames. When not used, the current behavior will not be changed.
Comment 2 Warren Togami 2005-03-24 21:22:13 EST
Any comments Seth?
Comment 3 Seth Vidal 2005-03-24 21:46:39 EST
adding non-real protocols to the relative paths is not going to happen in yum.
1. it adds unnecessary complexity
2. it'll be a bitch to maintain forever, esp when someone gets the wise idea of
actually having a hostfs:// or chrootfs:// protocol
3. it's a pretty narrow requirement
4. it's a lot more easily solved with the plugin infrastructure that's being
worked on in yum now, so that if YOU want to maintain stuff like this in your
own plugins, then YOU can, but I'm not going to.
Comment 4 Enrico Scholz 2005-03-24 22:31:45 EST
When speaking about complexity: you can remove complexity by removing the magic
which guesses the final paths. When you want files in the chroot, then specify
the path within the chroot. The complexity in my patch was required to remove
this complexity. When you do not want protocol specifiers, then use a trampfs style 

/[hostfs]/ resp. /[chrootfs]/

or use relative paths to guess the final destination.
Comment 5 Enrico Scholz 2005-04-10 08:24:20 EDT
Created attachment 112920 [details]
Patch for yum-2.3.2

Attached is an updated version for yum-2.3.2. This applies the same
changes for the lockfile also which is made configurable. Now, the
main configuration file is searched in chroot only, when it was not
specified on the CLI explicitly.

I do not see how the current plugin system would solve the problem of
the magic detection of configuration files. AFAIS, the hooks are called
much too late so they can not modify the internal configuration values.

Perhaps the getRootedPath() method should be implemented by plugins?
Comment 6 Enrico Scholz 2005-04-10 08:25:19 EDT
Created attachment 112921 [details]
patch for yum-2.2.1
Comment 7 Enrico Scholz 2005-06-18 15:59:41 EDT
Created attachment 115657 [details]
patch against yum-2.3.3
Comment 8 Enrico Scholz 2005-07-10 13:25:55 EDT
Created attachment 116574 [details]
patch against yum-2.3.4
Comment 9 Rahul Sundaram 2005-08-27 16:06:10 EDT
Enrico Scholz,

Look at implementing this as yum plugin. There is a seperate package of them
called yum-utils in the Fedora Extras repository now. Seth Vidal has already
commented that it has a better chance of being implemented as a plugin and not
in yum itself. Closing this one
Comment 10 Enrico Scholz 2005-08-27 16:19:10 EDT
see comment #5; my patch begins to work before any configuration will be read
(e.g. it determines the location of 'yum.conf'). The brokeness which is fixed by
my patch is caused by redundant code in the yum codebase which is spread across
several places. So I really do not see how to make it a yum plugin.

Btw; last patch applies to yum-2.4.0 also.
Comment 11 Rahul Sundaram 2005-08-27 16:28:33 EDT
Does this patch provide a bug fix or does it add a enhancement?. If you are
providing a patch to fix bugs there is no need to combine them with something
that adds additional functionality. The enhancement to provide chroot
functionality can still be a yum plugin. 
Comment 12 Enrico Scholz 2005-08-27 16:34:17 EDT
Yes, it fixes a bug. 'yum' has an undefined behavior when it used for chroot
operations: sometimes it reads information from the chroot, sometimes from the
host. This can be a security risk e.g. when used in combination with vservers.

There is no new functionality provided by the patch.

Comment 13 Jeremy Katz 2005-09-21 15:24:53 EDT
I'm not taking this patch as a Fedora specific change.  I'm not convinced that
it's really needed and I do a fair bit with yum in chroots.
Comment 14 Enrico Scholz 2006-03-26 06:26:30 EST
Created attachment 126765 [details]
patch against yum-2.6.0

Note You need to log in before you can comment on or make changes to this bug.