mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 19:00:07 +00:00
Update.
1998-02-20 18:43 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Pretty print. Don't use __ protected names. * iconvdata/8bit-gap.c: Likewise. * iconvdata/8bit-generic.c: Likewise. * iconvdata/iso6937.c: Likewise. * iconvdata/iso8859-1.c: Likewise. * iconvdata/sjis.c: Likewise. * iconvdata/t61.c: Likewise. 1998-02-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/bits/termios.h: Replace all negative feature tests by positive feature tests. 1998-02-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/unlockpt.c: Always return a value. 1998-02-20 Ulrich Drepper <drepper@cygnus.com> * elf/dlvsym.c (dlvsym_doit): More corrections. Patch by Andreas Jaeger.
This commit is contained in:
parent
03e4219e77
commit
dfbad9c855
6
BUGS
6
BUGS
@ -1,7 +1,7 @@
|
|||||||
List of known bugs (certainly very incomplete)
|
List of known bugs (certainly very incomplete)
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|
||||||
Time-stamp: <1997-12-03T15:30:07+0100 drepper>
|
Time-stamp: <1998-02-20T15:02:41-0800 drepper>
|
||||||
|
|
||||||
This following list contains those bugs which I'm aware of. Please
|
This following list contains those bugs which I'm aware of. Please
|
||||||
make sure that bugs you report are not listed here. If you can fix one
|
make sure that bugs you report are not listed here. If you can fix one
|
||||||
@ -15,7 +15,9 @@ GNU project. There is an easy to use WWW interface available at
|
|||||||
I would appreciate it very much if you could verify the problem was not
|
I would appreciate it very much if you could verify the problem was not
|
||||||
reported before by looking through the database. To make the information
|
reported before by looking through the database. To make the information
|
||||||
in this database as useful as possible please report bugs always using the
|
in this database as useful as possible please report bugs always using the
|
||||||
`glibcbug' shell script which gets installed with GNU libc.
|
`glibcbug' shell script which gets installed with GNU libc. Before reporting
|
||||||
|
a bug please check the FAQ since it discusses also a lot of problematic
|
||||||
|
situations.
|
||||||
|
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
24
ChangeLog
24
ChangeLog
@ -1,3 +1,27 @@
|
|||||||
|
1998-02-20 18:43 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* hesiod/hesiod.c: Pretty print. Don't use __ protected names.
|
||||||
|
* iconvdata/8bit-gap.c: Likewise.
|
||||||
|
* iconvdata/8bit-generic.c: Likewise.
|
||||||
|
* iconvdata/iso6937.c: Likewise.
|
||||||
|
* iconvdata/iso8859-1.c: Likewise.
|
||||||
|
* iconvdata/sjis.c: Likewise.
|
||||||
|
* iconvdata/t61.c: Likewise.
|
||||||
|
|
||||||
|
1998-02-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/bits/termios.h: Replace all negative
|
||||||
|
feature tests by positive feature tests.
|
||||||
|
|
||||||
|
1998-02-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/unlockpt.c: Always return a value.
|
||||||
|
|
||||||
|
1998-02-20 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* elf/dlvsym.c (dlvsym_doit): More corrections.
|
||||||
|
Patch by Andreas Jaeger.
|
||||||
|
|
||||||
1998-02-19 Ulrich Drepper <drepper@cygnus.com>
|
1998-02-19 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/sigqueue.c: Fix weak alias definition.
|
* sysdeps/unix/sysv/linux/sigqueue.c: Fix weak alias definition.
|
||||||
|
10
db2/README
10
db2/README
@ -1,3 +1,13 @@
|
|||||||
|
When Berkeley DB is distributed as part of the GNU system, the Berkeley
|
||||||
|
DB license requirement that derivative works using Berkeley DB themselves
|
||||||
|
be freely redistributable, does not apply to programs loading standard
|
||||||
|
UNIX interfaces via the GNU C library and dynamically loading Berkeley DB
|
||||||
|
support to obtain the underlying functionality.
|
||||||
|
|
||||||
|
Sleepycat Software, Inc.
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The LICENSE file, mentioned in the beginning of the source files, can
|
The LICENSE file, mentioned in the beginning of the source files, can
|
||||||
be found together with all the other relevant license texts in the
|
be found together with all the other relevant license texts in the
|
||||||
manual and the INSTALL file in the toplevel directory.
|
manual and the INSTALL file in the toplevel directory.
|
||||||
|
@ -74,6 +74,7 @@ RTLD_NEXT used in code not dynamically loaded"));
|
|||||||
&args->ref,
|
&args->ref,
|
||||||
mapscope,
|
mapscope,
|
||||||
NULL,
|
NULL,
|
||||||
|
&args->version,
|
||||||
match);
|
match);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -455,7 +455,7 @@ extern void _dl_start_profile (struct link_map *map, const char *output_dir);
|
|||||||
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
|
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
|
||||||
|
|
||||||
|
|
||||||
/* Show the members of the auxiliry aray passed up from the kernel. */
|
/* Show the members of the auxiliary array passed up from the kernel. */
|
||||||
extern void _dl_show_auxv (void);
|
extern void _dl_show_auxv (void);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
189
hesiod/hesiod.c
189
hesiod/hesiod.c
@ -58,47 +58,48 @@ static const char rcsid[] = "$Id$";
|
|||||||
|
|
||||||
/* A few operating systems don't define these. */
|
/* A few operating systems don't define these. */
|
||||||
#ifndef C_HS
|
#ifndef C_HS
|
||||||
#define C_HS 4
|
# define C_HS 4
|
||||||
#endif
|
#endif
|
||||||
#ifndef T_TXT
|
#ifndef T_TXT
|
||||||
#define T_TXT 16
|
# define T_TXT 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int read_config_file(struct hesiod_p *ctx, const char *filename);
|
static int read_config_file (struct hesiod_p *ctx, const char *filename);
|
||||||
static char **get_txt_records(struct hesiod_p *ctx, int class,
|
static char **get_txt_records (struct hesiod_p *ctx, int class,
|
||||||
const char *name);
|
const char *name);
|
||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
# define cistrcmp(s1, s2) strcasecmp (s1, s2)
|
# define cistrcmp(s1, s2) strcasecmp (s1, s2)
|
||||||
#else
|
#else
|
||||||
static int cistrcmp(const char *s1, const char *s2);
|
static int cistrcmp (const char *s1, const char *s2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This function is called to initialize a hesiod_p. */
|
/* This function is called to initialize a hesiod_p. */
|
||||||
int hesiod_init(void **context)
|
int
|
||||||
|
hesiod_init (void **context)
|
||||||
{
|
{
|
||||||
struct hesiod_p *ctx;
|
struct hesiod_p *ctx;
|
||||||
const char *p, *configname;
|
const char *p, *configname;
|
||||||
|
|
||||||
ctx = malloc(sizeof(struct hesiod_p));
|
ctx = malloc (sizeof (struct hesiod_p));
|
||||||
if (ctx)
|
if (ctx)
|
||||||
{
|
{
|
||||||
*context = ctx;
|
*context = ctx;
|
||||||
configname = __secure_getenv("HESIOD_CONFIG");
|
configname = __secure_getenv ("HESIOD_CONFIG");
|
||||||
if (!configname)
|
if (!configname)
|
||||||
configname = SYSCONFDIR "/hesiod.conf";
|
configname = SYSCONFDIR "/hesiod.conf";
|
||||||
if (read_config_file(ctx, configname) >= 0)
|
if (read_config_file (ctx, configname) >= 0)
|
||||||
{
|
{
|
||||||
/* The default rhs can be overridden by an environment variable. */
|
/* The default rhs can be overridden by an environment variable. */
|
||||||
p = __secure_getenv("HES_DOMAIN");
|
p = __secure_getenv ("HES_DOMAIN");
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
if (ctx->rhs)
|
if (ctx->rhs)
|
||||||
free(ctx->rhs);
|
free (ctx->rhs);
|
||||||
ctx->rhs = malloc(strlen(p) + 2);
|
ctx->rhs = malloc (strlen (p) + 2);
|
||||||
if (ctx->rhs)
|
if (ctx->rhs)
|
||||||
{
|
{
|
||||||
*ctx->rhs = '.';
|
*ctx->rhs = '.';
|
||||||
strcpy(ctx->rhs + 1, (*p == '.') ? p + 1 : p);
|
strcpy (ctx->rhs + 1, (*p == '.') ? p + 1 : p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -112,47 +113,49 @@ int hesiod_init(void **context)
|
|||||||
__set_errno (ENOMEM);
|
__set_errno (ENOMEM);
|
||||||
|
|
||||||
if (ctx->lhs)
|
if (ctx->lhs)
|
||||||
free(ctx->lhs);
|
free (ctx->lhs);
|
||||||
if (ctx->rhs)
|
if (ctx->rhs)
|
||||||
free(ctx->rhs);
|
free (ctx->rhs);
|
||||||
if (ctx)
|
if (ctx)
|
||||||
free(ctx);
|
free (ctx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function deallocates the hesiod_p. */
|
/* This function deallocates the hesiod_p. */
|
||||||
void hesiod_end(void *context)
|
void
|
||||||
|
hesiod_end (void *context)
|
||||||
{
|
{
|
||||||
struct hesiod_p *ctx = (struct hesiod_p *) context;
|
struct hesiod_p *ctx = (struct hesiod_p *) context;
|
||||||
|
|
||||||
free(ctx->rhs);
|
free (ctx->rhs);
|
||||||
if (ctx->lhs)
|
if (ctx->lhs)
|
||||||
free(ctx->lhs);
|
free (ctx->lhs);
|
||||||
free(ctx);
|
free (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function takes a hesiod (name, type) and returns a DNS
|
/* This function takes a hesiod (name, type) and returns a DNS
|
||||||
* name which is to be resolved.
|
* name which is to be resolved.
|
||||||
*/
|
*/
|
||||||
char *hesiod_to_bind(void *context, const char *name, const char *type)
|
char *
|
||||||
|
hesiod_to_bind (void *context, const char *name, const char *type)
|
||||||
{
|
{
|
||||||
struct hesiod_p *ctx = (struct hesiod_p *) context;
|
struct hesiod_p *ctx = (struct hesiod_p *) context;
|
||||||
char bindname[MAXDNAME], *p, *endp, *ret, **rhs_list = NULL;
|
char bindname[MAXDNAME], *p, *endp, *ret, **rhs_list = NULL;
|
||||||
const char *rhs;
|
const char *rhs;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
endp = stpcpy(bindname, name);
|
endp = stpcpy (bindname, name);
|
||||||
|
|
||||||
/* Find the right right hand side to use, possibly truncating bindname. */
|
/* Find the right right hand side to use, possibly truncating bindname. */
|
||||||
p = strchr(bindname, '@');
|
p = strchr (bindname, '@');
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
if (strchr(p, '.'))
|
if (strchr (p, '.'))
|
||||||
rhs = name + (p - bindname);
|
rhs = name + (p - bindname);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rhs_list = hesiod_resolve(context, p, "rhs-extension");
|
rhs_list = hesiod_resolve (context, p, "rhs-extension");
|
||||||
if (rhs_list)
|
if (rhs_list)
|
||||||
rhs = *rhs_list;
|
rhs = *rhs_list;
|
||||||
else
|
else
|
||||||
@ -161,82 +164,85 @@ char *hesiod_to_bind(void *context, const char *name, const char *type)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
rhs = ctx->rhs;
|
rhs = ctx->rhs;
|
||||||
|
|
||||||
/* See if we have enough room. */
|
/* See if we have enough room. */
|
||||||
len = (endp - bindname) + 1 + strlen(type);
|
len = (endp - bindname) + 1 + strlen (type);
|
||||||
if (ctx->lhs)
|
if (ctx->lhs)
|
||||||
len += strlen(ctx->lhs) + ((ctx->lhs[0] != '.') ? 1 : 0);
|
len += strlen (ctx->lhs) + ((ctx->lhs[0] != '.') ? 1 : 0);
|
||||||
len += strlen(rhs) + ((rhs[0] != '.') ? 1 : 0);
|
len += strlen (rhs) + ((rhs[0] != '.') ? 1 : 0);
|
||||||
if (len > sizeof(bindname) - 1)
|
if (len > sizeof (bindname) - 1)
|
||||||
{
|
{
|
||||||
if (rhs_list)
|
if (rhs_list)
|
||||||
hesiod_free_list(context, rhs_list);
|
hesiod_free_list (context, rhs_list);
|
||||||
__set_errno (EMSGSIZE);
|
__set_errno (EMSGSIZE);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put together the rest of the domain. */
|
/* Put together the rest of the domain. */
|
||||||
endp = __stpcpy (__stpcpy (endp, "."), type);
|
endp = stpcpy (stpcpy (endp, "."), type);
|
||||||
if (ctx->lhs)
|
if (ctx->lhs)
|
||||||
{
|
{
|
||||||
if (ctx->lhs[0] != '.')
|
if (ctx->lhs[0] != '.')
|
||||||
endp = __stpcpy (endp, ".");
|
endp = stpcpy (endp, ".");
|
||||||
endp = __stpcpy (endp, ctx->lhs);
|
endp = stpcpy (endp, ctx->lhs);
|
||||||
}
|
}
|
||||||
if (rhs[0] != '.')
|
if (rhs[0] != '.')
|
||||||
endp = __stpcpy (endp, ".");
|
endp = stpcpy (endp, ".");
|
||||||
endp = __stpcpy (endp, rhs);
|
endp = stpcpy (endp, rhs);
|
||||||
|
|
||||||
/* rhs_list is no longer needed, since we're done with rhs. */
|
/* rhs_list is no longer needed, since we're done with rhs. */
|
||||||
if (rhs_list)
|
if (rhs_list)
|
||||||
hesiod_free_list(context, rhs_list);
|
hesiod_free_list (context, rhs_list);
|
||||||
|
|
||||||
/* Make a copy of the result and return it to the caller. */
|
/* Make a copy of the result and return it to the caller. */
|
||||||
ret = malloc((endp - bindname) + 1);
|
ret = malloc ((endp - bindname) + 1);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
__set_errno (ENOMEM);
|
__set_errno (ENOMEM);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
strcpy(ret, bindname);
|
return strcpy (ret, bindname);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is the core function. Given a hesiod name and type, it
|
/* This is the core function. Given a hesiod name and type, it
|
||||||
* returns an array of strings returned by the resolver.
|
* returns an array of strings returned by the resolver.
|
||||||
*/
|
*/
|
||||||
char **hesiod_resolve(void *context, const char *name, const char *type)
|
char **
|
||||||
|
hesiod_resolve (void *context, const char *name, const char *type)
|
||||||
{
|
{
|
||||||
struct hesiod_p *ctx = (struct hesiod_p *) context;
|
struct hesiod_p *ctx = (struct hesiod_p *) context;
|
||||||
char *bindname, **retvec;
|
char *bindname, **retvec;
|
||||||
|
|
||||||
bindname = hesiod_to_bind(context, name, type);
|
bindname = hesiod_to_bind (context, name, type);
|
||||||
if (!bindname)
|
if (bindname == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
retvec = get_txt_records(ctx, ctx->classes[0], bindname);
|
retvec = get_txt_records(ctx, ctx->classes[0], bindname);
|
||||||
if (retvec == NULL && errno == ENOENT && ctx->classes[1])
|
if (retvec == NULL && errno == ENOENT && ctx->classes[1])
|
||||||
retvec = get_txt_records(ctx, ctx->classes[1], bindname);
|
retvec = get_txt_records (ctx, ctx->classes[1], bindname);
|
||||||
|
|
||||||
free(bindname);
|
free (bindname);
|
||||||
return retvec;
|
return retvec;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hesiod_free_list(void *context, char **list)
|
void
|
||||||
|
hesiod_free_list (void *context, char **list)
|
||||||
{
|
{
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
for (p = list; *p; p++)
|
for (p = list; *p; p++)
|
||||||
free(*p);
|
free (*p);
|
||||||
free(list);
|
free (list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function parses the /etc/hesiod.conf file. Returns 0 on success,
|
/* This function parses the /etc/hesiod.conf file. Returns 0 on success,
|
||||||
* -1 on failure. On failure, it might leave values in ctx->lhs or
|
* -1 on failure. On failure, it might leave values in ctx->lhs or
|
||||||
* ctx->rhs which need to be freed by the caller. */
|
* ctx->rhs which need to be freed by the caller. */
|
||||||
static int read_config_file(struct hesiod_p *ctx, const char *filename)
|
static int
|
||||||
|
read_config_file (struct hesiod_p *ctx, const char *filename)
|
||||||
{
|
{
|
||||||
char *key, *data, *p, **which;
|
char *key, *data, *p, **which;
|
||||||
char buf[MAXDNAME + 7];
|
char buf[MAXDNAME + 7];
|
||||||
@ -248,16 +254,16 @@ static int read_config_file(struct hesiod_p *ctx, const char *filename)
|
|||||||
ctx->classes[1] = C_HS;
|
ctx->classes[1] = C_HS;
|
||||||
|
|
||||||
/* Try to open the configuration file. */
|
/* Try to open the configuration file. */
|
||||||
fp = fopen(filename, "r");
|
fp = fopen (filename, "r");
|
||||||
if (!fp)
|
if (fp = NULL)
|
||||||
{
|
{
|
||||||
/* Use compiled in default domain names. */
|
/* Use compiled in default domain names. */
|
||||||
ctx->lhs = malloc(strlen(DEF_LHS) + 1);
|
ctx->lhs = malloc (strlen (DEF_LHS) + 1);
|
||||||
ctx->rhs = malloc(strlen(DEF_RHS) + 1);
|
ctx->rhs = malloc (strlen (DEF_RHS) + 1);
|
||||||
if (ctx->lhs && ctx->rhs)
|
if (ctx->lhs && ctx->rhs)
|
||||||
{
|
{
|
||||||
strcpy(ctx->lhs, DEF_LHS);
|
strcpy (ctx->lhs, DEF_LHS);
|
||||||
strcpy(ctx->rhs, DEF_RHS);
|
strcpy (ctx->rhs, DEF_RHS);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -269,49 +275,48 @@ static int read_config_file(struct hesiod_p *ctx, const char *filename)
|
|||||||
|
|
||||||
ctx->lhs = NULL;
|
ctx->lhs = NULL;
|
||||||
ctx->rhs = NULL;
|
ctx->rhs = NULL;
|
||||||
while (fgets(buf, sizeof(buf), fp) != NULL)
|
while (fgets (buf, sizeof (buf), fp) != NULL)
|
||||||
{
|
{
|
||||||
p = buf;
|
p = buf;
|
||||||
if (*p == '#' || *p == '\n' || *p == '\r')
|
if (*p == '#' || *p == '\n' || *p == '\r')
|
||||||
continue;
|
continue;
|
||||||
while(*p == ' ' || *p == '\t')
|
while (*p == ' ' || *p == '\t')
|
||||||
p++;
|
++p;
|
||||||
key = p;
|
key = p;
|
||||||
while(*p != ' ' && *p != '\t' && *p != '=')
|
while(*p != ' ' && *p != '\t' && *p != '=')
|
||||||
p++;
|
++p;
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
|
|
||||||
while(isspace(*p) || *p == '=')
|
while (isspace (*p) || *p == '=')
|
||||||
p++;
|
++p;
|
||||||
data = p;
|
data = p;
|
||||||
while(!isspace(*p))
|
while (!isspace (*p))
|
||||||
p++;
|
++p;
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
if (cistrcmp(key, "lhs") == 0 || cistrcmp(key, "rhs") == 0)
|
if (cistrcmp (key, "lhs") == 0 || cistrcmp (key, "rhs") == 0)
|
||||||
{
|
{
|
||||||
which = (strcmp(key, "lhs") == 0) ? &ctx->lhs : &ctx->rhs;
|
which = (strcmp (key, "lhs") == 0) ? &ctx->lhs : &ctx->rhs;
|
||||||
*which = malloc(strlen(data) + 1);
|
*which = strdup (data);
|
||||||
if (!*which)
|
if (!*which)
|
||||||
{
|
{
|
||||||
__set_errno (ENOMEM);
|
__set_errno (ENOMEM);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
strcpy(*which, data);
|
|
||||||
}
|
}
|
||||||
else if (cistrcmp(key, "classes") == 0)
|
else if (cistrcmp (key, "classes") == 0)
|
||||||
{
|
{
|
||||||
n = 0;
|
n = 0;
|
||||||
while (*data && n < 2)
|
while (*data && n < 2)
|
||||||
{
|
{
|
||||||
p = data;
|
p = data;
|
||||||
while (*p && *p != ',')
|
while (*p && *p != ',')
|
||||||
p++;
|
++p;
|
||||||
if (*p)
|
if (*p)
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
if (cistrcmp(data, "IN") == 0)
|
if (cistrcmp (data, "IN") == 0)
|
||||||
ctx->classes[n++] = C_IN;
|
ctx->classes[n++] = C_IN;
|
||||||
else if (cistrcmp(data, "HS") == 0)
|
else if (cistrcmp (data, "HS") == 0)
|
||||||
ctx->classes[n++] = C_HS;
|
ctx->classes[n++] = C_HS;
|
||||||
data = p;
|
data = p;
|
||||||
}
|
}
|
||||||
@ -319,7 +324,7 @@ static int read_config_file(struct hesiod_p *ctx, const char *filename)
|
|||||||
ctx->classes[n++] = 0;
|
ctx->classes[n++] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(fp);
|
fclose (fp);
|
||||||
|
|
||||||
if (!ctx->rhs || ctx->classes[0] == 0 || ctx->classes[0] == ctx->classes[1])
|
if (!ctx->rhs || ctx->classes[0] == 0 || ctx->classes[0] == ctx->classes[1])
|
||||||
{
|
{
|
||||||
@ -333,8 +338,8 @@ static int read_config_file(struct hesiod_p *ctx, const char *filename)
|
|||||||
/* Given a DNS class and a DNS name, do a lookup for TXT records, and
|
/* Given a DNS class and a DNS name, do a lookup for TXT records, and
|
||||||
* return a list of them.
|
* return a list of them.
|
||||||
*/
|
*/
|
||||||
static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
static char **
|
||||||
const char *name)
|
get_txt_records (struct hesiod_p *ctx, int qclass, const char *name)
|
||||||
{
|
{
|
||||||
HEADER *hp;
|
HEADER *hp;
|
||||||
unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor;
|
unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor;
|
||||||
@ -342,17 +347,17 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
int ancount, qdcount, i, j, n, skip, type, class, len;
|
int ancount, qdcount, i, j, n, skip, type, class, len;
|
||||||
|
|
||||||
/* Make sure the resolver is initialized. */
|
/* Make sure the resolver is initialized. */
|
||||||
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
|
if ((_res.options & RES_INIT) == 0 && res_init () == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Construct the query. */
|
/* Construct the query. */
|
||||||
n = res_mkquery(QUERY, name, qclass, T_TXT, NULL, 0,
|
n = res_mkquery (QUERY, name, qclass, T_TXT, NULL, 0,
|
||||||
NULL, qbuf, PACKETSZ);
|
NULL, qbuf, PACKETSZ);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Send the query. */
|
/* Send the query. */
|
||||||
n = res_send(qbuf, n, abuf, MAX_HESRESP);
|
n = res_send (qbuf, n, abuf, MAX_HESRESP);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
{
|
{
|
||||||
__set_errno (ECONNREFUSED);
|
__set_errno (ECONNREFUSED);
|
||||||
@ -361,15 +366,15 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
|
|
||||||
/* Parse the header of the result. */
|
/* Parse the header of the result. */
|
||||||
hp = (HEADER *) abuf;
|
hp = (HEADER *) abuf;
|
||||||
ancount = ntohs(hp->ancount);
|
ancount = ntohs (hp->ancount);
|
||||||
qdcount = ntohs(hp->qdcount);
|
qdcount = ntohs (hp->qdcount);
|
||||||
p = abuf + sizeof(HEADER);
|
p = abuf + sizeof (HEADER);
|
||||||
eom = abuf + n;
|
eom = abuf + n;
|
||||||
|
|
||||||
/* Skip questions, trying to get to the answer section which follows. */
|
/* Skip questions, trying to get to the answer section which follows. */
|
||||||
for (i = 0; i < qdcount; i++)
|
for (i = 0; i < qdcount; ++i)
|
||||||
{
|
{
|
||||||
skip = dn_skipname(p, eom);
|
skip = dn_skipname (p, eom);
|
||||||
if (skip < 0 || p + skip + QFIXEDSZ > eom)
|
if (skip < 0 || p + skip + QFIXEDSZ > eom)
|
||||||
{
|
{
|
||||||
__set_errno (EMSGSIZE);
|
__set_errno (EMSGSIZE);
|
||||||
@ -379,8 +384,8 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate space for the text record answers. */
|
/* Allocate space for the text record answers. */
|
||||||
list = malloc((ancount + 1) * sizeof(char *));
|
list = malloc ((ancount + 1) * sizeof(char *));
|
||||||
if (!list)
|
if (list == NULL)
|
||||||
{
|
{
|
||||||
__set_errno (ENOMEM);
|
__set_errno (ENOMEM);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -391,7 +396,7 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
for (i = 0; i < ancount; i++)
|
for (i = 0; i < ancount; i++)
|
||||||
{
|
{
|
||||||
/* Parse the header of this answer. */
|
/* Parse the header of this answer. */
|
||||||
skip = dn_skipname(p, eom);
|
skip = dn_skipname (p, eom);
|
||||||
if (skip < 0 || p + skip + 10 > eom)
|
if (skip < 0 || p + skip + 10 > eom)
|
||||||
break;
|
break;
|
||||||
type = p[skip + 0] << 8 | p[skip + 1];
|
type = p[skip + 0] << 8 | p[skip + 1];
|
||||||
@ -412,7 +417,7 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate space for this answer. */
|
/* Allocate space for this answer. */
|
||||||
list[j] = malloc(len);
|
list[j] = malloc (len);
|
||||||
if (!list[j])
|
if (!list[j])
|
||||||
{
|
{
|
||||||
__set_errno (ENOMEM);
|
__set_errno (ENOMEM);
|
||||||
@ -430,9 +435,8 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
__set_errno (EMSGSIZE);
|
__set_errno (EMSGSIZE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
memcpy(dst, p, n);
|
dst = mempcpy (dst, p, n);
|
||||||
p += n;
|
p += n;
|
||||||
dst += n;
|
|
||||||
}
|
}
|
||||||
if (p < eor)
|
if (p < eor)
|
||||||
{
|
{
|
||||||
@ -446,15 +450,15 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
if (i < ancount)
|
if (i < ancount)
|
||||||
{
|
{
|
||||||
for (i = 0; i < j; i++)
|
for (i = 0; i < j; i++)
|
||||||
free(list[i]);
|
free (list[i]);
|
||||||
free(list);
|
free (list);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
{
|
{
|
||||||
__set_errno (ENOENT);
|
__set_errno (ENOENT);
|
||||||
free(list);
|
free (list);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +467,8 @@ static char **get_txt_records(struct hesiod_p *ctx, int qclass,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBC
|
#ifndef _LIBC
|
||||||
static int cistrcmp(const char *s1, const char *s2)
|
static int
|
||||||
|
cistrcmp (const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
while (*s1 && tolower(*s1) == tolower(*s2))
|
while (*s1 && tolower(*s1) == tolower(*s2))
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Generic conversion to and from 8bit charsets,
|
/* Generic conversion to and from 8bit charsets,
|
||||||
converting from UCS using gaps.
|
converting from UCS using gaps.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -57,9 +57,9 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
|||||||
enum direction dir;
|
enum direction dir;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (__strcasestr (step->from_name, NAME) != NULL)
|
if (strcasestr (step->from_name, NAME) != NULL)
|
||||||
dir = from_8bit;
|
dir = from_8bit;
|
||||||
else if (__strcasestr (step->to_name, NAME) != NULL)
|
else if (strcasestr (step->to_name, NAME) != NULL)
|
||||||
dir = to_8bit;
|
dir = to_8bit;
|
||||||
else
|
else
|
||||||
dir = illegal;
|
dir = illegal;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Generic conversion to and from 8bit charsets.
|
/* Generic conversion to and from 8bit charsets.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -44,9 +44,9 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
|||||||
enum direction dir;
|
enum direction dir;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (__strcasestr (step->from_name, NAME) != NULL)
|
if (strcasestr (step->from_name, NAME) != NULL)
|
||||||
dir = from_8bit;
|
dir = from_8bit;
|
||||||
else if (__strcasestr (step->to_name, NAME) != NULL)
|
else if (strcasestr (step->to_name, NAME) != NULL)
|
||||||
dir = to_8bit;
|
dir = to_8bit;
|
||||||
else
|
else
|
||||||
dir = illegal;
|
dir = illegal;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Generic conversion to and from ISO 6937.
|
/* Generic conversion to and from ISO 6937.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -394,9 +394,9 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
|||||||
enum direction dir;
|
enum direction dir;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (__strcasestr (step->from_name, "ISO_6937") != NULL)
|
if (strcasestr (step->from_name, "ISO_6937") != NULL)
|
||||||
dir = from_iso6937;
|
dir = from_iso6937;
|
||||||
else if (__strcasestr (step->to_name, "ISO_6937") != NULL)
|
else if (strcasestr (step->to_name, "ISO_6937") != NULL)
|
||||||
dir = to_iso6937;
|
dir = to_iso6937;
|
||||||
else
|
else
|
||||||
dir = illegal;
|
dir = illegal;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Conversion to and from ISO 8859-1.
|
/* Conversion to and from ISO 8859-1.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -44,9 +44,9 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
|||||||
enum direction dir;
|
enum direction dir;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (__strcasestr (step->from_name, "ISO-8859-1") != NULL)
|
if (strcasestr (step->from_name, "ISO-8859-1") != NULL)
|
||||||
dir = from_iso88591;
|
dir = from_iso88591;
|
||||||
else if (__strcasestr (step->to_name, "ISO-8859-1") != NULL)
|
else if (strcasestr (step->to_name, "ISO-8859-1") != NULL)
|
||||||
dir = to_iso88591;
|
dir = to_iso88591;
|
||||||
else
|
else
|
||||||
dir = illegal;
|
dir = illegal;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Mapping tables for SJIS handling.
|
/* Mapping tables for SJIS handling.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -4004,9 +4004,9 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
|||||||
enum direction dir;
|
enum direction dir;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (__strcasestr (step->from_name, "SJIS") != NULL)
|
if (strcasestr (step->from_name, "SJIS") != NULL)
|
||||||
dir = from_sjis;
|
dir = from_sjis;
|
||||||
else if (__strcasestr (step->to_name, "SJIS") != NULL)
|
else if (strcasestr (step->to_name, "SJIS") != NULL)
|
||||||
dir = to_sjis;
|
dir = to_sjis;
|
||||||
else
|
else
|
||||||
dir = illegal;
|
dir = illegal;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Generic conversion to and from T.61.
|
/* Generic conversion to and from T.61.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -385,9 +385,9 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
|
|||||||
enum direction dir;
|
enum direction dir;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (__strcasestr (step->from_name, "T.61") != NULL)
|
if (strcasestr (step->from_name, "T.61") != NULL)
|
||||||
dir = from_t61;
|
dir = from_t61;
|
||||||
else if (__strcasestr (step->to_name, "T.61") != NULL)
|
else if (strcasestr (step->to_name, "T.61") != NULL)
|
||||||
dir = to_t61;
|
dir = to_t61;
|
||||||
else
|
else
|
||||||
dir = illegal;
|
dir = illegal;
|
||||||
|
@ -82,7 +82,7 @@ struct termios
|
|||||||
#define ONLRET 0000040
|
#define ONLRET 0000040
|
||||||
#define OFILL 0000100
|
#define OFILL 0000100
|
||||||
#define OFDEL 0000200
|
#define OFDEL 0000200
|
||||||
#if !defined __USE_POSIX || defined __USE_UNIX98
|
#if defined __USE_MISC || defined __USE_UNIX98
|
||||||
# define NLDLY 0000400
|
# define NLDLY 0000400
|
||||||
# define NL0 0000000
|
# define NL0 0000000
|
||||||
# define NL1 0000400
|
# define NL1 0000400
|
||||||
@ -108,12 +108,12 @@ struct termios
|
|||||||
#define VT0 0000000
|
#define VT0 0000000
|
||||||
#define VT1 0040000
|
#define VT1 0040000
|
||||||
|
|
||||||
#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
|
#ifdef __USE_MISC
|
||||||
# define XTABS 0014000
|
# define XTABS 0014000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* c_cflag bit meaning */
|
/* c_cflag bit meaning */
|
||||||
#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
|
#ifdef __USE_MISC
|
||||||
# define CBAUD 0010017
|
# define CBAUD 0010017
|
||||||
#endif
|
#endif
|
||||||
#define B0 0000000 /* hang up */
|
#define B0 0000000 /* hang up */
|
||||||
@ -132,7 +132,7 @@ struct termios
|
|||||||
#define B9600 0000015
|
#define B9600 0000015
|
||||||
#define B19200 0000016
|
#define B19200 0000016
|
||||||
#define B38400 0000017
|
#define B38400 0000017
|
||||||
#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
|
#ifdef __USE_MISC
|
||||||
# define EXTA B19200
|
# define EXTA B19200
|
||||||
# define EXTB B38400
|
# define EXTB B38400
|
||||||
#endif
|
#endif
|
||||||
@ -147,14 +147,14 @@ struct termios
|
|||||||
#define PARODD 0001000
|
#define PARODD 0001000
|
||||||
#define HUPCL 0002000
|
#define HUPCL 0002000
|
||||||
#define CLOCAL 0004000
|
#define CLOCAL 0004000
|
||||||
#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
|
#ifdef __USE_MISC
|
||||||
# define CBAUDEX 0010000
|
# define CBAUDEX 0010000
|
||||||
#endif
|
#endif
|
||||||
#define B57600 0010001
|
#define B57600 0010001
|
||||||
#define B115200 0010002
|
#define B115200 0010002
|
||||||
#define B230400 0010003
|
#define B230400 0010003
|
||||||
#define B460800 0010004
|
#define B460800 0010004
|
||||||
#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
|
#ifdef __USE_MISC
|
||||||
# define CIBAUD 002003600000 /* input baud rate (not used) */
|
# define CIBAUD 002003600000 /* input baud rate (not used) */
|
||||||
# define CRTSCTS 020000000000 /* flow control */
|
# define CRTSCTS 020000000000 /* flow control */
|
||||||
#endif
|
#endif
|
||||||
@ -162,7 +162,7 @@ struct termios
|
|||||||
/* c_lflag bits */
|
/* c_lflag bits */
|
||||||
#define ISIG 0000001
|
#define ISIG 0000001
|
||||||
#define ICANON 0000002
|
#define ICANON 0000002
|
||||||
#if !defined __USE_POSIX || defined __USE_UNIX98
|
#if defined __USE_MISC || defined __USE_UNIX98
|
||||||
# define XCASE 0000004
|
# define XCASE 0000004
|
||||||
#endif
|
#endif
|
||||||
#define ECHO 0000010
|
#define ECHO 0000010
|
||||||
@ -171,7 +171,7 @@ struct termios
|
|||||||
#define ECHONL 0000100
|
#define ECHONL 0000100
|
||||||
#define NOFLSH 0000200
|
#define NOFLSH 0000200
|
||||||
#define TOSTOP 0000400
|
#define TOSTOP 0000400
|
||||||
#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
|
#ifdef __USE_MISC
|
||||||
# define ECHOCTL 0001000
|
# define ECHOCTL 0001000
|
||||||
# define ECHOPRT 0002000
|
# define ECHOPRT 0002000
|
||||||
# define ECHOKE 0004000
|
# define ECHOKE 0004000
|
||||||
|
@ -35,7 +35,7 @@ unlockpt (fd)
|
|||||||
|
|
||||||
if (ioctl (fd, TIOCSPTLCK, &unlock))
|
if (ioctl (fd, TIOCSPTLCK, &unlock))
|
||||||
{
|
{
|
||||||
if(errno == EINVAL)
|
if (errno == EINVAL)
|
||||||
{
|
{
|
||||||
__set_errno (serrno);
|
__set_errno (serrno);
|
||||||
return 0;
|
return 0;
|
||||||
@ -43,8 +43,7 @@ unlockpt (fd)
|
|||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
/* On pre-/dev/ptmx kernels this function should be a no-op. */
|
/* On pre-/dev/ptmx kernels this function should be a no-op. */
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user