Compare commits

...

2 Commits

Author SHA1 Message Date
hedy f7f6a27898
Fix user CGIs for user vhost requests 2022-03-30 15:38:14 +08:00
hedy 60374d9e70
Add error logging when CGI failed 2022-03-30 15:37:38 +08:00
2 changed files with 3 additions and 0 deletions

View File

@ -26,10 +26,12 @@ func handleCGI(conf *Config, req *Request, cgiPath string) (ok bool) {
info, err := os.Stat(scriptPath)
if err != nil {
log.Println(err.Error())
ok = false
return
}
if !(info.Mode().Perm()&0555 == 0555) {
log.Println("File not executable")
ok = false
return
}

View File

@ -252,6 +252,7 @@ func resolvePath(reqPath string, conf *Config, req *Request) (path string) {
}
if user != "" {
req.filePath = path
path = filepath.Join("/home/", user, conf.UserDir, path)
req.user = user