source: trunk/debathena/third/schroot/bin/dchroot-dsa/dchroot-dsa-session.h @ 24167

Revision 24167, 2.5 KB checked in by broder, 15 years ago (diff)
Import schroot upstream into subversion.
Line 
1/* Copyright © 2005-2007  Roger Leigh <rleigh@debian.org>
2 *
3 * schroot is free software: you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * schroot is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program.  If not, see
15 * <http://www.gnu.org/licenses/>.
16 *
17 *********************************************************************/
18
19#ifndef DCHROOT_DSA_SESSION_H
20#define DCHROOT_DSA_SESSION_H
21
22#include <dchroot/dchroot-session-base.h>
23
24namespace dchroot_dsa
25{
26
27  /**
28   * Session handler for dchroot-dsa sessions.
29   *
30   * This class provides the session handling for dchroot-dsa
31   * compatibility.  It overrides the normal authentication checks to
32   * allow all users to access the service, but enforce dchroot-dsa
33   * user access controls when present, and it specialises the session
34   * behaviour to be compatible with the chdir and command execution
35   * behaviour of dchroot-dsa.
36   */
37  class session : public dchroot::session_base
38  {
39  public:
40    /**
41     * The constructor.
42     *
43     * @param service the PAM service name.
44     * @param config a shared_ptr to the chroot configuration.
45     * @param operation the session operation to perform.
46     * @param chroots the chroots to act upon.
47     * @param compat true to enable full dchroot compatibility, or
48     * false to enable schroot compatiblity (permissions checks).
49     */
50    session (std::string const&         service,
51             config_ptr&                config,
52             operation                  operation,
53             sbuild::string_list const& chroots,
54             bool                       compat);
55
56    /// The destructor.
57    virtual ~session ();
58
59    virtual sbuild::auth::status
60    get_chroot_auth_status (sbuild::auth::status status,
61                            sbuild::chroot::ptr const& chroot) const;
62
63    virtual sbuild::string_list
64    get_login_directories () const;
65
66    virtual void
67    get_user_command (sbuild::chroot::ptr& session_chroot,
68                      std::string&         file,
69                      sbuild::string_list& command) const;
70  };
71
72}
73
74#endif /* DCHROOT_DSA_SESSION_H */
75
76/*
77 * Local Variables:
78 * mode:C++
79 * End:
80 */
Note: See TracBrowser for help on using the repository browser.