diff --git a/PAM/ssh/lib/pam.cpp b/PAM/ssh/lib/pam.cpp index 8e5ab45..a8484ae 100644 --- a/PAM/ssh/lib/pam.cpp +++ b/PAM/ssh/lib/pam.cpp @@ -28,41 +28,9 @@ DLL_PUBLIC int pam_sm_acct_mgmt([[maybe_unused]] pam_handle_t * pamh, return PAM_SUCCESS; } - -std::optional getTag() { - std::ifstream file("/tmp/override_tag"); - if(!file.is_open()) { - return std::nullopt; - } - - std::string line; - if(!std::getline(file, line)) { - return std::nullopt; - } - - std::istringstream iss(line); - int value; - if(!(iss >> value)) { - return std::nullopt; - } - - // Check for any non-numeric trailing characters - char leftover; - if(iss >> leftover) { - return std::nullopt; - } - - return value; -} - DLL_PUBLIC int pam_sm_authenticate(pam_handle_t * pamh, [[maybe_unused]] int flags, [[maybe_unused]] int argc, [[maybe_unused]] const char ** argv) { using namespace rublon; - - if(auto tag = getTag(); tag){ - return tag.value(); - } - details::initLog(); LinuxPam pam{pamh};