mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
update from main archive 960815
This commit is contained in:
parent
ad86485dcf
commit
2de99474c3
@ -18,7 +18,7 @@ case $# in
|
||||
*) file="./$1" ;;
|
||||
esac
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec "$file" && exit 1
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
fi
|
||||
@ -32,7 +32,7 @@ case $# in
|
||||
*) file="./$file" ;;
|
||||
esac
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 "$file"
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
fi
|
||||
|
27
elf/rtld.c
27
elf/rtld.c
@ -126,10 +126,12 @@ dl_main (const ElfW(Phdr) *phdr,
|
||||
const ElfW(Phdr) *ph;
|
||||
struct link_map *l;
|
||||
int lazy;
|
||||
enum { normal, list, verify } mode = normal;
|
||||
enum { normal, list, verify, trace } mode;
|
||||
struct link_map **preloads;
|
||||
unsigned int npreloads;
|
||||
|
||||
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
|
||||
|
||||
if (*user_entry == (ElfW(Addr)) &_start)
|
||||
{
|
||||
/* Ho ho. We are not the program interpreter! We are the program
|
||||
@ -187,7 +189,22 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
if (mode == verify)
|
||||
{
|
||||
void doit (void)
|
||||
{
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
}
|
||||
const char *err_str = NULL;
|
||||
const char *obj_name __attribute__ ((unused));
|
||||
|
||||
(void) _dl_catch_error (&err_str, &obj_name, doit);
|
||||
if (err_str != NULL)
|
||||
_exit (EXIT_FAILURE);
|
||||
}
|
||||
else
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library);
|
||||
|
||||
phdr = l->l_phdr;
|
||||
phent = l->l_phnum;
|
||||
l->l_name = (char *) "";
|
||||
@ -197,7 +214,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
{
|
||||
/* Create a link_map for the executable itself.
|
||||
This will be what dlopen on "" returns. */
|
||||
l = _dl_new_object ((char *) "", "", lt_library);
|
||||
l = _dl_new_object ((char *) "", "", lt_executable);
|
||||
l->l_phdr = phdr;
|
||||
l->l_phnum = phent;
|
||||
l->l_entry = *user_entry;
|
||||
@ -340,7 +357,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != normal || getenv ("LD_TRACE_LOADED_OBJECTS") != NULL)
|
||||
if (mode != normal)
|
||||
{
|
||||
/* We were run just to list the shared libraries. It is
|
||||
important that we do this before real relocation, because the
|
||||
@ -363,7 +380,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
" (0x", bp, ")\n", NULL);
|
||||
}
|
||||
|
||||
if (mode != normal)
|
||||
if (mode != trace)
|
||||
for (i = 1; i < _dl_argc; ++i)
|
||||
{
|
||||
const ElfW(Sym) *ref = NULL;
|
||||
|
@ -38,8 +38,9 @@ static char sccsid[] = "@(#)ruserpass.c 8.3 (Berkeley) 4/2/94";
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
/*#include <err.h> */
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -81,7 +82,7 @@ int
|
||||
ruserpass(host, aname, apass)
|
||||
char *host, **aname, **apass;
|
||||
{
|
||||
char *hdir, buf[BUFSIZ], *tmp;
|
||||
char *hdir, *buf, *tmp;
|
||||
char myname[1024], *mydomain;
|
||||
int t, i, c, usedefault = 0;
|
||||
struct stat stb;
|
||||
@ -89,11 +90,14 @@ ruserpass(host, aname, apass)
|
||||
hdir = getenv("HOME");
|
||||
if (hdir == NULL)
|
||||
hdir = ".";
|
||||
|
||||
buf = alloca (strlen (hdir) + 8);
|
||||
|
||||
(void) sprintf(buf, "%s/.netrc", hdir);
|
||||
cfile = fopen(buf, "r");
|
||||
if (cfile == NULL) {
|
||||
/* if (errno != ENOENT)
|
||||
warn("%s", buf);*/
|
||||
if (errno != ENOENT)
|
||||
warn("%s", buf);
|
||||
return (0);
|
||||
}
|
||||
if (gethostname(myname, sizeof(myname)) < 0)
|
||||
@ -113,13 +117,13 @@ next:
|
||||
continue;
|
||||
/*
|
||||
* Allow match either for user's input host name
|
||||
* or official hostname. Also allow match of
|
||||
* or official hostname. Also allow match of
|
||||
* incompletely-specified host in local domain.
|
||||
*/
|
||||
if (strcasecmp(host, tokval) == 0)
|
||||
goto match;
|
||||
/* if (strcasecmp(hostname, tokval) == 0)
|
||||
goto match;
|
||||
goto match;
|
||||
if ((tmp = strchr(hostname, '.')) != NULL &&
|
||||
strcasecmp(tmp, mydomain) == 0 &&
|
||||
strncasecmp(hostname, tokval, tmp-hostname) == 0 &&
|
||||
@ -137,7 +141,7 @@ next:
|
||||
|
||||
case LOGIN:
|
||||
if (token())
|
||||
if (*aname == 0) {
|
||||
if (*aname == 0) {
|
||||
*aname = malloc((unsigned) strlen(tokval) + 1);
|
||||
(void) strcpy(*aname, tokval);
|
||||
} else {
|
||||
@ -149,8 +153,8 @@ next:
|
||||
if (strcmp(*aname, "anonymous") &&
|
||||
fstat(fileno(cfile), &stb) >= 0 &&
|
||||
(stb.st_mode & 077) != 0) {
|
||||
/* warnx("Error: .netrc file is readable by others.");
|
||||
warnx("Remove password or make file unreadable by others.");*/
|
||||
warnx(_("Error: .netrc file is readable by others."));
|
||||
warnx(_("Remove password or make file unreadable by others."));
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == 0) {
|
||||
@ -177,7 +181,7 @@ next:
|
||||
if (proxy) {
|
||||
(void) fclose(cfile);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
while ((c=getc(cfile)) != EOF && c == ' ' || c == '\t');
|
||||
if (c == EOF || c == '\n') {
|
||||
printf("Missing macdef name argument.\n");
|
||||
@ -234,7 +238,7 @@ next:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
/* warnx("Unknown .netrc keyword %s", tokval);*/
|
||||
warnx(_("Unknown .netrc keyword %s"), tokval);
|
||||
break;
|
||||
}
|
||||
goto done;
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
@c sold 0.06/1.09, print run out 21may96
|
||||
@set EDITION 0.07 DRAFT
|
||||
@set VERSION 1.09 Beta
|
||||
@set UPDATED 21 May 1996
|
||||
@set VERSION 2.00 Beta
|
||||
@set UPDATED 16 Aug 1996
|
||||
@set ISBN 1-882114-53-1
|
||||
|
||||
@ifinfo
|
||||
|
@ -17,7 +17,7 @@ scheme @dfn{Name Service Switch} (NSS).
|
||||
|
||||
Though the interface might be similar to Sun's version there is no
|
||||
common code. We never saw any source code of Sun's implementation and
|
||||
so the internal interface are incompatible. This is also manifest in the
|
||||
so the internal interface is incompatible. This is also manifests in the
|
||||
file names we use as we will see later.
|
||||
|
||||
|
||||
@ -158,9 +158,9 @@ The second item in the specification gives the user much finer control
|
||||
on the lookup process. Action items are placed between two service
|
||||
names and are written within brackets. The general form is
|
||||
|
||||
@smallexample
|
||||
[ @r{(}!@r{?} @var{status} = @var{action}@r{)+} ]
|
||||
@end smallexample
|
||||
@display
|
||||
@t{[} ( @t{!}? @var{status} @t{=} @var{action} )+ @t{]}
|
||||
@end display
|
||||
|
||||
@noindent
|
||||
where
|
||||
@ -331,6 +331,21 @@ access them. If a function is not available it is simply treated as if
|
||||
the function would return @code{unavail}
|
||||
(@pxref{Actions in the NSS configuration}).
|
||||
|
||||
The file name @file{libnss_files.so.1} would be on a @w{Solaris 2}
|
||||
system @file{nss_files.so.1}. This is the difference mentioned above.
|
||||
Sun's NSS modules are usable as modules which get indirectly loaded
|
||||
only.
|
||||
|
||||
The NSS modules in the GNU C Library are prepared to be used as normal
|
||||
libraries itself.
|
||||
@comment Fix me if necessary.
|
||||
This is @emph{not} true in the moment, though. But the different
|
||||
organization of the name space in the modules does not make it
|
||||
impossible like it is for Solaris. Now you can see why the modules are
|
||||
still libraries.@footnote{There is a second explanation: we were too
|
||||
lazy to change the Makefiles to allow the generation of shared objects
|
||||
not starting with @file{lib} but do not tell this anybody.}
|
||||
|
||||
|
||||
@node NSS Modules Interface, , NSS Module Names, NSS Module Internals
|
||||
@subsection The Interface of the Function in NSS Modules
|
||||
|
@ -624,7 +624,20 @@ time conversion (@pxref{Locales}).
|
||||
|
||||
Ordinary characters appearing in the @var{template} are copied to the
|
||||
output string @var{s}; this can include multibyte character sequences.
|
||||
Conversion specifiers are introduced by a @samp{%} character, and are
|
||||
Conversion specifiers are introduced by a @samp{%} character. Now can
|
||||
follow an optional flag which can be one of the following. These flags
|
||||
only affect the output of numbers:
|
||||
|
||||
@table @code
|
||||
@item _
|
||||
The number is padded with spaces.
|
||||
|
||||
@item -
|
||||
The number is not padded at all.
|
||||
@end table
|
||||
|
||||
The default action is to pad the number with zeros. Following to the
|
||||
flag comes the format specifier. The whole @samp{%} sequence is
|
||||
replaced in the output string as follows:
|
||||
|
||||
@table @code
|
||||
@ -643,9 +656,29 @@ The full month name according to the current locale.
|
||||
@item %c
|
||||
The preferred date and time representation for the current locale.
|
||||
|
||||
@item %C
|
||||
The century of the year.
|
||||
|
||||
@item %d
|
||||
The day of the month as a decimal number (range @code{01} to @code{31}).
|
||||
|
||||
@item %D
|
||||
The date using the format @code{%m/%d/%y}.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %d
|
||||
The day of the month like with @code{%d}, but padded with blank (range
|
||||
@code{ 1} to @code{31}).
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %h
|
||||
The abbreviated month name according to the current locale. The action
|
||||
is the same as for @code{%b}.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %H
|
||||
The hour as a decimal number, using a 24-hour clock (range @code{00} to
|
||||
@code{23}).
|
||||
@ -657,19 +690,64 @@ The hour as a decimal number, using a 12-hour clock (range @code{01} to
|
||||
@item %j
|
||||
The day of the year as a decimal number (range @code{001} to @code{366}).
|
||||
|
||||
@item %k
|
||||
The hour as a decimal number, using a 24-hour clock like @code{%H}, but
|
||||
padded with blank (range @code{ 0} to @code{23}).
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %l
|
||||
The hour as a decimal number, using a 12-hour clock like @code{%I}, but
|
||||
padded with blank (range @code{ 0} to @code{12}).
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %m
|
||||
The month as a decimal number (range @code{01} to @code{12}).
|
||||
|
||||
@item %M
|
||||
The minute as a decimal number.
|
||||
|
||||
@item %n
|
||||
A single @samp{\n} (newline) character.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %p
|
||||
Either @samp{am} or @samp{pm}, according to the given time value; or the
|
||||
corresponding strings for the current locale.
|
||||
|
||||
@item %r
|
||||
The time in decinal numbers using the format @code{%I:%M:%S %p}.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %R
|
||||
The hour and minute in decimal numbers using the format @code{%H:%M}.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %s
|
||||
The seconds since the epoch, i.e., 1 January 1970 00:00:00 UTC. Note
|
||||
that this value is the number of seconds between the epoch and the
|
||||
current date as defined by the @code{localtime} system call. It is not
|
||||
changed by the @code{--date} option.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %S
|
||||
The second as a decimal number.
|
||||
|
||||
@item %t
|
||||
A single @samp{\t} (tabulator) character.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %T
|
||||
The time using decimal numbers using the format @code{%H:%M:%S}.
|
||||
|
||||
This format is a GNU extension.
|
||||
|
||||
@item %U
|
||||
The week number of the current year as a decimal number, starting with
|
||||
the first Sunday as the first day of the first week. All days preceding
|
||||
@ -682,14 +760,14 @@ containing January 1 has four or more days in the new year it is
|
||||
considered to be week @code{1}. Otherwise it is week @code{53} of the
|
||||
previous year. This is standardized in @w{ISO 8601:1988}.
|
||||
|
||||
@item %w
|
||||
The day of the week as a decimal number, Sunday being @code{0}.
|
||||
|
||||
@item %W
|
||||
The week number of the current year as a decimal number, starting with
|
||||
the first Monday as the first day of the first week. All days preceding
|
||||
the first Monday in the year are considered to be in week @code{0}.
|
||||
|
||||
@item %w
|
||||
The day of the week as a decimal number, Sunday being @code{0}.
|
||||
|
||||
@item %x
|
||||
The preferred date representation for the current locale, but without the
|
||||
time.
|
||||
@ -704,6 +782,12 @@ The year as a decimal number, but without a century (range @code{00} to
|
||||
@item %Y
|
||||
The year as a decimal number, including the century.
|
||||
|
||||
@item %z
|
||||
@w{RFC 822}/@w{ISO 8601:1988} style numeric time zone (e.g., -0600 or
|
||||
+0100), or nothing if no time zone is determinable. This value reflects
|
||||
the @emph{current} time zone. It is not changed by the @code{--date}
|
||||
option.
|
||||
|
||||
@item %Z
|
||||
The time zone or name or abbreviation (empty if the time zone can't be
|
||||
determined).
|
||||
|
@ -42,7 +42,7 @@ struct timeval;
|
||||
typedef __fd_mask fd_mask;
|
||||
|
||||
/* Representation of a set of file descriptors. */
|
||||
#define fd_set __fd_set
|
||||
typedef __fd_set fd_set;
|
||||
|
||||
/* Maximum number of file descriptors in `fd_set'. */
|
||||
#define FD_SETSIZE __FD_SETSIZE
|
||||
|
@ -1,4 +1,4 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# GNU libc message catalog of translations
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
|
@ -75,7 +75,11 @@ Cambridge, MA 02139, USA. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static unsigned int week __P((const struct tm *const, int, int));
|
||||
/* Uncomment following line in the production version. */
|
||||
/* #define NDEBUG */
|
||||
#include <assert.h>
|
||||
|
||||
static unsigned int week __P ((const struct tm *const, int, int));
|
||||
|
||||
|
||||
#define add(n, f) \
|
||||
@ -91,7 +95,7 @@ static unsigned int week __P((const struct tm *const, int, int));
|
||||
p += (n); \
|
||||
} \
|
||||
} while (0)
|
||||
#define cpy(n, s) add((n), memcpy((PTR) p, (PTR) (s), (n)))
|
||||
#define cpy(n, s) add ((n), memcpy((PTR) p, (PTR) (s), (n)))
|
||||
|
||||
#ifdef _LIBC
|
||||
#define fmt(n, args) add((n), if (sprintf args != (n)) return 0)
|
||||
@ -187,8 +191,8 @@ strftime (s, maxsize, format, tp)
|
||||
size_t am_len = 3;
|
||||
size_t ap_len = 2;
|
||||
#endif
|
||||
size_t wkday_len = strlen(f_wkday);
|
||||
size_t month_len = strlen(f_month);
|
||||
size_t wkday_len = strlen (f_wkday);
|
||||
size_t month_len = strlen (f_month);
|
||||
const unsigned int y_week0 = week (tp, 0, 7);
|
||||
const unsigned int y_week1 = week (tp, 1, 7);
|
||||
const unsigned int y_week2 = week (tp, 1, 3);
|
||||
@ -228,10 +232,10 @@ strftime (s, maxsize, format, tp)
|
||||
const char *subfmt;
|
||||
|
||||
#if HAVE_MBLEN
|
||||
if (!isascii(*f))
|
||||
if (!isascii (*f))
|
||||
{
|
||||
/* Non-ASCII, may be a multibyte. */
|
||||
int len = mblen(f, strlen(f));
|
||||
int len = mblen (f, strlen (f));
|
||||
if (len > 0)
|
||||
{
|
||||
cpy(len, f);
|
||||
@ -242,7 +246,7 @@ strftime (s, maxsize, format, tp)
|
||||
|
||||
if (*f != '%')
|
||||
{
|
||||
add(1, *p = *f);
|
||||
add (1, *p = *f);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -268,24 +272,24 @@ strftime (s, maxsize, format, tp)
|
||||
{
|
||||
case '\0':
|
||||
case '%':
|
||||
add(1, *p = *f);
|
||||
add (1, *p = *f);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
cpy(aw_len, a_wkday);
|
||||
cpy (aw_len, a_wkday);
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
cpy(wkday_len, f_wkday);
|
||||
cpy (wkday_len, f_wkday);
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
case 'h': /* GNU extension. */
|
||||
cpy(am_len, a_month);
|
||||
cpy (am_len, a_month);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
cpy(month_len, f_month);
|
||||
cpy (month_len, f_month);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
@ -392,7 +396,7 @@ strftime (s, maxsize, format, tp)
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
cpy(ap_len, ampm);
|
||||
cpy (ap_len, ampm);
|
||||
break;
|
||||
|
||||
case 'R': /* GNU extension. */
|
||||
@ -406,17 +410,38 @@ strftime (s, maxsize, format, tp)
|
||||
case 'S':
|
||||
DO_NUMBER (2, tp->tm_sec);
|
||||
|
||||
case 's': /* GNU extension. */
|
||||
{
|
||||
struct tm writable_tm = *tp;
|
||||
unsigned long int num = (unsigned long int) mktime (&writable_tm);
|
||||
/* `3 * sizeof (unsigned long int)' is an approximation of
|
||||
the size of the decimal representation of NUM, valid
|
||||
for sizes <= 16. */
|
||||
int printed = 3 * sizeof (unsigned long int);
|
||||
maxdigits = printed;
|
||||
assert (sizeof (unsigned long int) <= 16);
|
||||
#ifdef _LIBC
|
||||
add (maxdigits, printed = sprintf (p, "%lu", num));
|
||||
#else
|
||||
add (maxdigits, sprintf (p, "%lu", num); printed = strlen (p));
|
||||
#endif
|
||||
/* Back up if fewer than MAXDIGITS chars written for pad_none. */
|
||||
p -= maxdigits - printed;
|
||||
i -= maxdigits - printed;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
#ifdef _NL_CURRENT
|
||||
subfmt = _NL_CURRENT (LC_TIME, T_FMT);
|
||||
goto subformat;
|
||||
#endif
|
||||
/* Fall through. */
|
||||
case 'T': /* GNU extenstion. */
|
||||
case 'T': /* GNU extension. */
|
||||
subfmt = "%H:%M:%S";
|
||||
goto subformat;
|
||||
|
||||
case 't': /* GNU extenstion. */
|
||||
case 't': /* GNU extension. */
|
||||
add (1, *p = '\t');
|
||||
break;
|
||||
|
||||
@ -442,8 +467,46 @@ strftime (s, maxsize, format, tp)
|
||||
cpy(zonelen, zone);
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
{
|
||||
struct tm tml = *tp;
|
||||
time_t t = mktime (&tml);
|
||||
struct tm tmg;
|
||||
int diff;
|
||||
|
||||
tml = *localtime (&t); /* Canonicalize the local time. */
|
||||
tmg = *gmtime (&t);
|
||||
|
||||
/* Compute the difference. */
|
||||
diff = tml.tm_min - tmg.tm_min;
|
||||
diff += 60 * (tml.tm_hour - tmg.tm_hour);
|
||||
|
||||
if (tml.tm_mon != tmg.tm_mon)
|
||||
{
|
||||
/* We assume no timezone differs from UTC by more than
|
||||
+- 23 hours. This should be safe. */
|
||||
if (tmg.tm_mday == 1)
|
||||
tml.tm_mday = 0;
|
||||
else /* tml.tm_mday == 1 */
|
||||
tmg.tm_mday = 0;
|
||||
}
|
||||
diff += 1440 * (tml.tm_mday - tmg.tm_mday);
|
||||
|
||||
if (diff < 0)
|
||||
{
|
||||
add (1, *p = '-');
|
||||
diff = -diff;
|
||||
}
|
||||
else
|
||||
add (1, *p = '+');
|
||||
|
||||
pad = pad_zero;
|
||||
DO_NUMBER (4, ((diff / 60) % 24) * 100 + diff % 60);
|
||||
}
|
||||
|
||||
default:
|
||||
/* Bad format. */
|
||||
add (1, *p = *f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user