Add bugfixes from glibc and build a shared library version of libintl.

Bump version to 0.10.35nb1.
This commit is contained in:
danw 2000-06-30 17:07:35 +00:00
parent 4379713c83
commit 1ccea032cc
10 changed files with 258 additions and 10 deletions

View file

@ -1,16 +1,19 @@
# $NetBSD: Makefile,v 1.13 1999/10/07 17:41:48 tron Exp $
# $NetBSD: Makefile,v 1.14 2000/06/30 17:07:35 danw Exp $
# FreeBSD Id: Makefile,v 1.1.1.1 1998/08/09 15:13:33 kuriyama Exp
#
DISTNAME= gettext-0.10.35
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:=gettext/}
DISTNAME= gettext-0.10.35
PKGNAME= gettext-0.10.35nb1
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:=gettext/}
MAINTAINER= packages@netbsd.org
MAINTAINER= packages@netbsd.org
GNU_CONFIGURE= yes
GNU_CONFIGURE= yes
USE_LIBTOOL= yes
LTCONFIG_OVERRIDE= ${WRKSRC}/ltconfig
INFO_FILES= gettext.info
INFO_FILES= gettext.info
.include "../../mk/bsd.prefs.mk"
@ -19,7 +22,7 @@ INFO_FILES= gettext.info
# function in their libc
.if ${OPSYS} == "SunOS"
PLIST_SRC= ${WRKDIR}/PLIST-src
PLIST_SRC= ${WRKDIR}/PLIST-src
pre-install:
@${SED} -e '/^include\/libintl\.h$$/d' -e '/^lib\/libintl\.a$$/d' \

View file

@ -1,3 +1,10 @@
$NetBSD: patch-sum,v 1.1 1999/07/09 13:50:34 agc Exp $
$NetBSD: patch-sum,v 1.2 2000/06/30 17:07:35 danw Exp $
MD5 (patch-aa) = 0592cc9a5a42e25bfbe17840082ca9df
MD5 (patch-ab) = 85ec64fb316f252bc687b1cfe94a3c25
MD5 (patch-ac) = 18c7239ccb1fbe6a5d431a6788d6bdab
MD5 (patch-ad) = 34286240637175a6774fda926fb93407
MD5 (patch-ae) = ef09df0e830bc5ec50cff3d47cbbebe0
MD5 (patch-af) = 7dbf6692ba7a390a16f566953ef6bd64
MD5 (patch-ag) = b4f2ed4e07367dd7d16a94947380fbb9
MD5 (patch-ah) = 7a05abc62bbe4b1af6121f998e4b1572

View file

@ -0,0 +1,15 @@
$NetBSD: patch-aa,v 1.7 2000/06/30 17:07:36 danw Exp $
Build shared libintl
--- configure.orig Fri Jun 23 04:15:24 2000
+++ configure Fri Jun 23 04:15:36 2000
@@ -3958,7 +3958,7 @@
fi
- l=
+ l=l
test -d po || mkdir po

View file

