Project

General

Profile

Actions

Bug #2835

closed

empty var.CWD

Added by mbeniamino over 6 years ago. Updated over 6 years ago.

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

Description

A recent update broke a certain instance of lighttpd I was using for local development with the error:

2017-10-27 10:09:55: (configfile.c.1470) a default document-root has to be set
2017-10-27 10:09:55: (server.c.1218) setting default values failed

I traced back the cause to the fact that now var.CWD is the empty string:

[mbeniamino@mbeniamino4 ~]$ lighttpd -f /dev/null -p
config {
    var.PID = 7703
    var.CWD = "" 

}

I don't think this is the intended behaviour, is it?

lighttpd version: lighttpd/1.4.47
OS: ArchLinux

Actions #1

Updated by gstrauss over 6 years ago

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

Broke in 86bb8be2c
Thanks for reporting. This fixes it:

--- a/src/configfile.c
+++ b/src/configfile.c
@@ -1355,7 +1355,7 @@ int config_read(server *srv, const char *fn) {
        dcwd = data_string_init();
        buffer_string_prepare_copy(dcwd->value, 1023);
        if (NULL != getcwd(dcwd->value->ptr, dcwd->value->size - 1)) {
-               buffer_commit(dcwd->value, buffer_string_length(dcwd->value));
+               buffer_commit(dcwd->value, strlen(dcwd->value->ptr));
                buffer_copy_string_len(dcwd->key, CONST_STR_LEN("var.CWD"));
                array_insert_unique(dc->value, (data_unset *)dcwd);
        } else {

Actions #2

Updated by gstrauss over 6 years ago

  • Category set to core
Actions #3

Updated by gstrauss over 6 years ago

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

Also available in: Atom