summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-08-06Merge of r4739: s/ngx_shmtx_destory/ngx_shmtx_destroy/.Maxim Dounin2-4/+4
2012-08-06Merge of r4769: better diagnostics for directives in wrong context.Maxim Dounin2-22/+15
2012-08-06Merge of r4765: reduced the number of preprocessor directives.Maxim Dounin1-5/+1
2012-08-06Merge of r4760, r4761: -Wmissing-prototypes.Maxim Dounin2-0/+5
Fixed compilation with -Wmissing-prototypes. Added a commented out -Wmissing-prototypes to CFLAGS. It is commented out to not break builds with 3rd party modules.
2012-08-06Version bump.Maxim Dounin1-2/+2
2012-07-02Merge of r4690: conflicting wildcard server names fix.Maxim Dounin1-11/+13
With previous code wildcard names were added to hash even if conflict was detected. This resulted in identical names in hash and segfault later in ngx_hash_wildcard_init().
2012-07-02Merge of r4654, r4672, r4684, r4685, r4692: resolver changes.Maxim Dounin1-16/+17
*) Resolver: fixed format specification. Patch by Yichun Zhang (agentzh). *) Support for IPv6 literals and an optional port in resolver. *) Fixed crash in ngx_resolver_cleanup_tree(). If sending a DNS request fails with an error (e.g., when mistakenly trying to send it to a local IP broadcast), such a request is not deleted if there are clients waiting on it. However, it was still erroneously removed from the queue. Later ngx_resolver_cleanup_tree() attempted to remove it from the queue again that resulted in a NULL pointer dereference. *) When "resolver" is configured with a domain name, only the first resolved address was used. Now all addresses will be used. *) Fixed segfault with poll and resolver used. Poll event method needs ngx_cycle->files to work, and use of ngx_exit_cycle without files set caused null pointer dereference in resolver's cleanup on udp socket close.
2012-07-02Merge of r4671: support for IPv6 literals in proxy_pass and so on.Maxim Dounin1-7/+30
2012-07-02Merge of r4653: ngx_inet.c code reduction.Maxim Dounin1-19/+2
Code reduction (no functional changes).
2012-07-02Merge of r4644:Maxim Dounin1-1/+6
Fixed potential null pointer dereference in ngx_resolver_create(). While here, improved error message.
2012-07-02Merge of r4643:Maxim Dounin1-5/+0
Removed historical and now redundant syntax pre-checks in ngx_parse_url().
2012-06-29Merge of r4639, r4640: C++ fixes.Maxim Dounin2-5/+5
Fixed the ngx_regex.h header file compatibility with C++. Fixed building --with-cpp_test_module on some systems.
2012-06-25Version bump.Maxim Dounin1-2/+2
2012-06-04Merge of r4611, r4620: resolver fixes.Maxim Dounin1-2/+14
*) Fixed segmentation fault in ngx_resolver_create_name_query(). If name passed for resolution was { 0, NULL } (e.g. as a result of name server returning CNAME pointing to ".") pointer wrapped to (void *) -1 resulting in segmentation fault on an attempt to dereference it. Reported by Lanshun Zhou. *) Resolver: protection from duplicate responses. If we already had CNAME in resolver node (i.e. rn->cnlen and rn->u.cname set), and got additional response with A record, it resulted in rn->cnlen set and rn->u.cname overwritten by rn->u.addr (or rn->u.addrs), causing segmentation fault later in ngx_resolver_free_node() on an attempt to free overwritten rn->u.cname. The opposite (i.e. CNAME got after A) might cause similar problems as well.
2012-06-04Version bump.Maxim Dounin1-2/+2
2012-04-23Version bump.Maxim Dounin1-2/+2
2012-04-23Fix of "%f" format handling.Igor Sysoev1-16/+19
ngx_sprintf("%.2f", 0.999) incorrectly resulted in "0.100" instead of "1.00".
2012-04-18Don't silently ignore the last line of configuration file thatRuslan Ermilov1-1/+1
consists solely of one unterminated token (inspired by #150).
2012-04-12Fixed grammar in error messages.Ruslan Ermilov2-2/+3
2012-04-12Version bump.Maxim Dounin1-2/+2
2012-04-12Reduced the number of lines of code in ngx_inet_addr().Ruslan Ermilov1-5/+1
2012-04-11Improved readability of the code that produces bitmask from prefix.Ruslan Ermilov1-2/+2
In collaboration with Maxim Dounin.
2012-04-06Fixed signed integer overflows in timer code (ticket #145).Maxim Dounin1-2/+1
Integer overflow is undefined behaviour in C and this indeed caused problems on Solaris/SPARC (at least in some cases). Fix is to subtract unsigned integers instead, and then cast result to a signed one, which is implementation-defined behaviour and used to work. Strictly speaking, we should compare (unsigned) result with the maximum value of the corresponding signed integer type instead, this will be defined behaviour. This will require much more changes though, and considered to be overkill for now.
2012-04-05Comment fixed.Andrey Belov1-1/+1
2012-04-03In ngx_ptocidr(), check that the supplied prefix length is withinRuslan Ermilov1-0/+7
the allowed range.
2012-04-03Fixed spelling in multiline C comments.Ruslan Ermilov5-6/+6
2012-04-02Version bump.Maxim Dounin1-2/+2
2012-03-22Resolver: added missing sanity checking when creating name queries.Maxim Dounin1-1/+5
Found by Veracode.
2012-03-21worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.Ruslan Ermilov2-11/+11
2012-03-15Version bump.Maxim Dounin1-2/+2
2012-03-05Whitespace fixes.Maxim Dounin1-1/+1
2012-03-05Version bump.Maxim Dounin1-2/+2
2012-02-28Fixed spelling in single-line comments.Ruslan Ermilov1-1/+1
2012-02-27Fix of rbtree lookup on hash collisions.Maxim Dounin2-22/+12
Previous code incorrectly assumed that nodes with identical keys are linked together. This might not be true after tree rebalance. Patch by Lanshun Zhou.
2012-02-27Fixed null pointer dereference in resolver (ticket #91).Maxim Dounin1-5/+6
The cycle->new_log.file may not be set before config parsing finished if there are no error_log directive defined at global level. Fix is to copy it after config parsing. Patch by Roman Arutyunyan.
2012-02-27Disable symlinks: added the "from" parameter support to the open file cache.Valentin Bartenev2-1/+26
2012-02-21Disable symlinks: use O_SEARCH|O_DIRECTORY to open path components.Valentin Bartenev1-30/+14
2012-02-21Disable symlinks: don't allow creating or truncating a file via a symlink inValentin Bartenev1-1/+3
the last path component if "if_not_owner" parameter is used. To prevent race condition we have to open a file before checking its owner and there's no way to change access flags for already opened file descriptor, so we disable symlinks for the last path component at all if flags allow creating or truncating the file.
2012-02-21Disable symlinks: cleanups once again.Valentin Bartenev1-8/+10
In collaboration with Ruslan Ermilov.
2012-02-20Disable symlinks: added explicit cast of AT_FDCWD (ticket #111).Maxim Dounin1-4/+4
Solaris has AT_FDCWD defined to unsigned value, and comparison of a file descriptor with it causes warnings in modern versions of gcc. Explicitly cast AT_FDCWD to ngx_fd_t to resolve these warnings.
2012-02-20Disable symlinks: error handling cleanup again.Maxim Dounin1-4/+4
2012-02-20Version bump.Maxim Dounin1-2/+2
2012-02-15Disable symlinks: fixed edge cases of path handling.Maxim Dounin1-14/+60
This includes non-absolute pathnames, multiple slashes and trailing slashes. In collaboration with Valentin Bartenev.
2012-02-15Disable symlinks: cleanup error handling.Maxim Dounin1-41/+70
Notably this fixes NGX_INVALID_FILE/NGX_FILE_ERROR mess, and adds logging of close() errors. In collaboration with Valentin Bartenev.
2012-02-13Added disable_symlinks directive.Andrey Belov3-24/+255
To completely disable symlinks (disable_symlinks on) we use openat(O_NOFOLLOW) for each path component to avoid races. To allow symlinks with the same owner (disable_symlinks if_not_owner), use openat() (followed by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW), and then compare uids between fstat() and fstatat(). As there is a race between openat() and fstatat() we don't know if openat() in fact opened symlink or not. Therefore, we have to compare uids even if fstatat() reports the opened component isn't a symlink (as we don't know whether it was symlink during openat() or not). Default value is off, i.e. symlinks are allowed.
2012-02-13Changed ngx_open_and_stat_file() to use ngx_str_t.Andrey Belov1-19/+20
No functional changes.
2012-02-13Time parsing cleanup.Maxim Dounin3-13/+2
Nuke NGX_PARSE_LARGE_TIME, it's not used since 0.6.30. The only error ngx_parse_time() can currently return is NGX_ERROR, check it explicitly and make sure to cast it to appropriate type (either time_t or ngx_msec_t) to avoid signedness warnings on platforms with unsigned time_t (notably QNX).
2012-02-09Version bump.Maxim Dounin1-2/+2
2012-01-30Fixed memory leak on HUP signal when PCRE JIT was used.Valentin Bartenev1-1/+54
The PCRE JIT compiler uses mmap to allocate memory for its executable codes, so we have to explicitly call the pcre_free_study() function to free this memory.
2012-01-24Fixed grammar in PCRE JIT error log message.Valentin Bartenev1-1/+1