Revert "Add experimental tag overwrite for tests in veritas"
This reverts commit 3e57a78cae.
This commit is contained in:
parent
3e57a78cae
commit
0617c3225f
@ -28,41 +28,9 @@ DLL_PUBLIC int pam_sm_acct_mgmt([[maybe_unused]] pam_handle_t * pamh,
|
||||
return PAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
std::optional<int> 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};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user