History log of /lighttpd1.4/src/mod_alias.c (Results 1 – 25 of 47)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: lighttpd-1.4.69, lighttpd-1.4.68
# 5e14db43 10-Dec-2022 Glenn Strauss <[email protected]>

[multiple] employ ck_calloc, ck_malloc shared code

employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)


# b82d7b8a 06-Dec-2022 Glenn Strauss <[email protected]>

[multiple] mark mod_*_plugin_init() funcs cold


# 6d9d2cab 16-Oct-2022 Glenn Strauss <[email protected]>

[mod_alias] fix typo in config error message


Revision tags: lighttpd-1.4.67, lighttpd-1.4.66, lighttpd-1.4.65, lighttpd-1.4.64, lighttpd-1.4.63, lighttpd-1.4.62
# 584a69c4 29-Oct-2021 Glenn Strauss <[email protected]>

[mod_alias] fix use-after-free bug (fixes #3114)

(thx LoneFox)

bug introduced in 62a874df in lighttpd 1.4.59

x-ref:
"Use-after-free bug in mod_alias"
https://redmine.lighttpd.net/issues/3114


Revision tags: lighttpd-1.4.61, lighttpd-1.4.60
# af3df29a 09-Jun-2021 Glenn Strauss <[email protected]>

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot co

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.

Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.

In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.

- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend

Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)

internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg

show more ...


# 81ef66ea 15-Mar-2021 Glenn Strauss <[email protected]>

[multiple] buffer_has_slash_suffix()

buffer_has_slash_suffix()
buffer_has_pathsep_suffix()


Revision tags: lighttpd-1.4.59
# 62a874df 17-Jan-2021 Glenn Strauss <[email protected]>

[mod_alias] modify r->physical.path in place

(reduce string copying)

split out func mod_alias_remap() from handler func for unit testing


Revision tags: lighttpd-1.4.58, lighttpd-1.4.57, lighttpd-1.4.56
# c16c6a8f 12-Nov-2020 Glenn Strauss <[email protected]>

[mod_alias] validate given order, not sorted order

(bug on master branch)

x-ref:
"Debian Bullseye/sid arm64 - lighttp broken after update"
https://discussions.flightaware.com/t/debian-bullseye-

[mod_alias] validate given order, not sorted order

(bug on master branch)

x-ref:
"Debian Bullseye/sid arm64 - lighttp broken after update"
https://discussions.flightaware.com/t/debian-bullseye-sid-arm64-lighttp-broken-after-update/70756/20

show more ...


Revision tags: lighttpd-1.4.56-rc7, lighttpd-1.4.56-rc6, lighttpd-1.4.56-rc5, lighttpd-1.4.56-rc4, lighttpd-1.4.56-rc3, lighttpd-1.4.56-rc2, lighttpd-1.4.56-rc1, lighttpd-1.4.55
# 7c7f8c46 13-Jan-2020 Glenn Strauss <[email protected]>

[multiple] split con, request (very large change)

NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access)

NB: request read and write chunkqueues currently point to connection
chun

[multiple] split con, request (very large change)

NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access)

NB: request read and write chunkqueues currently point to connection
chunkqueues; per-request and per-connection chunkqueues are
not distinct from one another
con->read_queue == r->read_queue
con->write_queue == r->write_queue

NB: in the future, a separate connection config may be needed for
connection-level module hooks. Similarly, might need to have
per-request chunkqueues separate from per-connection chunkqueues.
Should probably also have a request_reset() which is distinct from
connection_reset().

show more ...


# cc2134c8 11-Jan-2020 Glenn Strauss <[email protected]>

[multiple] copy small struct instead of memcpy()

when patching config


# 03b4c993 08-Dec-2019 Glenn Strauss <[email protected]>

[multiple] generic config array type checking


# 50bdb55d 26-Nov-2019 Glenn Strauss <[email protected]>

[multiple] connection hooks no longer get (srv *)

(explicit (server *) not passed; available in con->srv)


# b73949e0 19-Nov-2019 Glenn Strauss <[email protected]>

[multiple] plugin.c handles common FREE_FUNC code

