X-Git-Url: http://dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=src%2Fdirplex%2Fdirplex.c;h=73bb9ccd4d8514a544075a920760502836a48bbf;hp=65f09f715209c948f1fe723560e53501c246b8a2;hb=539c7b9f70c856a6451685e405b3a6c870d34ee4;hpb=22aad619ffc2cf4b9532f1fbb19a4bbee2d07c11 diff --git a/src/dirplex/dirplex.c b/src/dirplex/dirplex.c index 65f09f7..73bb9cc 100644 --- a/src/dirplex/dirplex.c +++ b/src/dirplex/dirplex.c @@ -249,9 +249,11 @@ static int checkentry(struct hthead *req, int fd, char *path, char *rest, char * static int checkdir(struct hthead *req, int fd, char *path, char *rest) { - char *cpath; + char *cpath, *newpath; struct config *cf, *ccf; struct child *ch; + struct stat sb; + int rv; cf = getconfig(path); if((cf->capture != NULL) && (cf->caproot || !cf->path || strcmp(cf->path, "."))) { @@ -270,6 +272,22 @@ static int checkdir(struct hthead *req, int fd, char *path, char *rest) childerror(req, fd); return(1); } + if(cf->reparse != NULL) { + newpath = (cf->reparse[0] == '/')?sstrdup(cf->reparse):sprintf2("%s/%s", path, cf->reparse); + rv = stat(newpath, &sb); + if(!rv && S_ISDIR(sb.st_mode)) { + rv = checkpath(req, fd, newpath, rest, !cf->parsecomb); + } else if(!rv && S_ISREG(sb.st_mode)) { + replrest(req, rest); + handlefile(req, fd, newpath); + rv = 1; + } else { + rv = !cf->parsecomb; + } + free(newpath); + if(rv) + return(rv); + } return(0); }