summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2009-01-11 21:59:47 +0000
committerRoger Leigh <rleigh@debian.org>2009-01-11 21:59:47 +0000
commit066053e98322e8dc349d55b7c214f7ff627dab6c (patch)
tree972fc71775ac8d8ccdb51ad140c535f3bcf3e7e1 /bin
parentd5626e43eb7aaf7f0c1c548960eebaa0273b890c (diff)
downloadschroot-066053e98322e8dc349d55b7c214f7ff627dab6c.tar.gz
[sbuild::session] Don't inherit from sbuild::auth
* sbuild::auth: - Move run to sbuild::session (uses auth, but does not need to be part of it, since it's application-specific). - authenticate is passed status rather than calling get_auth_status; this avoids using signals/slots or derived classes. - get_auth_status: Remove. - is_initialised: New function to check initialisation status. - change_auth: Make static since it doesn't use member data. * sbuild::session: - Don't inherit from sbuild::auth. - Add authstatus member (as a shared_ptr to auth), with corresponding get_auth and set_auth member functions. - All auth methods are called via the authstat object. * schroot/schroot-main-base.cc: Use get_auth to set parameters. * bin/schroot/schroot-main.cc: Use get_auth to set parameters.
Diffstat (limited to 'bin')
-rw-r--r--bin/schroot/schroot-main-base.cc10
-rw-r--r--bin/schroot/schroot-main.cc2
2 files changed, 6 insertions, 6 deletions
diff --git a/bin/schroot/schroot-main-base.cc b/bin/schroot/schroot-main-base.cc
index 076a37ec..12bcfbb7 100644
--- a/bin/schroot/schroot-main-base.cc
+++ b/bin/schroot/schroot-main-base.cc
@@ -265,11 +265,11 @@ main_base::run_impl ()
create_session(sess_op);
if (!this->options->command.empty())
- this->session->set_command(this->options->command);
+ this->session->get_auth()->set_command(this->options->command);
if (!this->options->directory.empty())
- this->session->set_wd(this->options->directory);
+ this->session->get_auth()->set_wd(this->options->directory);
if (this->options->preserve)
- this->session->set_environment(environ);
+ this->session->get_auth()->set_environment(environ);
this->session->set_session_id(this->options->session_name);
this->session->set_force(this->options->session_force);
sbuild::auth::verbosity verbosity = sbuild::auth::VERBOSITY_NORMAL;
@@ -277,7 +277,7 @@ main_base::run_impl ()
verbosity = sbuild::auth::VERBOSITY_QUIET;
else if (this->options->verbose)
verbosity = sbuild::auth::VERBOSITY_VERBOSE;
- this->session->set_verbosity(verbosity);
+ this->session->get_auth()->set_verbosity(verbosity);
/* Set up authentication timeouts. */
std::tr1::shared_ptr<sbuild::auth_conv>
@@ -287,7 +287,7 @@ main_base::run_impl ()
time(&curtime);
conv->set_warning_timeout(curtime + 15);
conv->set_fatal_timeout(curtime + 20);
- this->session->set_conv(conv);
+ this->session->get_auth()->set_conv(conv);
/* Run session. */
this->session->run();
diff --git a/bin/schroot/schroot-main.cc b/bin/schroot/schroot-main.cc
index 054f9ce4..7dd32030 100644
--- a/bin/schroot/schroot-main.cc
+++ b/bin/schroot/schroot-main.cc
@@ -78,5 +78,5 @@ main::create_session(sbuild::session::operation sess_op)
(new sbuild::session("schroot", this->config, sess_op, this->chroots));
if (!this->options->user.empty())
- this->session->set_user(this->options->user);
+ this->session->get_auth()->set_user(this->options->user);
}