|
librostlab
1.0.20
|
00001 /* 00002 Copyright (C) 2011 Laszlo Kajan, Technical University of Munich, Germany 00003 00004 This file is part of librostlab. 00005 00006 librostlab is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 #ifndef ROSTLAB_CXXPWD 00020 #define ROSTLAB_CXXPWD 1 00021 00022 #include <pwd.h> 00023 #include <string> 00024 #include <sys/types.h> 00025 00026 #include <rostlab/rostlab_stdexcept.h> 00027 00028 namespace bo = boost; 00029 00030 namespace rostlab { 00031 00032 struct cxx_passwd 00033 { 00034 std::string pw_name; /* username */ 00035 std::string pw_passwd; /* user password */ 00036 uid_t pw_uid; /* user ID */ 00037 gid_t pw_gid; /* group ID */ 00038 std::string pw_gecos; /* real name */ 00039 std::string pw_dir; /* home directory */ 00040 std::string pw_shell; /* shell program */ 00041 00042 inline cxx_passwd(){}; 00043 inline cxx_passwd( const std::string& __pw_name, const std::string& __pw_passwd, uid_t __pw_uid, gid_t __pw_gid, const std::string& __pw_gecos, const std::string& __pw_dir, const std::string& __pw_shell ) : 00044 pw_name(__pw_name), pw_passwd(__pw_passwd), pw_uid(__pw_uid), pw_gid(__pw_gid), pw_gecos(__pw_gecos), pw_dir(__pw_dir), pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public:pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 class uid_not_found_error : public runtime_error { public: uid_not_found_error( const std::string& what ) : runtime_error(what) {} }; 00048untime__error.html">runtime_error { public: pw_shell(__pw_shell) {}; 00045 }; 00046 00047 c