Add check for LONG_IS_QUAD
#undef MAXINT before including hpsecurity.h to silence an HP-UX warning Check for U?LONG_LONG_MAX in snprintf.c and use LONG_IS_QUAD
This commit is contained in:
3
aclocal.m4
vendored
3
aclocal.m4
vendored
@@ -326,7 +326,10 @@ fi
|
||||
|
||||
dnl
|
||||
dnl check for "long long"
|
||||
dnl XXX cache
|
||||
dnl
|
||||
AC_DEFUN(SUDO_LONG_LONG, [AC_MSG_CHECKING(for long long support)
|
||||
AC_TRY_COMPILE(, [long long foo; foo = 1;], AC_DEFINE(HAVE_LONG_LONG)
|
||||
[AC_TRY_RUN([main() {if (sizeof(long long) == sizeof(long)) exit(0); else exit(1);}], AC_DEFINE(LONG_IS_QUAD))]
|
||||
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))])
|
||||
|
||||
|
@@ -51,6 +51,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#ifdef __hpux
|
||||
# undef MAXINT
|
||||
# include <hpsecurity.h>
|
||||
#else
|
||||
# include <sys/security.h>
|
||||
|
@@ -99,6 +99,9 @@
|
||||
/* Define if your compiler supports the "long long" type. */
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/* Define if sizeof(long) == sizeof(long long). */
|
||||
#undef LONG_IS_QUAD
|
||||
|
||||
/* Solaris doesn't use const qualifiers in PAM. */
|
||||
#ifdef sun
|
||||
#define PAM_CONST
|
||||
|
29
getspwuid.c
29
getspwuid.c
@@ -36,36 +36,37 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#endif /* STDC_HEADERS */
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
#endif /* HAVE_STRING_H */
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <pwd.h>
|
||||
#ifdef HAVE_GETSPNAM
|
||||
# include <shadow.h>
|
||||
# include <shadow.h>
|
||||
#endif /* HAVE_GETSPNAM */
|
||||
#ifdef HAVE_GETPRPWNAM
|
||||
# ifdef __hpux
|
||||
# include <hpsecurity.h>
|
||||
# else
|
||||
# include <sys/security.h>
|
||||
# endif /* __hpux */
|
||||
# include <prot.h>
|
||||
# ifdef __hpux
|
||||
# undef MAXINT
|
||||
# include <hpsecurity.h>
|
||||
# else
|
||||
# include <sys/security.h>
|
||||
# endif /* __hpux */
|
||||
# include <prot.h>
|
||||
#endif /* HAVE_GETPRPWNAM */
|
||||
#ifdef HAVE_GETPWANAM
|
||||
# include <sys/label.h>
|
||||
# include <sys/audit.h>
|
||||
# include <pwdadj.h>
|
||||
# include <sys/label.h>
|
||||
# include <sys/audit.h>
|
||||
# include <pwdadj.h>
|
||||
#endif /* HAVE_GETPWANAM */
|
||||
#ifdef HAVE_GETAUTHUID
|
||||
# include <auth.h>
|
||||
# include <auth.h>
|
||||
#endif /* HAVE_GETAUTHUID */
|
||||
|
||||
#include "sudo.h"
|
||||
|
16
snprintf.c
16
snprintf.c
@@ -86,10 +86,18 @@ static int xxxprintf __P((char **, size_t, int, const char *, va_list));
|
||||
#endif
|
||||
#ifdef HAVE_LONG_LONG
|
||||
# ifndef UQUAD_MAX
|
||||
# define UQUAD_MAX ((unsigned long long)-1)
|
||||
# ifdef ULONG_LONG_MAX
|
||||
# define UQUAD_MAX ULONG_LONG_MAX
|
||||
# else
|
||||
# define UQUAD_MAX ((unsigned long long)-1)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef QUAD_MAX
|
||||
# define QUAD_MAX (UQUAD_MAX / 2)
|
||||
# ifdef LONG_LONG_MAX
|
||||
# define QUAD_MAX LONG_LONG_MAX
|
||||
# else
|
||||
# define QUAD_MAX (UQUAD_MAX / 2)
|
||||
# endif
|
||||
# endif
|
||||
#endif /* HAVE_LONG_LONG */
|
||||
|
||||
@@ -200,7 +208,7 @@ __ultoa(val, endp, base, octzero, xdigs)
|
||||
|
||||
/* Identical to __ultoa, but for quads. */
|
||||
#ifdef HAVE_LONG_LONG
|
||||
# if UQUAD_MAX == ULONG_MAX
|
||||
# ifdef LONG_IS_QUAD
|
||||
# define __uqtoa(v, e, b, o, x) __ultoa((unsigned long)(v), (e), (b), (o), (x))
|
||||
# else
|
||||
static char *
|
||||
@@ -723,7 +731,7 @@ snprintf(str, n, fmt, va_alist)
|
||||
}
|
||||
#endif /* HAVE_SNPRINTF */
|
||||
|
||||
#ifdef HAVE_VASPRINTF
|
||||
#ifndef HAVE_VASPRINTF
|
||||
int
|
||||
vasprintf(str, fmt, ap)
|
||||
char **str;
|
||||
|
8
sudo.c
8
sudo.c
@@ -64,7 +64,13 @@
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#if defined(HAVE_GETPRPWNAM) && defined(HAVE_SET_AUTH_PARAMETERS)
|
||||
#include <prot.h>
|
||||
# ifdef __hpux
|
||||
# undef MAXINT
|
||||
# include <hpsecurity.h>
|
||||
# else
|
||||
# include <sys/security.h>
|
||||
# endif /* __hpux */
|
||||
# include <prot.h>
|
||||
#endif /* HAVE_GETPRPWNAM && HAVE_SET_AUTH_PARAMETERS */
|
||||
|
||||
#include "sudo.h"
|
||||
|
Reference in New Issue
Block a user