Date: Sat, 19 Sep 2015 13:36:28 +0000 (UTC) From: "Timur I. Bakeyev" <timur@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r397323 - in head: databases/ldb databases/ldb/files databases/tdb databases/tdb/files devel/talloc devel/talloc/files Message-ID: <201509191336.t8JDaSvE011244@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: timur Date: Sat Sep 19 13:36:27 2015 New Revision: 397323 URL: https://svnweb.freebsd.org/changeset/ports/397323 Log: Fix to the coredump in the library code of the Samba libs. Provided by Andrey Kramarenko. https://bugzilla.samba.org/show_bug.cgi?id=11455 Added: head/databases/ldb/files/patch-lib_replace_replace.c (contents, props changed) head/databases/tdb/files/patch-lib_replace_replace.c (contents, props changed) head/devel/talloc/files/patch-lib_replace_replace.c (contents, props changed) Modified: head/databases/ldb/Makefile head/databases/tdb/Makefile head/devel/talloc/Makefile Modified: head/databases/ldb/Makefile ============================================================================== --- head/databases/ldb/Makefile Sat Sep 19 13:12:44 2015 (r397322) +++ head/databases/ldb/Makefile Sat Sep 19 13:36:27 2015 (r397323) @@ -2,7 +2,7 @@ PORTNAME= ldb PORTVERSION= 1.1.21 -PORTREVISION= 0 +PORTREVISION= 1 PORTEPOCH= 0 CATEGORIES= databases MASTER_SITES= SAMBA Added: head/databases/ldb/files/patch-lib_replace_replace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/ldb/files/patch-lib_replace_replace.c Sat Sep 19 13:36:27 2015 (r397323) @@ -0,0 +1,68 @@ +From 035dd6447a06409c2df5ed559218f52479621abd Mon Sep 17 00:00:00 2001 +From: Volker Lendecke <vl@samba.org> +Date: Tue, 18 Aug 2015 20:57:27 +0200 +Subject: [PATCH] replace: Fix bug 11455 + +Don't call rep_strtoull recursively + +Signed-off-by: Volker Lendecke <vl@samba.org> +Bug: https://bugzilla.samba.org/show_bug.cgi?id=11455 + +https://lists.samba.org/archive/samba-technical/2015-July/108587.html +https://lists.samba.org/archive/samba-technical/2015-July/108588.html + +--- ./lib/replace/replace.c.orig 2015-09-18 23:51:08 UTC ++++ ./lib/replace/replace.c 2015-09-18 23:51:08 UTC +@@ -518,8 +518,10 @@ + } + #else + #ifdef HAVE_BSD_STRTOLL ++#undef strtoll + long long int rep_strtoll(const char *str, char **endptr, int base) + { ++ int errno0 = errno; + long long int nb = strtoll(str, endptr, base); + /* With glibc EINVAL is only returned if base is not ok */ + if (errno == EINVAL) { +@@ -528,7 +530,7 @@ + * able to make the convertion. + * Let's reset errno. + */ +- errno = 0; ++ errno = errno0; + } + } + return nb; +@@ -551,26 +553,24 @@ + #endif + } + #else +-#ifdef HAVE_BSD_STRTOLL +-#ifdef HAVE_STRTOUQ ++#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */ ++#undef strtoull + unsigned long long int rep_strtoull(const char *str, char **endptr, int base) + { +- unsigned long long int nb = strtouq(str, endptr, base); +- /* In linux EINVAL is only returned if base is not ok */ ++ int errno0 = errno; ++ unsigned long long int nb = strtoull(str, endptr, base); ++ /* With glibc EINVAL is only returned if base is not ok */ + if (errno == EINVAL) { + if (base == 0 || (base >1 && base <37)) { + /* Base was ok so it's because we were not + * able to make the convertion. + * Let's reset errno. + */ +- errno = 0; ++ errno = errno0; + } + } + return nb; + } +-#else +-#error "You need the strtouq function" +-#endif /* HAVE_STRTOUQ */ + #endif /* HAVE_BSD_STRTOLL */ + #endif /* HAVE_STRTOULL */ + Modified: head/databases/tdb/Makefile ============================================================================== --- head/databases/tdb/Makefile Sat Sep 19 13:12:44 2015 (r397322) +++ head/databases/tdb/Makefile Sat Sep 19 13:36:27 2015 (r397323) @@ -2,7 +2,7 @@ PORTNAME= tdb PORTVERSION= 1.3.7 -PORTREVISION= 0 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= databases MASTER_SITES= SAMBA Added: head/databases/tdb/files/patch-lib_replace_replace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/tdb/files/patch-lib_replace_replace.c Sat Sep 19 13:36:27 2015 (r397323) @@ -0,0 +1,68 @@ +From 035dd6447a06409c2df5ed559218f52479621abd Mon Sep 17 00:00:00 2001 +From: Volker Lendecke <vl@samba.org> +Date: Tue, 18 Aug 2015 20:57:27 +0200 +Subject: [PATCH] replace: Fix bug 11455 + +Don't call rep_strtoull recursively + +Signed-off-by: Volker Lendecke <vl@samba.org> +Bug: https://bugzilla.samba.org/show_bug.cgi?id=11455 + +https://lists.samba.org/archive/samba-technical/2015-July/108587.html +https://lists.samba.org/archive/samba-technical/2015-July/108588.html + +--- ./lib/replace/replace.c.orig 2015-09-18 23:51:08 UTC ++++ ./lib/replace/replace.c 2015-09-18 23:51:08 UTC +@@ -518,8 +518,10 @@ + } + #else + #ifdef HAVE_BSD_STRTOLL ++#undef strtoll + long long int rep_strtoll(const char *str, char **endptr, int base) + { ++ int errno0 = errno; + long long int nb = strtoll(str, endptr, base); + /* With glibc EINVAL is only returned if base is not ok */ + if (errno == EINVAL) { +@@ -528,7 +530,7 @@ + * able to make the convertion. + * Let's reset errno. + */ +- errno = 0; ++ errno = errno0; + } + } + return nb; +@@ -551,26 +553,24 @@ + #endif + } + #else +-#ifdef HAVE_BSD_STRTOLL +-#ifdef HAVE_STRTOUQ ++#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */ ++#undef strtoull + unsigned long long int rep_strtoull(const char *str, char **endptr, int base) + { +- unsigned long long int nb = strtouq(str, endptr, base); +- /* In linux EINVAL is only returned if base is not ok */ ++ int errno0 = errno; ++ unsigned long long int nb = strtoull(str, endptr, base); ++ /* With glibc EINVAL is only returned if base is not ok */ + if (errno == EINVAL) { + if (base == 0 || (base >1 && base <37)) { + /* Base was ok so it's because we were not + * able to make the convertion. + * Let's reset errno. + */ +- errno = 0; ++ errno = errno0; + } + } + return nb; + } +-#else +-#error "You need the strtouq function" +-#endif /* HAVE_STRTOUQ */ + #endif /* HAVE_BSD_STRTOLL */ + #endif /* HAVE_STRTOULL */ + Modified: head/devel/talloc/Makefile ============================================================================== --- head/devel/talloc/Makefile Sat Sep 19 13:12:44 2015 (r397322) +++ head/devel/talloc/Makefile Sat Sep 19 13:36:27 2015 (r397323) @@ -2,7 +2,7 @@ PORTNAME= talloc PORTVERSION= 2.1.3 -PORTREVISION= 0 +PORTREVISION= 1 PORTEPOCH= 0 CATEGORIES= devel MASTER_SITES= SAMBA Added: head/devel/talloc/files/patch-lib_replace_replace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/talloc/files/patch-lib_replace_replace.c Sat Sep 19 13:36:27 2015 (r397323) @@ -0,0 +1,68 @@ +From 035dd6447a06409c2df5ed559218f52479621abd Mon Sep 17 00:00:00 2001 +From: Volker Lendecke <vl@samba.org> +Date: Tue, 18 Aug 2015 20:57:27 +0200 +Subject: [PATCH] replace: Fix bug 11455 + +Don't call rep_strtoull recursively + +Signed-off-by: Volker Lendecke <vl@samba.org> +Bug: https://bugzilla.samba.org/show_bug.cgi?id=11455 + +https://lists.samba.org/archive/samba-technical/2015-July/108587.html +https://lists.samba.org/archive/samba-technical/2015-July/108588.html + +--- ./lib/replace/replace.c.orig 2015-09-18 23:51:08 UTC ++++ ./lib/replace/replace.c 2015-09-18 23:51:08 UTC +@@ -518,8 +518,10 @@ + } + #else + #ifdef HAVE_BSD_STRTOLL ++#undef strtoll + long long int rep_strtoll(const char *str, char **endptr, int base) + { ++ int errno0 = errno; + long long int nb = strtoll(str, endptr, base); + /* With glibc EINVAL is only returned if base is not ok */ + if (errno == EINVAL) { +@@ -528,7 +530,7 @@ + * able to make the convertion. + * Let's reset errno. + */ +- errno = 0; ++ errno = errno0; + } + } + return nb; +@@ -551,26 +553,24 @@ + #endif + } + #else +-#ifdef HAVE_BSD_STRTOLL +-#ifdef HAVE_STRTOUQ ++#ifdef HAVE_BSD_STRTOLL /* yes, it's not HAVE_BSD_STRTOULL */ ++#undef strtoull + unsigned long long int rep_strtoull(const char *str, char **endptr, int base) + { +- unsigned long long int nb = strtouq(str, endptr, base); +- /* In linux EINVAL is only returned if base is not ok */ ++ int errno0 = errno; ++ unsigned long long int nb = strtoull(str, endptr, base); ++ /* With glibc EINVAL is only returned if base is not ok */ + if (errno == EINVAL) { + if (base == 0 || (base >1 && base <37)) { + /* Base was ok so it's because we were not + * able to make the convertion. + * Let's reset errno. + */ +- errno = 0; ++ errno = errno0; + } + } + return nb; + } +-#else +-#error "You need the strtouq function" +-#endif /* HAVE_STRTOUQ */ + #endif /* HAVE_BSD_STRTOLL */ + #endif /* HAVE_STRTOULL */ +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509191336.t8JDaSvE011244>