From ad1b34239cb55db703be9340d01a6138aa29a8df Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Fri, 10 Jul 2020 17:36:36 +0700 Subject: [PATCH] But fix and update to the warning given during user/password checking --- src/gst.rs | 4 ++-- src/main.rs | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gst.rs b/src/gst.rs index 35d5c83..529f90f 100644 --- a/src/gst.rs +++ b/src/gst.rs @@ -50,7 +50,7 @@ impl RtspServer { let factory = RTSPMediaFactory::new(); for permitted_user in permitted_users { - debug!("Permitting {} to access {}", permitted_user, names.join(", ")); + debug!("Permitting {} to access {}", permitted_user, paths.join(", ")); self.add_watcher_role(&factory, &permitted_user) } // During auth, first it binds anonymously. At this point it checks @@ -60,7 +60,7 @@ impl RtspServer { // It loads the auth token of the user and checks that users // RTSP_PERM_MEDIA_FACTORY_CONSTRUCT allowing them to play // As a result of this we must ensure that if anonymous is not granted watcher - // access that anon has at least RTSP_PERM_MEDIA_FACTORY_ACCESS + // access that anon has at least RTSP_PERM_MEDIA_FACTORY_ACCESS if ! permitted_users.contains(&"anonymous".to_string()) { self.add_check_role(&factory, "anonymous"); } diff --git a/src/main.rs b/src/main.rs index c2e45a8..3875364 100644 --- a/src/main.rs +++ b/src/main.rs @@ -165,14 +165,9 @@ fn set_up_users(users: &Vec, rtsp: &RtspServer) { let user_pass = match (name, pass) { (Some(name), Some(pass)) => { Some((&name as &str, &pass as &str)) - } - (Some(name), None) => { - warn!("One of the users has no password, skipping this user"); - debug!("The skipped user was {}", name); - None }, - (None, Some(_pass)) => { - warn!("One of the users has a password but no name, skipping this user"); + (Some(_), None) | (None, Some(_)) => { + warn!("Username and password must be supplied together - ignoring [[users]] entry"); None }, _ => None,