mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 16:54:51 +02:00
- (djm) Added check for broken snprintf() functions which do not correctly
terminate output string and attempt to use replacement.
This commit is contained in:
parent
28adeef966
commit
cb170cb225
@ -4,6 +4,8 @@
|
|||||||
- (djm) Replace "/bin/sh" with _PATH_BSHELL. Report from Corinna Vinschen
|
- (djm) Replace "/bin/sh" with _PATH_BSHELL. Report from Corinna Vinschen
|
||||||
<vinschen@cygnus.com>
|
<vinschen@cygnus.com>
|
||||||
- (djm) Replace "/usr/bin/login" with LOGIN_PROGRAM
|
- (djm) Replace "/usr/bin/login" with LOGIN_PROGRAM
|
||||||
|
- (djm) Added check for broken snprintf() functions which do not correctly
|
||||||
|
terminate output string and attempt to use replacement.
|
||||||
|
|
||||||
20000628
|
20000628
|
||||||
- (djm) Fixes to lastlog code for Irix
|
- (djm) Fixes to lastlog code for Irix
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
@TOP@
|
@TOP@
|
||||||
|
|
||||||
|
/* Define if your snprintf is busted */
|
||||||
|
#undef BROKEN_SNPRINTF
|
||||||
|
|
||||||
/* Define if you are on NeXT */
|
/* Define if you are on NeXT */
|
||||||
#undef HAVE_NEXT
|
#undef HAVE_NEXT
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
#if defined(BROKEN_SNPRINTF) || !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -120,7 +120,7 @@ mcleanup(str, n, p)
|
|||||||
free(curobj);
|
free(curobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(HAVE_VSNPRINTF)
|
#if !defined(HAVE_VSNPRINTF) || defined(BROKEN_SNPRINTF)
|
||||||
int
|
int
|
||||||
vsnprintf(str, n, fmt, ap)
|
vsnprintf(str, n, fmt, ap)
|
||||||
char *str;
|
char *str;
|
||||||
@ -152,9 +152,9 @@ vsnprintf(str, n, fmt, ap)
|
|||||||
(void) sigaction(SIGSEGV, &osa, NULL);
|
(void) sigaction(SIGSEGV, &osa, NULL);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
#endif /* !defined(HAVE_VSNPRINTF) */
|
#endif /* !defined(HAVE_VSNPRINTF) || defined(BROKEN_SNPRINTF) */
|
||||||
|
|
||||||
#if !defined(HAVE_SNPRINTF)
|
#if !defined(HAVE_SNPRINTF) || defined(BROKEN_SNPRINTF)
|
||||||
int
|
int
|
||||||
#if __STDC__
|
#if __STDC__
|
||||||
snprintf(char *str, size_t n, char const *fmt, ...)
|
snprintf(char *str, size_t n, char const *fmt, ...)
|
||||||
@ -176,6 +176,6 @@ snprintf(str, n, fmt, va_alist)
|
|||||||
return (vsnprintf(str, n, fmt, ap));
|
return (vsnprintf(str, n, fmt, ap));
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
#endif /* !defined(HAVE_SNPRINTF) */
|
#endif /* !defined(HAVE_SNPRINTF) || defined(BROKEN_SNPRINTF) */
|
||||||
|
|
||||||
#endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */
|
#endif /* defined(BROKEN_SNPRINTF) || !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */
|
||||||
|
17
configure.in
17
configure.in
@ -235,6 +235,23 @@ AC_CHECK_FUNC(getpagesize,
|
|||||||
[AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
|
[AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Check for broken snprintf
|
||||||
|
if test "x$ac_cv_func_snprintf" = "xyes" ; then
|
||||||
|
AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
|
||||||
|
AC_TRY_RUN(
|
||||||
|
[
|
||||||
|
#include <stdio.h>
|
||||||
|
int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT(yes)],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
AC_DEFINE(BROKEN_SNPRINTF)
|
||||||
|
AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
PAM_MSG="no"
|
PAM_MSG="no"
|
||||||
AC_ARG_WITH(pam,
|
AC_ARG_WITH(pam,
|
||||||
[ --without-pam Disable PAM support ],
|
[ --without-pam Disable PAM support ],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user