mirror of
https://github.com/nginx/nginx.git
synced 2024-12-04 22:09:01 +08:00
rename mode to access
This commit is contained in:
parent
6ed365fa8b
commit
fe1cb8c3ac
@ -19,7 +19,7 @@ ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain)
|
||||
|
||||
if (tf->file.fd == NGX_INVALID_FILE) {
|
||||
rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool,
|
||||
tf->persistent, tf->mode);
|
||||
tf->persistent, tf->access);
|
||||
|
||||
if (rc == NGX_ERROR || rc == NGX_AGAIN) {
|
||||
return rc;
|
||||
@ -37,7 +37,7 @@ ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain)
|
||||
|
||||
ngx_int_t
|
||||
ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
|
||||
ngx_uint_t persistent, ngx_uint_t mode)
|
||||
ngx_uint_t persistent, ngx_uint_t access)
|
||||
{
|
||||
ngx_err_t err;
|
||||
ngx_atomic_uint_t n;
|
||||
@ -72,7 +72,7 @@ ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
file->fd = ngx_open_tempfile(file->name.data, persistent, mode);
|
||||
file->fd = ngx_open_tempfile(file->name.data, persistent, access);
|
||||
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
|
||||
"temp fd:%d", file->fd);
|
||||
|
@ -49,7 +49,7 @@ typedef struct {
|
||||
ngx_pool_t *pool;
|
||||
char *warn;
|
||||
|
||||
ngx_uint_t mode;
|
||||
ngx_uint_t access;
|
||||
|
||||
unsigned log_level:8;
|
||||
unsigned persistent:1;
|
||||
@ -76,7 +76,7 @@ struct ngx_tree_ctx_s {
|
||||
|
||||
ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain);
|
||||
ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path,
|
||||
ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t mode);
|
||||
ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t access);
|
||||
void ngx_create_hashed_filename(ngx_file_t *file, ngx_path_t *path);
|
||||
ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path);
|
||||
ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
|
||||
|
@ -74,13 +74,13 @@ ngx_http_read_client_request_body(ngx_http_request_t *r,
|
||||
tf->persistent = r->request_body_in_persistent_file;
|
||||
|
||||
if (r->request_body_file_group_access) {
|
||||
tf->mode = 0660;
|
||||
tf->access = 0660;
|
||||
}
|
||||
|
||||
rb->temp_file = tf;
|
||||
|
||||
if (ngx_create_temp_file(&tf->file, tf->path, tf->pool,
|
||||
tf->persistent, tf->mode)
|
||||
tf->persistent, tf->access)
|
||||
!= NGX_OK)
|
||||
{
|
||||
return NGX_HTTP_INTERNAL_SERVER_ERROR;
|
||||
@ -400,7 +400,7 @@ ngx_http_write_request_body(ngx_http_request_t *r, ngx_chain_t *body)
|
||||
tf->persistent = r->request_body_in_persistent_file;
|
||||
|
||||
if (r->request_body_file_group_access) {
|
||||
tf->mode = 0660;
|
||||
tf->access = 0660;
|
||||
}
|
||||
|
||||
rb->temp_file = tf;
|
||||
|
@ -112,11 +112,12 @@ ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
|
||||
|
||||
|
||||
ngx_fd_t
|
||||
ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t mode)
|
||||
ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t access)
|
||||
{
|
||||
ngx_fd_t fd;
|
||||
|
||||
fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR, mode ? mode : 0600);
|
||||
fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR,
|
||||
access ? access : 0600);
|
||||
|
||||
if (fd != -1 && !persistent) {
|
||||
unlink((const char *) name);
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
|
||||
ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent,
|
||||
ngx_uint_t mode);
|
||||
ngx_uint_t access);
|
||||
#define ngx_open_tempfile_n "open()"
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ ngx_int_t ngx_file_append_mode(ngx_fd_t fd);
|
||||
#define ngx_file_append_mode_n "SetFilePointer()"
|
||||
|
||||
|
||||
#define ngx_open_tempfile(name, persistent, mode) \
|
||||
#define ngx_open_tempfile(name, persistent, access) \
|
||||
CreateFile((const char *) name, \
|
||||
GENERIC_READ|GENERIC_WRITE, \
|
||||
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, \
|
||||
|
Loading…
Reference in New Issue
Block a user