Merge branch 'sscanf-specifiers' of https://github.com/evverx/util-linux
* 'sscanf-specifiers' of https://github.com/evverx/util-linux: travis: turn off libmount on OSX cifuzz: turn on MSan build-system: stop looking for %ms and %as
This commit is contained in:
commit
4418b5aa49
|
@ -17,7 +17,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sanitizer: [address, undefined]
|
||||
sanitizer: [address, undefined, memory]
|
||||
steps:
|
||||
- name: Build Fuzzers (${{ matrix.sanitizer }})
|
||||
id: build
|
||||
|
|
|
@ -256,6 +256,7 @@ function osx_install_script
|
|||
OSX_CONFOPTS="
|
||||
--disable-ipcrm \
|
||||
--disable-ipcs \
|
||||
--disable-libmount \
|
||||
"
|
||||
|
||||
# workaround: glibtoolize could not find sed
|
||||
|
|
64
configure.ac
64
configure.ac
|
@ -694,69 +694,6 @@ AS_CASE([$enable_all_programs],
|
|||
|
||||
AX_CHECK_TLS
|
||||
|
||||
AC_DEFUN([UL_SCANF_TYPE_MODIFIER], [dnl
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
int rc = 1;
|
||||
char *s;
|
||||
i = sscanf("x", $1, &s);
|
||||
if (i == 1 && *s == 'x')
|
||||
rc = 0;
|
||||
free(s);
|
||||
return rc;
|
||||
}])
|
||||
|
||||
AC_CACHE_VAL([scanf_cv_alloc_modifier],
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%ms"])])],
|
||||
[scanf_cv_alloc_modifier=ms],
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([UL_SCANF_TYPE_MODIFIER(["%as"])])],
|
||||
[scanf_cv_alloc_modifier=as],
|
||||
[scanf_cv_alloc_modifier=no]
|
||||
)
|
||||
,
|
||||
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||
|
||||
#if !(__GLIBC_PREREQ(2, 7))
|
||||
#error %m is not available
|
||||
#endif
|
||||
|
||||
#elif defined(_POSIX_VERSION)
|
||||
|
||||
#if _POSIX_VERSION < 200809L
|
||||
#error %m is not available
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error Your C-library is not supported.
|
||||
#endif
|
||||
])],
|
||||
[scanf_cv_alloc_modifier=ms],
|
||||
[scanf_cv_alloc_modifier=no])]
|
||||
)
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([scanf string alloc modifiers])
|
||||
AS_CASE([$scanf_cv_alloc_modifier],
|
||||
[ms],
|
||||
[AC_MSG_RESULT([(%ms) yes])
|
||||
AC_DEFINE([HAVE_SCANF_MS_MODIFIER], [1], [scanf %ms modifier])
|
||||
have_scanf_alloc_modifier=yes],
|
||||
[as],
|
||||
[AC_MSG_RESULT([(%as) yes])
|
||||
have_scanf_alloc_modifier=yes
|
||||
AC_DEFINE([HAVE_SCANF_AS_MODIFIER], [1], [scanf %as modifier])],
|
||||
[AC_MSG_RESULT([no])
|
||||
have_scanf_alloc_modifier=no]
|
||||
)
|
||||
|
||||
have_pty=no
|
||||
AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]),
|
||||
[], [with_util=auto]
|
||||
|
@ -1131,7 +1068,6 @@ AC_ARG_ENABLE([libmount],
|
|||
)
|
||||
UL_BUILD_INIT([libmount])
|
||||
UL_REQUIRES_BUILD([libmount], [libblkid])
|
||||
UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
|
||||
UL_REQUIRES_HAVE([libmount], [dirfd,ddfd], [dirfd or ddfd function])
|
||||
AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
|
||||
AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
|
||||
|
|
|
@ -377,15 +377,6 @@ static inline int xusleep(useconds_t usec)
|
|||
exit(eval); \
|
||||
})
|
||||
|
||||
/*
|
||||
* scanf modifiers for "strings allocation"
|
||||
*/
|
||||
#ifdef HAVE_SCANF_MS_MODIFIER
|
||||
#define UL_SCNsA "%ms"
|
||||
#elif defined(HAVE_SCANF_AS_MODIFIER)
|
||||
#define UL_SCNsA "%as"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* seek stuff
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue