mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
We are shaking up trunk tonight! allow data dir to be specified (issue #6967 reported by tzafrir)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
4
http.c
4
http.c
@@ -125,12 +125,12 @@ static char *static_callback(struct sockaddr_in *req, const char *uri, struct as
|
||||
mtype=ftype2mtype(ftype, wkspace, sizeof(wkspace));
|
||||
|
||||
/* Cap maximum length */
|
||||
len = strlen(uri) + strlen(ast_config_AST_VAR_DIR) + strlen("/static-http/") + 5;
|
||||
len = strlen(uri) + strlen(ast_config_AST_DATA_DIR) + strlen("/static-http/") + 5;
|
||||
if (len > 1024)
|
||||
goto out403;
|
||||
|
||||
path = alloca(len);
|
||||
sprintf(path, "%s/static-http/%s", ast_config_AST_VAR_DIR, uri);
|
||||
sprintf(path, "%s/static-http/%s", ast_config_AST_DATA_DIR, uri);
|
||||
if (stat(path, &st))
|
||||
goto out404;
|
||||
if (S_ISDIR(st.st_mode))
|
||||
|
||||
Reference in New Issue
Block a user