mirror of
https://github.com/sigmasternchen/CFloor
synced 2025-03-15 12:28:53 +00:00
fixed ../ bug
This commit is contained in:
parent
16a21a2f30
commit
0d56b113e1
3 changed files with 3 additions and 6 deletions
|
@ -232,11 +232,10 @@ int headers_metadata(struct metaData* metaData, char* header) {
|
|||
else
|
||||
return HEADERS_PARSE_ERROR;
|
||||
|
||||
char* path = malloc(strlen(_path) + 1);
|
||||
char* path = symbolicRealpath(_path);
|
||||
if (path == NULL) {
|
||||
return HEADERS_ALLOC_ERROR;
|
||||
}
|
||||
strcpy(path, _path);
|
||||
char* queryString = malloc(strlen(_queryString) + 1);
|
||||
if (queryString == NULL) {
|
||||
free(path);
|
||||
|
|
|
@ -19,6 +19,8 @@ struct handlerSettings {
|
|||
struct handler handlerGetter(struct metaData metaData, const char* host, struct bind* bind) {
|
||||
struct handlerSettings* settings = (struct handlerSettings*) bind->settings.ptr;
|
||||
|
||||
info("%s", metaData.path);
|
||||
|
||||
union userData data;
|
||||
|
||||
if (isInDir(metaData.path, settings->cgiBin)) {
|
||||
|
|
|
@ -109,10 +109,6 @@ char* symbolicRealpath(const char* file) {
|
|||
int isInDir(const char* file, const char* dir) {
|
||||
int length = strlen(dir);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (dir[length - 1] == '/')
|
||||
length--;
|
||||
|
||||
|
|
Loading…
Reference in a new issue