(simpler for modules; less boilerplate to cut-n-paste)


# d5782eba 26-Oct-2019 Glenn Strauss <[email protected]>

[mod_alias] use config_plugin_values_init()


# e2de4e58 19-Oct-2019 Glenn Strauss <[email protected]>

[core] const char *name in struct plugin

put void *data (always used) as first member of struct plugin

add int nconfig member to PLUGIN_DATA

calloc() inits p->data to NULL


# 36f64b26 17-Oct-2019 Glenn Strauss <[email protected]>

[core] simpler config_check_cond()

optimize for common case where condition has been evaluated for
the request and a cached result exists

(also: begin isolating data_config)


# e3dc34d1 16-Oct-2019 Glenn Strauss <[email protected]>

[core] array a->sorted[] as ptrs rather than pos

While slightly more memory use in 64-bit (though same memory use as
prior versions of lighttpd), avoids bouncing through second array
when searching

[core] array a->sorted[] as ptrs rather than pos

While slightly more memory use in 64-bit (though same memory use as
prior versions of lighttpd), avoids bouncing through second array
when searching in sorted list. Most use of arrays in lighttpd is to
build a list once, and elements are not removed from the list.

show more ...


# a762402d 14-Oct-2019 Glenn Strauss <[email protected]>

[core] keep a->data[] sorted (REVERT)

This reverts commit 2260a8062ee599ecf28d9b52b981603fd2084aff.

original ordering of array elements is significant
e.g. in lighttpd.conf lists where first match

[core] keep a->data[] sorted (REVERT)

This reverts commit 2260a8062ee599ecf28d9b52b981603fd2084aff.

original ordering of array elements is significant
e.g. in lighttpd.conf lists where first match to request is applied

show more ...


# 601c572c 13-Oct-2019 Glenn Strauss <[email protected]>

[core] inline buffer as part of data_string value

(instead of value being (buffer *))


# 47a758f9 13-Oct-2019 Glenn Strauss <[email protected]>

[core] inline buffer key for *_patch_connection()

handle buffer key as part of DATA_UNSET in *_patch_connection()
(instead of key being (buffer *))


# ad9b7e00 13-Oct-2019 Glenn Strauss <[email protected]>

[core] inline buffer as part of DATA_UNSET key

(instead of key being (buffer *))


# c9f1b612 06-Oct-2019 Glenn Strauss <[email protected]>

[core] keep a->data[] sorted; remove a->sorted[]


Revision tags: lighttpd-1.4.54
# 6a988bb0 27-Feb-2019 Mohammed Sadiq <[email protected]>

[multiple] cleaner calloc use in SETDEFAULTS_FUNC

github: closes #99

x-ref:
"cleaner calloc use in SETDEFAULTS_FUNC"
https://github.com/lighttpd/lighttpd1.4/pull/99


Revision tags: lighttpd-1.4.53, lighttpd-1.4.52, lighttpd-1.4.51
# d61f3381 16-Sep-2018 Glenn Strauss <[email protected]>

[multiple] code reuse: employ array_match_*()


Revision tags: lighttpd-1.4.50
# 2105dae0 01-Jul-2018 Glenn Strauss <[email protected]>

[mod_alias] security: potential path traversal with specific configs

Security: potential path traversal of a single directory above the alias
target with a specific mod_alias config where the alias

[mod_alias] security: potential path traversal with specific configs

Security: potential path traversal of a single directory above the alias
target with a specific mod_alias config where the alias which is matched
does not end in '/', but alias target filesystem path does end in '/'.

e.g. server.docroot = "/srv/www/host/HOSTNAME/docroot"
alias.url = ( "/img" => "/srv/www/hosts/HOSTNAME/images/" )

If a malicious URL "/img../" were passed, the request would be
for directory "/srv/www/hosts/HOSTNAME/images/../" which would resolve
to "/srv/www/hosts/HOSTNAME/". If mod_dirlisting were enabled, which
is not the default, this would result in listing the contents of the
directory above the alias. An attacker might also try to directly
access files anywhere under that path, which is one level above the
intended aliased path.

credit: Orange Tsai(@orange_8361) from DEVCORE

show more ...


12