00001 /* Copyright © 2005-2007 Roger Leigh <rleigh@debian.org> 00002 * 00003 * schroot is free software: you can redistribute it and/or modify it 00004 * under the terms of the GNU General Public License as published by 00005 * the Free Software Foundation, either version 3 of the License, or 00006 * (at your option) any later version. 00007 * 00008 * schroot is distributed in the hope that it will be useful, but 00009 * WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program. If not, see 00015 * <http://www.gnu.org/licenses/>. 00016 * 00017 *********************************************************************/ 00018 00019 #ifndef SBUILD_AUTH_PAM_CONV_H 00020 #define SBUILD_AUTH_PAM_CONV_H 00021 00022 #include <sbuild/sbuild-auth-pam-message.h> 00023 #include <sbuild/sbuild-error.h> 00024 #include <sbuild/sbuild-tr1types.h> 00025 00026 #include <vector> 00027 00028 #include <security/pam_appl.h> 00029 00030 namespace sbuild 00031 { 00032 00033 class auth_pam; 00034 00057 class auth_pam_conv 00058 { 00059 public: 00061 typedef std::vector<auth_pam_message> message_list; 00062 typedef std::tr1::shared_ptr<auth_pam> auth_ptr; 00063 typedef std::tr1::weak_ptr<auth_pam> weak_auth_ptr; 00064 00066 typedef std::tr1::shared_ptr<auth_pam_conv> ptr; 00067 00068 protected: 00070 auth_pam_conv (); 00071 00072 public: 00074 virtual ~auth_pam_conv (); 00075 00081 virtual auth_ptr 00082 get_auth () = 0; 00083 00089 virtual void 00090 set_auth (auth_ptr auth) = 0; 00091 00097 virtual time_t 00098 get_warning_timeout () = 0; 00099 00105 virtual void 00106 set_warning_timeout (time_t timeout) = 0; 00107 00114 virtual time_t 00115 get_fatal_timeout () = 0; 00116 00123 virtual void 00124 set_fatal_timeout (time_t timeout) = 0; 00125 00140 virtual void 00141 conversation (message_list& messages) = 0; 00142 }; 00143 00144 } 00145 00146 #endif /* SBUILD_AUTH_PAM_CONV_H */ 00147 00148 /* 00149 * Local Variables: 00150 * mode:C++ 00151 * End: 00152 */