(inet_network): Add missing part of last patch.

This commit is contained in:
Ulrich Drepper 2000-02-12 07:38:04 +00:00
parent e87f0c3347
commit dcaa768e2e
3 changed files with 22 additions and 17 deletions

View File

@ -83,6 +83,8 @@ again:
} }
if (*cp && !isspace(*cp)) if (*cp && !isspace(*cp))
return (INADDR_NONE); return (INADDR_NONE);
if (pp >= parts + 4 || val > 0xff)
return (INADDR_NONE);
*pp++ = val; *pp++ = val;
n = pp - parts; n = pp - parts;
for (val = 0, i = 0; i < n; i++) { for (val = 0, i = 0; i < n; i++) {

View File

@ -3,7 +3,7 @@
"Keep this file name-space clean" means, talk to drepper@gnu.org "Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it! before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc. Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -517,6 +517,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
int *longind; int *longind;
int long_only; int long_only;
{ {
int print_errors = opterr;
if (optstring[0] == ':')
print_errors = 0;
optarg = NULL; optarg = NULL;
if (optind == 0 || !__getopt_initialized) if (optind == 0 || !__getopt_initialized)
@ -673,7 +677,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (ambig && !exact) if (ambig && !exact)
{ {
if (opterr) if (print_errors)
fprintf (stderr, _("%s: option `%s' is ambiguous\n"), fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]); argv[0], argv[optind]);
nextchar += strlen (nextchar); nextchar += strlen (nextchar);
@ -694,7 +698,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = nameend + 1; optarg = nameend + 1;
else else
{ {
if (opterr) if (print_errors)
{ {
if (argv[optind - 1][1] == '-') if (argv[optind - 1][1] == '-')
/* --option */ /* --option */
@ -720,7 +724,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = argv[optind++]; optarg = argv[optind++];
else else
{ {
if (opterr) if (print_errors)
fprintf (stderr, fprintf (stderr,
_("%s: option `%s' requires an argument\n"), _("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]); argv[0], argv[optind - 1]);
@ -747,7 +751,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (!long_only || argv[optind][1] == '-' if (!long_only || argv[optind][1] == '-'
|| my_index (optstring, *nextchar) == NULL) || my_index (optstring, *nextchar) == NULL)
{ {
if (opterr) if (print_errors)
{ {
if (argv[optind][1] == '-') if (argv[optind][1] == '-')
/* --option */ /* --option */
@ -777,7 +781,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (temp == NULL || c == ':') if (temp == NULL || c == ':')
{ {
if (opterr) if (print_errors)
{ {
if (posixly_correct) if (posixly_correct)
/* 1003.2 specifies the format of this message. */ /* 1003.2 specifies the format of this message. */
@ -811,7 +815,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
} }
else if (optind == argc) else if (optind == argc)
{ {
if (opterr) if (print_errors)
{ {
/* 1003.2 specifies the format of this message. */ /* 1003.2 specifies the format of this message. */
fprintf (stderr, _("%s: option requires an argument -- %c\n"), fprintf (stderr, _("%s: option requires an argument -- %c\n"),
@ -860,7 +864,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
} }
if (ambig && !exact) if (ambig && !exact)
{ {
if (opterr) if (print_errors)
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]); argv[0], argv[optind]);
nextchar += strlen (nextchar); nextchar += strlen (nextchar);
@ -878,7 +882,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = nameend + 1; optarg = nameend + 1;
else else
{ {
if (opterr) if (print_errors)
fprintf (stderr, _("\ fprintf (stderr, _("\
%s: option `-W %s' doesn't allow an argument\n"), %s: option `-W %s' doesn't allow an argument\n"),
argv[0], pfound->name); argv[0], pfound->name);
@ -893,7 +897,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optarg = argv[optind++]; optarg = argv[optind++];
else else
{ {
if (opterr) if (print_errors)
fprintf (stderr, fprintf (stderr,
_("%s: option `%s' requires an argument\n"), _("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]); argv[0], argv[optind - 1]);
@ -940,12 +944,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
} }
else if (optind == argc) else if (optind == argc)
{ {
if (opterr) if (print_errors)
{ {
/* 1003.2 specifies the format of this message. */ /* 1003.2 specifies the format of this message. */
fprintf (stderr, fprintf (stderr,
_("%s: option requires an argument -- %c\n"), _("%s: option requires an argument -- %c\n"),
argv[0], c); argv[0], c);
} }
optopt = c; optopt = c;
if (optstring[0] == ':') if (optstring[0] == ':')

View File

@ -90,6 +90,7 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{ {
struct __old_shmid_ds old; struct __old_shmid_ds old;
int result;
# ifdef __NR_getuid32 # ifdef __NR_getuid32
if (__libc_missing_32bit_uids <= 0) if (__libc_missing_32bit_uids <= 0)
@ -107,10 +108,8 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
__set_errno(save_errno); __set_errno(save_errno);
} }
if (__libc_missing_32bit_uids <= 0) if (__libc_missing_32bit_uids <= 0)
{ return INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64,
result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf); 0, buf);
return result;
}
} }
# endif # endif