Giter Site home page Giter Site logo

nginx_chroot_patch's People

Contributors

landryb avatar mtierltd avatar rnagy avatar

Watchers

 avatar  avatar

nginx_chroot_patch's Issues

Warnings are not aloud if you want to build correctly nginx

Hi.
When using the recommended -Wformat -Werror=format-security, it's impossible to build because of these warnings:

src/core/ngx_string.c:2040:9: error: assigning to 'u_char *' (aka 'unsigned char *') from 'char [24]' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
        prefix = NGX_PREFIX;
               ^ ~~~~~~~~~~
src/core/ngx_string.c:2042:23: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
    if (prefix[strlen(prefix) - 1] == '/')
                      ^~~~~~
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2043:16: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
        plen = strlen(prefix) - 1;
                      ^~~~~~
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2045:16: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
        plen = strlen(prefix);
                      ^~~~~~
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2047:49: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
    if (!ngx_strncmp(path->data, prefix, strlen(prefix))) {
                                                ^~~~~~
src/core/ngx_string.h:53:79: note: expanded from macro 'ngx_strncmp'
#define ngx_strncmp(s1, s2, n)  strncmp((const char *) s1, (const char *) s2, n)
                                                                              ^
/usr/include/x86_64-linux-gnu/bits/string2.h:154:41: note: expanded from macro 'strncmp'
  (__extension__ (__builtin_constant_p (n)                                    \
                                        ^
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2047:49: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
    if (!ngx_strncmp(path->data, prefix, strlen(prefix))) {
                                                ^~~~~~
src/core/ngx_string.h:53:79: note: expanded from macro 'ngx_strncmp'
#define ngx_strncmp(s1, s2, n)  strncmp((const char *) s1, (const char *) s2, n)
                                                                              ^
/usr/include/x86_64-linux-gnu/bits/string2.h:156:38: note: expanded from macro 'strncmp'
                       && strlen (s1) < ((size_t) (n)))                       \
                                                   ^
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2047:49: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
    if (!ngx_strncmp(path->data, prefix, strlen(prefix))) {
                                                ^~~~~~
src/core/ngx_string.h:53:79: note: expanded from macro 'ngx_strncmp'
#define ngx_strncmp(s1, s2, n)  strncmp((const char *) s1, (const char *) s2, n)
                                                                              ^
/usr/include/x86_64-linux-gnu/bits/string2.h:158:34: note: expanded from macro 'strncmp'
                          && strlen (s2) < ((size_t) (n))))                   \
                                                      ^
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2047:49: error: passing 'u_char *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
    if (!ngx_strncmp(path->data, prefix, strlen(prefix))) {
                                                ^~~~~~
src/core/ngx_string.h:53:79: note: expanded from macro 'ngx_strncmp'
#define ngx_strncmp(s1, s2, n)  strncmp((const char *) s1, (const char *) s2, n)
                                                                              ^
/usr/include/x86_64-linux-gnu/bits/string2.h:159:42: note: expanded from macro 'strncmp'
                  ? strcmp (s1, s2) : strncmp (s1, s2, n)))
                                                       ^
/usr/include/string.h:394:35: note: passing argument to parameter '__s' here
extern size_t strlen (const char *__s)
                                  ^
src/core/ngx_string.c:2049:24: error: passing 'char *' to parameter of type 'u_char *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
       x = ngx_cpystrn(buf, path->data + plen, path->len);
                       ^~~
src/core/ngx_string.c:49:21: note: passing argument to parameter 'dst' here
ngx_cpystrn(u_char *dst, u_char *src, size_t n)
                    ^
src/core/ngx_string.c:2049:10: error: assigning to 'char *' from 'u_char *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
       x = ngx_cpystrn(buf, path->data + plen, path->len);
         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/core/ngx_string.c:2051:19: error: assigning to 'u_char *' (aka 'unsigned char *') from 'char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
       path->data = buf;
                  ^ ~~~
11 errors generated.
make[1]: *** [objs/src/core/ngx_string.o] Error 1
make: *** [build] Error 2

It would be paradoxal/ironic to not use the recommended habits in a patch coming from OpenBSD, known for its security ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.