Commit eb1465f6 authored by Marcus Pedersén's avatar Marcus Pedersén
Browse files

Corrected bug where local login was not found

parent 1d489012
......@@ -2,7 +2,7 @@
# It is not intended for manual editing.
[[package]]
name = "add-totp"
version = "1.0.0"
version = "1.0.1"
dependencies = [
"boringauth",
"easy_reader",
......
[package]
name = "add-totp"
version = "1.0.0"
version = "1.0.1"
authors = ["Marcus Pedersén <marcus.pedersen@slu.se>"]
edition = "2018"
license = "GPL-3.0-or-later"
......
No preview for this file type
No preview for this file type
add-totp (1.0.1-2) unstable; urgency=LOW
* Corrected bug where local login was not found
-- Marcus Pedersén <marcus.pedersen@slu.se> Thu, 12 Nov 2020 12:08:14 +0100
add-totp (1.0.0-2) unstable; urgency=LOW
* Corrected configuration for debian packaging
......
......@@ -485,7 +485,6 @@ fn get_login_type(u: &String, c: &Config) -> Result<(LoginType, Ipv4), String> {
Ok(l) => {
if l.is_some() {
let line = l.unwrap();
if line.contains("Accepted") && line.contains(u) {
let mut l_type = LoginType::Unknown;
......@@ -526,7 +525,7 @@ fn get_login_type(u: &String, c: &Config) -> Result<(LoginType, Ipv4), String> {
}
}
// Local login
else if line.contains(format!("session opened for user {} by", u).as_str()) {
else if line.contains(format!("session opened for user {} by", u).as_str()) && login_t.0 != LoginType::Local {
let l_fields: Vec<&str> = line.split_whitespace().collect();
if l_fields.len() == 13 {
login_t = (LoginType::Local, l_fields[0].to_string(), l_fields[1].to_string(), l_fields[2].to_string());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment