tor cannot be compiled on recent gcc wth fortify option
Using gcc 4.3.1, tor cannot be compiled, and show this error :
gcc -DHAVE_CONFIG_H -I. -I../.. -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -I/usr/kerberos/include -Wall -g -O2 -MT crypto.o -MD -MP -MF .deps/crypto.Tpo -c -o crypto.o crypto.c In function 'open', inlined from 'finish_daemon' at util.c:2073: /usr/include/bits/fcntl2.h:51: erreur: call to '__open_missing_mode' declared with attribute error: open with O_CREAT in second argument needs 3 arguments mv -f .deps/compat.Tpo .deps/compat.Po
it seems to be a well know problem ( https://hardened.gentooexperimental.org/secure/ticket/29 ) due to some laxism in previous glibc and gcc.
Since the code around line 2073 of util.c is just trying to open /dev/null with O_CREAT, i think we can safely remove the flag from the argument.
Morever, if /dev/null do not exist, we should not create it as a simple file, so this is better to abort in case of problem.
[Automatically added by flyspray2trac: Operating System: Other Linux]
Trac:
Username: misc