[svn-upgrade] Integrating new upstream version, shadow (20001012)

This commit is contained in:
nekral-guest
2007-10-07 11:44:38 +00:00
parent d6e9891ad7
commit 4e3fe42600
159 changed files with 6400 additions and 12724 deletions

View File

@@ -114,26 +114,26 @@ install-exec: all
if test "$(PACKAGE)" = "gettext" \
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
if test -r $(MKINSTALLDIRS); then \
$(MKINSTALLDIRS) $(libdir) $(includedir); \
$(MKINSTALLDIRS) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
else \
$(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
fi; \
$(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
$(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
$(INSTALL_DATA) intlh.inst $(DESTDIR)$(includedir)/libintl.h; \
$(INSTALL_DATA) libintl.a $(DESTDIR)$(libdir)/libintl.a; \
else \
: ; \
fi
install-data: all
if test "$(PACKAGE)" = "gettext"; then \
if test -r $(MKINSTALLDIRS); then \
$(MKINSTALLDIRS) $(gettextsrcdir); \
$(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
else \
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
fi; \
$(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
$(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
dists="$(DISTFILES.common)"; \
for file in $$dists; do \
$(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
$(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(gettextsrcdir)/$$file; \
done; \
else \
: ; \
@@ -145,7 +145,7 @@ installcheck:
uninstall:
dists="$(DISTFILES.common)"; \
for file in $$dists; do \
rm -f $(gettextsrcdir)/$$file; \
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
done
info dvi:

View File

@@ -21,11 +21,11 @@
#include <sys/types.h>
#if defined __GNUC__ && !defined C_ALLOCA
#ifdef __GNUC__
# define alloca __builtin_alloca
# define HAVE_ALLOCA 1
#else
# if (defined HAVE_ALLOCA_H || defined _LIBC) && !defined C_ALLOCA
# if defined HAVE_ALLOCA_H || defined _LIBC
# include <alloca.h>
# else
# ifdef _AIX
@@ -217,24 +217,6 @@ struct block_list
# define DCGETTEXT dcgettext__
#endif
/* Checking whether the binaries runs SUID must be done and glibc provides
easier methods therefore we make a difference here. */
#ifdef _LIBC
# define ENABLE_SECURE __libc_enable_secure
# define DETERMINE_SECURE
#else
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; \
}
#endif
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
locale. */
char *
@@ -259,12 +241,9 @@ DCGETTEXT (domainname, msgid, category)
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
definition left this undefined. */
defintion left this undefined. */
if (domainname == NULL)
domainname = _nl_current_default_domain;
@@ -294,7 +273,7 @@ DCGETTEXT (domainname, msgid, category)
size_t path_max;
char *ret;
path_max = (unsigned int) PATH_MAX;
path_max = (unsigned) PATH_MAX;
path_max += 2; /* The getcwd docs say to do this. */
dirname = (char *) alloca (path_max + dirname_len);
@@ -339,7 +318,7 @@ DCGETTEXT (domainname, msgid, category)
/* Search for the given string. This is a loop because we perhaps
got an ordered list of languages to consider for the translation. */
got an ordered list of languages to consider for th translation. */
while (1)
{
/* Make CATEGORYVALUE point to the next element of the list. */
@@ -360,15 +339,6 @@ DCGETTEXT (domainname, msgid, category)
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))
/* Ingore this entry. */
continue;
}
/* If the current locale value is C (or POSIX) we don't load a
@@ -426,8 +396,7 @@ find_msg (domain_file, msgid)
struct loaded_l10nfile *domain_file;
const char *msgid;
{
size_t act = 0;
size_t top, bottom;
size_t top, act, bottom;
struct loaded_domain *domain;
if (domain_file->decided == 0)

View File

@@ -43,17 +43,6 @@
/* @@ 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)
@@ -85,7 +74,9 @@ _nl_explode_name (name, language, modifier, territory, codeset,
mask = 0;
syntax = undecided;
*language = cp = name;
cp = _nl_find_language (*language);
while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
&& cp[0] != '+' && cp[0] != ',')
++cp;
if (*language == cp)
/* This does not make sense: language has to be specified. Use

View File

@@ -33,9 +33,9 @@
/* Defines the so called `hashpjw' function by P.J. Weinberger
[see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
1986, 1987 Bell Telephone Laboratories, Inc.] */
static unsigned long int hash_string PARAMS ((const char *__str_param));
static unsigned long hash_string PARAMS ((const char *__str_param));
static inline unsigned long int
static inline unsigned long
hash_string (str_param)
const char *str_param;
{
@@ -47,8 +47,8 @@ hash_string (str_param)
while (*str != '\0')
{
hval <<= 4;
hval += (unsigned long int) *str++;
g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
hval += (unsigned long) *str++;
g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
if (g != 0)
{
hval ^= g >> (HASHWORDBITS - 8);

View File

@@ -352,7 +352,7 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
names. */
const char *
_nl_normalize_codeset (codeset, name_len)
const char *codeset;
const unsigned char *codeset;
size_t name_len;
{
int len = 0;

View File

@@ -50,7 +50,7 @@ struct loaded_l10nfile
};
extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset,
size_t name_len));
extern struct loaded_l10nfile *
@@ -74,5 +74,3 @@ extern int _nl_explode_name PARAMS ((char *name, const char **language,
const char **special,
const char **sponsor,
const char **revision));
extern char *_nl_find_language PARAMS ((const char *name));

View File

@@ -31,13 +31,8 @@
# include <unistd.h>
#endif
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| (defined _LIBC && defined _POSIX_MAPPED_FILES)
#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
# include <sys/mman.h>
# undef HAVE_MMAP
# define HAVE_MMAP 1
#else
# undef HAVE_MMAP
#endif
#include "gettext.h"
@@ -73,7 +68,10 @@ _nl_load_domain (domain_file)
size_t size;
struct stat st;
struct mo_file_header *data = (struct mo_file_header *) -1;
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| defined _LIBC
int use_mmap = 0;
#endif
struct loaded_domain *domain;
domain_file->decided = 1;
@@ -101,7 +99,8 @@ _nl_load_domain (domain_file)
return;
}
#ifdef HAVE_MMAP
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| defined _LIBC
/* Now we are ready to load the file. If mmap() is available we try
this first. If not available or it failed we try to load it. */
data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
@@ -150,7 +149,8 @@ _nl_load_domain (domain_file)
if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
{
/* The magic number is wrong: not a message catalog file. */
#ifdef HAVE_MMAP
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| defined _LIBC
if (use_mmap)
munmap ((caddr_t) data, size);
else
@@ -166,7 +166,10 @@ _nl_load_domain (domain_file)
domain = (struct loaded_domain *) domain_file->data;
domain->data = (char *) data;
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| defined _LIBC
domain->use_mmap = use_mmap;
#endif
domain->mmap_size = size;
domain->must_swap = data->magic != _MAGIC;
@@ -184,8 +187,9 @@ _nl_load_domain (domain_file)
((char *) data + W (domain->must_swap, data->hash_tab_offset));
break;
default:
/* This is an invalid revision. */
#ifdef HAVE_MMAP
/* This is an illegal revision. */
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
|| defined _LIBC
if (use_mmap)
munmap ((caddr_t) data, size);
else
@@ -208,11 +212,9 @@ internal_function
_nl_unload_domain (domain)
struct loaded_domain *domain;
{
#ifdef _POSIX_MAPPED_FILES
if (domain->use_mmap)
munmap ((caddr_t) domain->data, domain->mmap_size);
else
#endif /* _POSIX_MAPPED_FILES */
free ((void *) domain->data);
free (domain);

View File

@@ -80,9 +80,7 @@ void free ();
file and the name space must not be polluted. */
# define strcasecmp __strcasecmp
# ifndef mempcpy
# define mempcpy __mempcpy
# endif
# define mempcpy __mempcpy
# define HAVE_MEMPCPY 1
/* We need locking here since we can be called from different places. */
@@ -91,9 +89,6 @@ void free ();
__libc_lock_define_initialized (static, lock);
#endif
#ifndef internal_function
# define internal_function
#endif
/* For those loosing systems which don't have `alloca' we have to add
some additional code emulating it. */
@@ -130,15 +125,6 @@ struct block_list
# define alloca(size) (malloc (size))
#endif /* have alloca */
#if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED
# undef fgets
# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
#endif
#if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED
# undef feof
# define feof(s) feof_unlocked (s)
#endif
struct alias_map
{
@@ -264,10 +250,10 @@ read_alias_file (fname, fname_len)
b) these fields must be usable as file names and so must not
be that long
*/
char buf[BUFSIZ];
char *alias;
char *value;
char *cp;
unsigned char buf[BUFSIZ];
unsigned char *alias;
unsigned char *value;
unsigned char *cp;
if (fgets (buf, sizeof buf, fp) == NULL)
/* EOF reached. */