Use strtoul() on systems without strtoull().
We can assume that systems without strtoull() have 32-bit resource limits.
This commit is contained in:
@@ -848,6 +848,9 @@
|
|||||||
/* Define to 1 if you have the `strsignal' function. */
|
/* Define to 1 if you have the `strsignal' function. */
|
||||||
#undef HAVE_STRSIGNAL
|
#undef HAVE_STRSIGNAL
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strtoull' function. */
|
||||||
|
#undef HAVE_STRTOULL
|
||||||
|
|
||||||
/* Define to 1 if `d_namlen' is a member of `struct dirent'. */
|
/* Define to 1 if `d_namlen' is a member of `struct dirent'. */
|
||||||
#undef HAVE_STRUCT_DIRENT_D_NAMLEN
|
#undef HAVE_STRUCT_DIRENT_D_NAMLEN
|
||||||
|
|
||||||
|
2
configure
vendored
2
configure
vendored
@@ -3254,6 +3254,7 @@ as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO"
|
|||||||
as_fn_append ac_func_c_list " faccessat HAVE_FACCESSAT"
|
as_fn_append ac_func_c_list " faccessat HAVE_FACCESSAT"
|
||||||
as_fn_append ac_func_c_list " wordexp HAVE_WORDEXP"
|
as_fn_append ac_func_c_list " wordexp HAVE_WORDEXP"
|
||||||
as_fn_append ac_func_c_list " getauxval HAVE_GETAUXVAL"
|
as_fn_append ac_func_c_list " getauxval HAVE_GETAUXVAL"
|
||||||
|
as_fn_append ac_func_c_list " strtoull HAVE_STRTOULL"
|
||||||
as_fn_append ac_func_c_list " seteuid HAVE_SETEUID"
|
as_fn_append ac_func_c_list " seteuid HAVE_SETEUID"
|
||||||
|
|
||||||
# Auxiliary files required by this configure script.
|
# Auxiliary files required by this configure script.
|
||||||
@@ -21009,6 +21010,7 @@ done
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in execvpe
|
for ac_func in execvpe
|
||||||
do :
|
do :
|
||||||
ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe"
|
ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe"
|
||||||
|
@@ -2560,7 +2560,7 @@ dnl Function checks
|
|||||||
dnl
|
dnl
|
||||||
AC_FUNC_GETGROUPS
|
AC_FUNC_GETGROUPS
|
||||||
AC_FUNC_FSEEKO
|
AC_FUNC_FSEEKO
|
||||||
AC_CHECK_FUNCS_ONCE([fexecve fmemopen killpg nl_langinfo faccessat wordexp getauxval])
|
AC_CHECK_FUNCS_ONCE([fexecve fmemopen killpg nl_langinfo faccessat wordexp getauxval strtoull])
|
||||||
AC_CHECK_FUNCS([execvpe], [SUDO_APPEND_INTERCEPT_EXP(execvpe)])
|
AC_CHECK_FUNCS([execvpe], [SUDO_APPEND_INTERCEPT_EXP(execvpe)])
|
||||||
AC_CHECK_FUNCS([pread], [
|
AC_CHECK_FUNCS([pread], [
|
||||||
# pread/pwrite on 32-bit HP-UX 11.x may not support large files
|
# pread/pwrite on 32-bit HP-UX 11.x may not support large files
|
||||||
|
@@ -876,11 +876,16 @@ check_rlimit(const char *str, bool soft)
|
|||||||
unsigned long long ullval;
|
unsigned long long ullval;
|
||||||
char *ep;
|
char *ep;
|
||||||
|
|
||||||
/* XXX - some systems may lack strtoull() */
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
#ifdef HAVE_STRTOULL
|
||||||
ullval = strtoull(str, &ep, 10);
|
ullval = strtoull(str, &ep, 10);
|
||||||
if (str == ep || (errno == ERANGE && ullval == ULLONG_MAX))
|
if (str == ep || (errno == ERANGE && ullval == ULLONG_MAX))
|
||||||
debug_return_bool(false);
|
debug_return_bool(false);
|
||||||
|
#else
|
||||||
|
ullval = strtoul(str, &ep, 10);
|
||||||
|
if (str == ep || (errno == ERANGE && ullval == ULONG_MAX))
|
||||||
|
debug_return_bool(false);
|
||||||
|
#endif
|
||||||
if (*ep == '\0' || (soft && *ep == ','))
|
if (*ep == '\0' || (soft && *ep == ','))
|
||||||
debug_return_bool(true);
|
debug_return_bool(true);
|
||||||
debug_return_bool(false);
|
debug_return_bool(false);
|
||||||
|
@@ -457,11 +457,16 @@ store_rlimit(const char *str, rlim_t *val, bool soft)
|
|||||||
unsigned long long ullval = 0;
|
unsigned long long ullval = 0;
|
||||||
char *ep;
|
char *ep;
|
||||||
|
|
||||||
/* XXX - some systems may lack strtoull() */
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
#ifdef HAVE_STRTOULL
|
||||||
ullval = strtoull(str, &ep, 10);
|
ullval = strtoull(str, &ep, 10);
|
||||||
if (str == ep || (errno == ERANGE && ullval == ULLONG_MAX))
|
if (str == ep || (errno == ERANGE && ullval == ULLONG_MAX))
|
||||||
debug_return_bool(false);
|
debug_return_bool(false);
|
||||||
|
#else
|
||||||
|
ullval = strtoul(str, &ep, 10);
|
||||||
|
if (str == ep || (errno == ERANGE && ullval == ULONG_MAX))
|
||||||
|
debug_return_bool(false);
|
||||||
|
#endif
|
||||||
if (*ep == '\0' || (soft && *ep == ',')) {
|
if (*ep == '\0' || (soft && *ep == ',')) {
|
||||||
*val = ullval;
|
*val = ullval;
|
||||||
debug_return_bool(true);
|
debug_return_bool(true);
|
||||||
|
Reference in New Issue
Block a user