diff options
author | Roger Leigh <rleigh@debian.org> | 2010-07-11 00:46:36 +0100 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2010-07-11 21:01:03 +0100 |
commit | 8c326637b963a1c71fc3fdcd60d75d97ef69fe38 (patch) | |
tree | c1a1b945fbecf866f52a83f71678627806122dee /bin | |
parent | 6faf4172f05cb57a914a59dec33b2c89d06f404a (diff) | |
download | schroot-8c326637b963a1c71fc3fdcd60d75d97ef69fe38.tar.gz |
sbuild::chroot_config: validate canonicalises namespace
This means all chroot names in use have a valid namespace.
schroot can use the session namespace for searching when
running sessions etc.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/schroot/schroot-main-base.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/schroot/schroot-main-base.cc b/bin/schroot/schroot-main-base.cc index 94a937dc..ea1610ef 100644 --- a/bin/schroot/schroot-main-base.cc +++ b/bin/schroot/schroot-main-base.cc @@ -175,8 +175,15 @@ main_base::get_chroot_options () } else { + // Search in the appropriate namespace. + std::string chroot_namespace("chroot"); + if (this->options->action == options_base::ACTION_SESSION_RECOVER || + this->options->action == options_base::ACTION_SESSION_RUN || + this->options->action == options_base::ACTION_SESSION_END) + chroot_namespace = "session"; + sbuild::string_list invalid_chroots = - this->config->validate_chroots(this->options->chroots); + this->config->validate_chroots(chroot_namespace, this->options->chroots); if (!invalid_chroots.empty()) { |