  *) SECURITY: CVE-2015-0228 (cve.mitre.org)
     mod_lua: A maliciously crafted websockets PING after a script
     calls r:wsupgrade() can cause a child process crash.
     [Edward Lu <Chaosed0 gmail.com>]

Discovered by Guido Vranken <guidovranken gmail.com>

Submitted by: Edward Lu
Committed by: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1657261 13f79535-47bb-0310-9956-ffa450edef68
static int lua_apr_mkdir(lua_State *L)
{
    request_rec     *r;
    const char      *path;
    apr_status_t    status;
    apr_fileperms_t perms;

    r = ap_lua_check_request_rec(L, 1);
    luaL_checktype(L, 2, LUA_TSTRING);
    path = lua_tostring(L, 2);
    perms = luaL_optinteger(L, 3, APR_OS_DEFAULT);
    status = apr_dir_make(path, perms, r->pool);
    lua_pushboolean(L, (status == 0));
    return 1;
}

static int lua_apr_mkdir(lua_State *L)
{
    request_rec     *r;
    const char      *path;
    apr_status_t    status;
    apr_fileperms_t perms;

    r = ap_lua_check_request_rec(L, 1);
    luaL_checktype(L, 2, LUA_TSTRING);
    path = lua_tostring(L, 2);
    perms = luaL_optinteger(L, 3, APR_OS_DEFAULT);
    status = apr_dir_make(path, perms, r->pool);
    lua_pushboolean(L, (status == 0));
    return 1;
}
