Klaus Demo nginx / fe1cb8c
rename mode to access Igor Sysoev 15 years ago
6 changed file(s) with 13 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1818
1919 if (tf->file.fd == NGX_INVALID_FILE) {
2020 rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool,
21 tf->persistent, tf->mode);
21 tf->persistent, tf->access);
2222
2323 if (rc == NGX_ERROR || rc == NGX_AGAIN) {
2424 return rc;
3636
3737 ngx_int_t
3838 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
39 ngx_uint_t persistent, ngx_uint_t mode)
39 ngx_uint_t persistent, ngx_uint_t access)
4040 {
4141 ngx_err_t err;
4242 ngx_atomic_uint_t n;
7171 return NGX_ERROR;
7272 }
7373
74 file->fd = ngx_open_tempfile(file->name.data, persistent, mode);
74 file->fd = ngx_open_tempfile(file->name.data, persistent, access);
7575
7676 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
7777 "temp fd:%d", file->fd);
4848 ngx_pool_t *pool;
4949 char *warn;
5050
51 ngx_uint_t mode;
51 ngx_uint_t access;
5252
5353 unsigned log_level:8;
5454 unsigned persistent:1;
7575
7676 ssize_t ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain);
7777 ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path,
78 ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t mode);
78 ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t access);
7979 void ngx_create_hashed_filename(ngx_file_t *file, ngx_path_t *path);
8080 ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path);
8181 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
7373 tf->persistent = r->request_body_in_persistent_file;
7474
7575 if (r->request_body_file_group_access) {
76 tf->mode = 0660;
76 tf->access = 0660;
7777 }
7878
7979 rb->temp_file = tf;
8080
8181 if (ngx_create_temp_file(&tf->file, tf->path, tf->pool,
82 tf->persistent, tf->mode)
82 tf->persistent, tf->access)
8383 != NGX_OK)
8484 {
8585 return NGX_HTTP_INTERNAL_SERVER_ERROR;
399399 tf->persistent = r->request_body_in_persistent_file;
400400
401401 if (r->request_body_file_group_access) {
402 tf->mode = 0660;
402 tf->access = 0660;
403403 }
404404
405405 rb->temp_file = tf;
111111
112112
113113 ngx_fd_t
114 ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t mode)
114 ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t access)
115115 {
116116 ngx_fd_t fd;
117117
118 fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR, mode ? mode : 0600);
118 fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR,
119 access ? access : 0600);
119120
120121 if (fd != -1 && !persistent) {
121122 unlink((const char *) name);
3737
3838
3939 ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent,
40 ngx_uint_t mode);
40 ngx_uint_t access);
4141 #define ngx_open_tempfile_n "open()"
4242
4343
4747 #define ngx_file_append_mode_n "SetFilePointer()"
4848
4949
50 #define ngx_open_tempfile(name, persistent, mode) \
50 #define ngx_open_tempfile(name, persistent, access) \
5151 CreateFile((const char *) name, \
5252 GENERIC_READ|GENERIC_WRITE, \
5353 FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, \