[PATCH] Core: parse octal/hexadecimal numeric config directives

Maxim Dounin mdounin at mdounin.ru
Mon Nov 10 15:21:50 UTC 2014


Hello!

On Fri, Nov 07, 2014 at 01:19:43PM -0800, Ari Aosved wrote:

> # HG changeset patch
> # User Ari Aosved <ari.aosved at gmail.com>
> # Date 1415392382 28800
> #      Fri Nov 07 12:33:02 2014 -0800
> # Node ID 742fb1a59b705ba71f2bab5fede58ff5885ebc71
> # Parent  234c5ecb00c04c67bcbb4a3be45fd844f2289462
> Core: parse octal/hexadecimal numeric config directives.
> 
> When working with modules which need configuration directives dealing with
> file modes, it's convenient to specify the numeric values in octal notation.
> For instance "hls_directory_create_mode 0775;" is recognizably rwxrwxr-x
> whereas "hls_directory_create_mode 509;" would be more prone to mistakes.

For this particular case, using some more special handler should 
be better, see ngx_conf_set_access_slot() and proxy_store_access 
for an example (http://nginx.org/r/proxy_store_access).

In either case, I don't think that support for octal numbers is a 
good idea, especially for generic number slots.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx-devel mailing list