From 5c00fb24fde023f64fbfb2fca4d4429eac1b9983 Mon Sep 17 00:00:00 2001 From: int 80h Date: Sat, 23 May 2020 17:55:26 -0400 Subject: [PATCH] Fixed bugs in cgi-everywhere --- Cargo.toml | 2 +- src/main.rs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd0a814..882cbc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gemserv" -version = "0.3.1" +version = "0.3.2" authors = ["int 80h "] edition = "2018" diff --git a/src/main.rs b/src/main.rs index 66bac90..ce7664c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -244,10 +244,6 @@ async fn handle_connection( con.send_status(Status::CGIError, None).await?; return Ok(()); } - } else { - logger::logger(con.peer_addr, Status::CGIError, &request); - con.send_status(Status::CGIError, None).await?; - return Ok(()); } }, None => { @@ -259,6 +255,12 @@ async fn handle_connection( } } + if perm.mode() & 0o0111 == 0o0111 { + logger::logger(con.peer_addr, Status::NotFound, &request); + con.send_status(Status::NotFound, None).await?; + return Ok(()); + } + if perm.mode() & 0o0444 != 0o0444 { logger::logger(con.peer_addr, Status::NotFound, &request); con.send_status(Status::NotFound, None).await?;