works on download script
This commit is contained in:
@@ -181,7 +181,7 @@ void
|
||||
http_body += HTML_BODY_BOTTOM;
|
||||
}
|
||||
|
||||
size_t eval_file_read(const std::string &path)
|
||||
size_t eval_file_access(const std::string &path, int mode)
|
||||
{
|
||||
if (::access(path.c_str(), F_OK) == -1)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ size_t eval_file_read(const std::string &path)
|
||||
return 404; // NOT_FOUND, file doesn't exist
|
||||
}
|
||||
|
||||
if (::access(path.c_str(), R_OK) == -1)
|
||||
if (::access(path.c_str(), mode) == -1)
|
||||
{
|
||||
std::perror("err access()");
|
||||
return 403; // FORBIDDEN, file doesn't have access permission
|
||||
|
||||
Reference in New Issue
Block a user