aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_open_file_cache.c
Commit message (Collapse)AuthorAge
* Fixed logging in close error handling.Sergey Kandaurov2016-03-31
|
* Fixed typo in the error message.Andrei Belov2015-08-11
|
* Disable symlinks: removed recursive call of ngx_file_o_path_info().Valentin Bartenev2013-09-02
| | | | It is surplus.
* Disable symlinks: use O_PATH to open path components.Valentin Bartenev2013-09-02
| | | | | | | | | | | | | | | | | It was introduced in Linux 2.6.39, glibc 2.14 and allows to obtain file descriptors without actually opening files. Thus made it possible to traverse path with openat() syscalls without the need to have read permissions for path components. It is effectively emulates O_SEARCH which is missing on Linux. O_PATH is used in combination with O_RDONLY. The last one is ignored if O_PATH is used, but it allows nginx to not fail when it was built on modern system (i.e. glibc 2.14+) and run with a kernel older than 2.6.39. Then O_PATH is unknown to the kernel and ignored, while O_RDONLY is used. Sadly, fstat() is not working with O_PATH descriptors till Linux 3.6. As a workaround we fallback to fstatat() with the AT_EMPTY_PATH flag that was introduced at the same time as O_PATH.
* Format specifier fixes in error logging.Sergey Kandaurov2013-08-20
|
* Fix of rbtree lookup on hash collisions.Maxim Dounin2012-02-27
| | | | | | | Previous code incorrectly assumed that nodes with identical keys are linked together. This might not be true after tree rebalance. Patch by Lanshun Zhou.
* Disable symlinks: added the "from" parameter support to the open file cache.Valentin Bartenev2012-02-27
|
* Disable symlinks: use O_SEARCH|O_DIRECTORY to open path components.Valentin Bartenev2012-02-21
|
* Disable symlinks: don't allow creating or truncating a file via a symlink inValentin Bartenev2012-02-21
| | | | | | | | | 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.
* Disable symlinks: cleanups once again.Valentin Bartenev2012-02-21
| | | | In collaboration with Ruslan Ermilov.
* Disable symlinks: added explicit cast of AT_FDCWD (ticket #111).Maxim Dounin2012-02-20
| | | | | | 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.
* Disable symlinks: error handling cleanup again.Maxim Dounin2012-02-20
|
* Disable symlinks: fixed edge cases of path handling.Maxim Dounin2012-02-15
| | | | | This includes non-absolute pathnames, multiple slashes and trailing slashes. In collaboration with Valentin Bartenev.
* Disable symlinks: cleanup error handling.Maxim Dounin2012-02-15
| | | | | Notably this fixes NGX_INVALID_FILE/NGX_FILE_ERROR mess, and adds logging of close() errors. In collaboration with Valentin Bartenev.
* Added disable_symlinks directive.Andrey Belov2012-02-13
| | | | | | | | | | | | | | | | | | 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.
* Changed ngx_open_and_stat_file() to use ngx_str_t.Andrey Belov2012-02-13
| | | | No functional changes.
* Copyright updated.Maxim Konovalov2012-01-18
|
* Fix of the previous commit: is_directio flag processing introduced in r4077Igor Sysoev2011-09-14
| | | | is still worthwhile.
* Bugfix: open_file_cache did not update file info on retest.Igor Sysoev2011-09-14
| | | | | | | | | If file inode was not changed, cached file information was not updated on retest. As a result stale information might be cached forever if file attributes was changed and/or file was extended. This fix also makes obsolete r4077 change of is_directio flag handling, since this flag is updated together with other file information.
* Bugfix: open_file_cache lost is_directio flag.Maxim Dounin2011-09-05
| | | | | | On file retest open_file_cache lost is_directio if file wasn't changed. This caused unaligned operations under Linux to fail with EINVAL. It wasn't noticeable with AIO though, as errors wasn't properly logged.
* Use more precise stat.st_blocks to account cache size on UnixIgor Sysoev2011-04-22
| | | | | instead of file length rounded to a file system block size. There is no similar way on Windows, so rounding to a cache->bsize is kept.
* use non-blocking open() not to hang on FIFO files, etc.Igor Sysoev2010-04-21
|
* read_aheadIgor Sysoev2009-09-30
|
* uniform ngx_directio_on/off() interface with other file functionsIgor Sysoev2009-09-25
|
* initialize use_event field in open file cacheIgor Sysoev2009-06-12
| | | | the bug had been introduced in r2071
* set of.failed for cached error, the bug has been introduced in r2757Igor Sysoev2009-04-30
|
* uniform ngx_file_info() interface with ngx_fd_info()Igor Sysoev2009-04-29
|
* *) of.test_only to not open file if only stat() is enoughIgor Sysoev2009-04-27
| | | | *) of.failed to return exact name of failed syscall
* Win32 appends synchronized if only FILE_APPEND_DATA and SYNCHRONIZE are setIgor Sysoev2009-03-31
| | | | | without any other flags. On the other hand, Unix requires at least the write flag to be set together with O_APPEND.
* win32 ngx_open_file() supports utf8 names and NGX_FILE_APPENDIgor Sysoev2009-03-30
|
* test ngx_file_info() result, the bug has been introduced in r2070Igor Sysoev2009-01-21
|
* cache directio flag in open file cacheIgor Sysoev2008-09-12
|
* *) handle unaligned file part for directioIgor Sysoev2008-09-05
| | | | *) disable sendfile in directio mode
* directioIgor Sysoev2008-07-30
|
* variables in access_logIgor Sysoev2008-06-30
|
* fix commentIgor Sysoev2008-06-30
|
* fix the previous commitIgor Sysoev2008-06-30
|
* use ngx_file_info() and test uniq if file is already openIgor Sysoev2008-06-26
|
* initialize of.uniq in ngx_open_cached_file()Igor Sysoev2008-06-23
|
* style fix: remove tabs and trailing spacesIgor Sysoev2008-05-14
|
* fix segfault when file is deleted and open_file_cache_errors is offIgor Sysoev2008-04-29
|
* back out the previous commitIgor Sysoev2008-04-29
|
* fix segfault when file is deleted and open_file_cache_errors is offIgor Sysoev2008-04-29
|
* fix the previous commitIgor Sysoev2008-03-13
|
* fix case when errors are not cached,Igor Sysoev2008-03-13
| | | | | and a file was not used often enough to keep open and it has been removed before it was kept open
* axe useless codeIgor Sysoev2008-03-13
|
* several fixes:Igor Sysoev2007-12-25
| | | | | | *) do not add event if file was used less than min_uses *) do not rely upon event to avoid race conditions *) ngx_open_file_lookup()
* open_file_cache_min_usesIgor Sysoev2007-12-22
|
* open_file_cache_retest > open_file_cache_validIgor Sysoev2007-12-21
|
* fix the previous commitIgor Sysoev2007-12-21
|