Project

General

Profile

Actions

Bug #2877

closed

lighty.stat failure

Added by zeroval about 6 years ago. Updated about 6 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_magnet
Target version:
ASK QUESTIONS IN Forums:

Description

I just upgraded to lighttpd 1.4.49 on Arch, and I started having this issue.

The issue is that `lighty.stat` causes my scripts to crash or otherwise stop executing.

I've tried, but I've had no luck getting a relevant backtrace. I'll continue working on it.

I can easily reproduce the issue by adding `lighty.stat('/an/invalid/path')` to any `mod_magnet` script and navigating to a relevant path in my browser.


Files

drupal.conf (118 Bytes) drupal.conf relevant configuration zeroval, 2018-03-16 06:11
drupal.lua (507 Bytes) drupal.lua relevant script zeroval, 2018-03-16 06:11
lighttpd.conf (3.79 KB) lighttpd.conf zeroval, 2018-03-16 06:11
Actions #1

Updated by gstrauss about 6 years ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.50

Yes, that's a regression from 1.4.48. :( Looks like it was introduced in commit b1df38ab

This may fix it. I'll have time to test later this evening:

--- a/src/mod_magnet.c
+++ b/src/mod_magnet.c
@@ -334,14 +334,16 @@ static int magnet_stat(lua_State *L) {
        handler_t res;

        res = stat_cache_get_entry(srv, con, sb, &sce);
-       stat_cache_content_type_get(srv, con, sb, sce);
-       buffer_free(sb);

        if (HANDLER_GO_ON != res) {
+               buffer_free(sb);
                lua_pushnil(L);
                return 1;
        }

+       stat_cache_content_type_get(srv, con, sb, sce);
+       buffer_free(sb);
+
        lua_newtable(L); // return value

        lua_pushboolean(L, S_ISREG(sce->st.st_mode));

Actions #2

Updated by zeroval about 6 years ago

I've tried your patch, and it seems to have worked.

Actions #3

Updated by gstrauss about 6 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom