Merge branch 'master' of github.com:ZoneMinder/zoneminder

This commit is contained in:
Isaac Connor 2020-09-09 12:55:13 -04:00
commit 30e9924601
1 changed files with 8 additions and 2 deletions

View File

@ -50,7 +50,7 @@ bool ValidateAccess(User *user, int mon_id) {
return allowed; return allowed;
} }
int main(int argc, const char *argv[]) { int main(int argc, const char *argv[], char **envp) {
self = argv[0]; self = argv[0];
srand(getpid() * time(nullptr)); srand(getpid() * time(nullptr));
@ -89,6 +89,10 @@ int main(int argc, const char *argv[]) {
zmLoadConfig(); zmLoadConfig();
char log_id_string[32] = "zms"; char log_id_string[32] = "zms";
logInit(log_id_string); logInit(log_id_string);
for (char **env = envp; *env != 0; env++) {
char *thisEnv = *env;
Debug(1, "env: %s", thisEnv);
}
const char *query = getenv("QUERY_STRING"); const char *query = getenv("QUERY_STRING");
if ( query ) { if ( query ) {
@ -204,7 +208,9 @@ int main(int argc, const char *argv[]) {
} }
if ( !user ) { if ( !user ) {
fputs("HTTP/1.0 403 Forbidden\r\n\r\n", stdout); fputs("HTTP/1.0 403 Forbidden\r\n\r\n", stdout);
Error("Unable to authenticate user");
const char *referer = getenv("HTTP_REFERER");
Error("Unable to authenticate user from %s", referer);
logTerm(); logTerm();
zmDbClose(); zmDbClose();
return 0; return 0;