Re: new libc broke ssh?
Hi Marco, hi lists!
On Thu, 05 Oct 2000, Marco d'Itri wrote:
> This is a *different*, unrelated problem:
>
> <Md> weasel: I noticed a weird error with postfix, looks like a sign problem
> with limits values
> <weasel> md: getrlimit(RLIMIT_FSIZE, &rlim) returned 2147483647
> for rlim.rlim_cur when compiled with the old libc
> <weasel> md: -1 or 4294967295 when compiled with the new libc
> [...]
> <weasel:#debian-devel> how evil. the new libc really breaks everything that
> handled rlim_t as if it was signed.
I send a patch to 74041@bugs.debian.org (postfix-tls) already.
postfix snapshot 20000924 has the issue fixed with:
diff -ur 1/postfix-0.0.20000531.SNAPSHOT+tls-0.6.16-2.1/util/file_limit.c 6/postfix-0.0.20000531.SNAPSHOT+tls-0.6.16-2.1/util/file_limit.c
--- 1/postfix-0.0.20000531.SNAPSHOT+tls-0.6.16-2.1/util/file_limit.c Fri Dec 11 19:55:37 1998
+++ 6/postfix-0.0.20000531.SNAPSHOT+tls-0.6.16-2.1/util/file_limit.c Thu Oct 5 15:23:56 2000
@@ -44,6 +44,7 @@
#include <sys/resource.h>
#include <signal.h>
#endif
+#include <limits.h>
/* Utility library. */
@@ -56,18 +57,21 @@
off_t get_file_limit(void)
{
-#ifdef USE_ULIMIT
off_t limit;
+#ifdef USE_ULIMIT
if ((limit = ulimit(UL_GETFSIZE, 0)) < 0)
msg_fatal("ulimit: %m");
+ if (limit > INT_MAX / ULIMIT_BLOCK_SIZE)
+ limit = INT_MAX / ULIMIT_BLOCK_SIZE;
return (limit * ULIMIT_BLOCK_SIZE);
#else
struct rlimit rlim;
if (getrlimit(RLIMIT_FSIZE, &rlim) < 0)
msg_fatal("getrlimit: %m");
- return (rlim.rlim_cur);
+ limit = rlim.rlim_cur;
+ return (limit < 0 ? INT_MAX : rlim.rlim_cur);
#endif /* USE_ULIMIT */
}
HTH
yours,
peter
--
PGP encrypted messages preferred.
http://www.cosy.sbg.ac.at/~ppalfrad/
[please CC me on lists]
Reply to: