Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config-scripts/cups-common.m4
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ dnl Checks for header files.
AC_CHECK_HEADER([langinfo.h], AC_DEFINE([HAVE_LANGINFO_H], [1], [Have <langinfo.h> header?]))
AC_CHECK_HEADER([malloc.h], AC_DEFINE([HAVE_MALLOC_H], [1], [Have <malloc.h> header?]))
AC_CHECK_HEADER([stdint.h], AC_DEFINE([HAVE_STDINT_H], [1], [Have <stdint.h> header?]))
AC_CHECK_HEADER([sys/auxv.h], AC_DEFINE([HAVE_SYS_AUXV_H], [1], [Have <sys/auxv.h> header?]))
AC_CHECK_HEADER([sys/ioctl.h], AC_DEFINE([HAVE_SYS_IOCTL_H], [1], [Have <sys/ioctl.h> header?]))
AC_CHECK_HEADER([sys/param.h], AC_DEFINE([HAVE_SYS_PARAM_H], [1], [Have <sys/param.h> header?]))
AC_CHECK_HEADER([sys/ucred.h], AC_DEFINE([HAVE_SYS_UCRED_H], [1], [Have <sys/ucred.h> header?]))
Expand Down
7 changes: 7 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@
#undef HAVE_AVAHI


/*
* Do we have <sys/auxv.h>?
*/

#undef HAVE_SYS_AUXV_H


/*
* Do we have <sys/ioctl.h>?
*/
Expand Down
7 changes: 6 additions & 1 deletion cups/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include "debug-internal.h"
#ifndef _WIN32
# include <pwd.h>
# ifdef HAVE_SYS_AUXV_H
# include <sys/auxv.h> // for getauxval()
# endif
#endif /* !_WIN32 */


Expand Down Expand Up @@ -294,7 +297,9 @@ cups_globals_alloc(void)
*xdg_config_home = getenv("XDG_CONFIG_HOME");
// Environment variables
# endif // !__APPLE__
# ifdef HAVE_GETEUID
# if defined(HAVE_SYS_AUXV_H) && defined(AT_SECURE)
if (getauxval(AT_SECURE))
# elif defined(HAVE_GETEUID)
if ((geteuid() != getuid() && getuid()) || getegid() != getgid())
# else
if (!getuid())
Expand Down