@ -0,0 +1,15 @@
$NetBSD: patch-ac,v 1.1 2000/06/30 17:07:36 danw Exp $
Fix for shared libintl
--- intl/Makefile.in.orig Fri Jun 23 03:38:59 2000
+++ intl/Makefile.in Fri Jun 23 03:54:52 2000
@@ -119,7 +119,7 @@
$(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
fi; \
$(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
- $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+ $(LIBTOOL) install -c libintl.la $(libdir); \
else \
: ; \
fi

View file

@ -0,0 +1,60 @@
$NetBSD: patch-ad,v 1.1 2000/06/30 17:07:36 danw Exp $
Fixes from glibc
--- intl/dcgettext.c.orig Fri Jun 23 03:13:56 2000
+++ intl/dcgettext.c Fri Jun 23 03:42:33 2000
@@ -217,6 +217,17 @@
# define DCGETTEXT dcgettext__
#endif
+static int enable_secure;
+# define ENABLE_SECURE (enable_secure == 1)
+# define DETERMINE_SECURE \
+ if (enable_secure == 0) \
+ { \
+ if (getuid () != geteuid () || getgid () != getegid ()) \
+ enable_secure = 1; \
+ else \
+ enable_secure = -1; \
+ }
+
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
char *
@@ -241,6 +252,9 @@
if (msgid == NULL)
return NULL;
+ /* See whether this is a SUID binary or not. */
+ DETERMINE_SECURE;
+
/* If DOMAINNAME is NULL, we are interested in the default domain. If
CATEGORY is not LC_MESSAGES this might not make much sense but the
defintion left this undefined. */
@@ -339,6 +353,15 @@
while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
*cp++ = *categoryvalue++;
*cp = '\0';
+
+ /* When this is a SUID binary we must not allow accessing files
+ outside the dedicated directories. */
+ if (ENABLE_SECURE
+ && (memchr (single_locale, '/',
+ _nl_find_language (single_locale) - single_locale)
+ != NULL))
+ /* Ignore this entry. */
+ continue;
}
/* If the current locale value is C (or POSIX) we don't load a
@@ -396,7 +419,8 @@
struct loaded_l10nfile *domain_file;
const char *msgid;
{
- size_t top, act, bottom;
+ size_t act = 0;
+ size_t top, bottom;
struct loaded_domain *domain;
if (domain_file->decided == 0)

View file

@ -0,0 +1,51 @@
$NetBSD: patch-ae,v 1.1 2000/06/30 17:07:36 danw Exp $
--- intl/explodename.c.orig Fri Jun 23 03:21:26 2000
+++ intl/explodename.c Fri Jun 23 03:50:55 2000
@@ -43,6 +43,17 @@
/* @@ end of prolog @@ */
+char *
+_nl_find_language (const char *name)
+{
+ while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
+ && name[0] != '+' && name[0] != ',')
+ ++name;
+
+ return (char *) name;
+}
+
+
int
_nl_explode_name (name, language, modifier, territory, codeset,
normalized_codeset, special, sponsor, revision)
@@ -51,7 +62,7 @@
const char **modifier;
const char **territory;
const char **codeset;
- const char **normalized_codeset;
+ char **normalized_codeset;
const char **special;
const char **sponsor;
const char **revision;
@@ -74,9 +85,7 @@
mask = 0;
syntax = undecided;
*language = cp = name;
- while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
- && cp[0] != '+' && cp[0] != ',')
- ++cp;
+ cp = _nl_find_language (*language);
if (*language == cp)
/* This does not make sense: language has to be specified. Use
@@ -111,7 +120,7 @@
*normalized_codeset = _nl_normalize_codeset (*codeset,
cp - *codeset);
if (strcmp (*codeset, *normalized_codeset) == 0)
- free ((char *) *normalized_codeset);
+ free (*normalized_codeset);
else
mask |= XPG_NORM_CODESET;
}

View file

@ -0,0 +1,34 @@
$NetBSD: patch-af,v 1.1 2000/06/30 17:07:36 danw Exp $
Fixes from glibc
--- intl/finddomain.c.orig Fri Jun 23 03:23:00 2000
+++ intl/finddomain.c Fri Jun 23 04:18:34 2000
@@ -81,7 +81,7 @@
const char *modifier;
const char *territory;
const char *codeset;
- const char *normalized_codeset;
+ char *normalized_codeset;
const char *special;
const char *sponsor;
const char *revision;
@@ -192,6 +192,10 @@
if (alias_value != NULL)
free (locale);
+ /* The space for normalized_codeset is dynamically allocated. Free it. */
+ if (mask & XPG_NORM_CODESET)
+ free (normalized_codeset);
+
return retval;
}
@@ -208,6 +212,7 @@
if (runp->data != NULL)
_nl_unload_domain ((struct loaded_domain *) runp->data);
runp = runp->next;
+ free (here->filename);
free (here);
}
}

View file

@ -0,0 +1,35 @@
$NetBSD: patch-ag,v 1.1 2000/06/30 17:07:36 danw Exp $
Fix inspired by glibc, which gets it wrong.
--- intl/l10nflist.c.orig Fri Jun 23 03:25:01 2000
+++ intl/l10nflist.c Fri Jun 23 03:26:32 2000
@@ -349,8 +349,9 @@
/* Normalize codeset name. There is no standard for the codeset
names. Normalization allows the user to use any of the common
- names. */
-const char *
+ names. The return value is dynamically allocated and has to be
+ freed by the caller. */
+char *
_nl_normalize_codeset (codeset, name_len)
const unsigned char *codeset;
size_t name_len;
@@ -381,14 +382,14 @@
for (cnt = 0; cnt < name_len; ++cnt)
if (isalpha (codeset[cnt]))
- *wp++ = tolower (codeset[cnt]);
+ *wp++ = _tolower (codeset[cnt]);
else if (isdigit (codeset[cnt]))
*wp++ = codeset[cnt];
*wp = '\0';
}
- return (const char *) retval;
+ return retval;
}

View file

@ -0,0 +1,26 @@
$NetBSD: patch-ah,v 1.1 2000/06/30 17:07:36 danw Exp $
--- intl/loadinfo.h.orig Fri Jun 23 03:27:25 2000
+++ intl/loadinfo.h Fri Jun 23 03:52:01 2000
@@ -50,8 +50,8 @@
};
-extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset,
- size_t name_len));
+extern char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset,
+ size_t name_len));
extern struct loaded_l10nfile *
_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
@@ -70,7 +70,9 @@
const char **modifier,
const char **territory,
const char **codeset,
- const char **normalized_codeset,
+ char **normalized_codeset,
const char **special,
const char **sponsor,
const char **revision));
+
+extern char *_nl_find_language PARAMS ((const char *name));

View file

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.7 1999/02/11 19:17:29 tv Exp $
@comment $NetBSD: PLIST,v 1.8 2000/06/30 17:07:36 danw Exp $
bin/gettext
bin/gettextize
bin/msgcmp
@ -17,6 +17,8 @@ info/gettext.info-4
info/gettext.info-5
@exec install-info %D/info/gettext.info %D/info/dir
lib/libintl.a
lib/libintl.la
lib/libintl.so.1.0
share/aclocal/gettext.m4
share/aclocal/lcmessage.m4
share/aclocal/progtest.m4