mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 20:41:27 -04:00
Set umask before calling mkstemp in unit tests. Found by coverity
This commit is contained in:
parent
2259777cc8
commit
f1ce15d936
@ -185,6 +185,7 @@ fi
|
|||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([fcntl.h stdarg.h inttypes.h stdint.h stddef.h poll.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in.h netinet/in6.h sys/socket.h sys/uio.h arpa/inet.h sys/eventfd.h sys/mman.h sys/sendfile.h sys/wait.h netdb.h])
|
AC_CHECK_HEADERS([fcntl.h stdarg.h inttypes.h stdint.h stddef.h poll.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in.h netinet/in6.h sys/socket.h sys/uio.h arpa/inet.h sys/eventfd.h sys/mman.h sys/sendfile.h sys/wait.h netdb.h])
|
||||||
|
AC_CHECK_HEADERS([sys/stat.h])
|
||||||
AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
|
AC_CHECK_HEADERS(sys/sysctl.h, [], [], [
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -284,6 +285,7 @@ AC_HEADER_TIME
|
|||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_CHECK_FUNCS([gettimeofday vasprintf fcntl clock_gettime strtok_r strsep])
|
AC_CHECK_FUNCS([gettimeofday vasprintf fcntl clock_gettime strtok_r strsep])
|
||||||
AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl])
|
AC_CHECK_FUNCS([getnameinfo strlcpy inet_ntop inet_pton signal sigaction strtoll inet_aton pipe eventfd sendfile mmap splice arc4random arc4random_buf issetugid geteuid getegid getprotobynumber setenv unsetenv putenv sysctl])
|
||||||
|
AC_CHECK_FUNCS([umask])
|
||||||
|
|
||||||
AC_CACHE_CHECK(
|
AC_CACHE_CHECK(
|
||||||
[for getaddrinfo],
|
[for getaddrinfo],
|
||||||
|
@ -58,6 +58,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#ifdef _EVENT_HAVE_SYS_STAT_H
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@ -123,6 +126,9 @@ regress_make_tmpfile(const void *data, size_t datalen)
|
|||||||
char tmpfilename[32];
|
char tmpfilename[32];
|
||||||
int fd;
|
int fd;
|
||||||
strcpy(tmpfilename, "/tmp/eventtmp.XXXXXX");
|
strcpy(tmpfilename, "/tmp/eventtmp.XXXXXX");
|
||||||
|
#ifdef _EVENT_HAVE_UMASK
|
||||||
|
umask(0077);
|
||||||
|
#endif
|
||||||
fd = mkstemp(tmpfilename);
|
fd = mkstemp(tmpfilename);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user