Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix build failure on gcc-6.3 / glibc-2.25 (open) #464

Merged
merged 1 commit into from Mar 26, 2017
Merged

tests: fix build failure on gcc-6.3 / glibc-2.25 (open) #464

merged 1 commit into from Mar 26, 2017

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Mar 26, 2017

Recent gcc has a mechanism to detect some function misuses
at compile-time. In this case it's a case when open() is
likely to create new file but access permissions are not set
explicitly:

$  LANG=C make -C tests api-tests
gcc -g2 -O2 -Wall -fno-omit-frame-pointer -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include   -c -o api/fsio.o api/fsio.c
In file included from /usr/include/fcntl.h:313:0,
                 from /usr/include/sys/file.h:24,
                 from ../include/conf.h:93,
                 from api/tests.h:30,
                 from api/fsio.c:27:
In function 'open',
    inlined from 'fsio_sys_access_file_test' at api/fsio.c:1059:6:
/usr/include/bits/fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
    __open_missing_mode ();
    ^~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: api/fsio.o] Error 1

The change adds "u=rw" to all temp files.

Signed-off-by: Sergei Trofimovich slyfox@gentoo.org

Recent gcc has a mechanism to detect some function misuses
at compile-time. In this case it's a case when open() is
likely to create new file but access permissions are not set
explicitly:

    $  LANG=C make -C tests api-tests
    gcc -g2 -O2 -Wall -fno-omit-frame-pointer -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include   -c -o api/fsio.o api/fsio.c
    In file included from /usr/include/fcntl.h:313:0,
                     from /usr/include/sys/file.h:24,
                     from ../include/conf.h:93,
                     from api/tests.h:30,
                     from api/fsio.c:27:
    In function 'open',
        inlined from 'fsio_sys_access_file_test' at api/fsio.c:1059:6:
    /usr/include/bits/fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
        __open_missing_mode ();
        ^~~~~~~~~~~~~~~~~~~~~~
    make: *** [<builtin>: api/fsio.o] Error 1

The change adds "u=rw" to all temp files.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
@coveralls
Copy link

Coverage Status

Coverage remained the same at 81.634% when pulling 1f2b190 on trofi:master into 0d97c3e on proftpd:master.

@Castaglia Castaglia merged commit 9d8d2e6 into proftpd:master Mar 26, 2017
@Castaglia
Copy link
Member

Nice. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants