* elf/rtld.c (dl_main): Don't fail execution if file named in
	ld.so.preload is not present.
This commit is contained in:
Ulrich Drepper 2004-02-17 02:35:52 +00:00
parent cd9fdc72ad
commit f04b9a68fe
4 changed files with 77 additions and 46 deletions

View File

@ -1,5 +1,8 @@
2004-02-16 Ulrich Drepper <drepper@redhat.com> 2004-02-16 Ulrich Drepper <drepper@redhat.com>
* elf/rtld.c (dl_main): Don't fail execution if file named in
ld.so.preload is not present.
* sysdeps/posix/getaddrinfo.c (getaddrinfo): Undo unintended * sysdeps/posix/getaddrinfo.c (getaddrinfo): Undo unintended
changes in last patch. changes in last patch.

View File

@ -514,8 +514,11 @@ struct map_args
{ {
/* Argument to map_doit. */ /* Argument to map_doit. */
char *str; char *str;
struct link_map *loader;
int is_preloaded;
int mode;
/* Return value of map_doit. */ /* Return value of map_doit. */
struct link_map *main_map; struct link_map *map;
}; };
/* Arguments to version_check_doit. */ /* Arguments to version_check_doit. */
@ -537,8 +540,9 @@ static void
map_doit (void *a) map_doit (void *a)
{ {
struct map_args *args = (struct map_args *) a; struct map_args *args = (struct map_args *) a;
args->main_map = INTUSE(_dl_map_object) (NULL, args->str, 0, lt_library, 0, args->map = INTUSE(_dl_map_object) (args->loader, args->str,
__RTLD_OPENEXEC); args->is_preloaded, lt_library, 0,
args->mode);
} }
static void static void
@ -798,6 +802,9 @@ of this helper program; chances are you did not intend to run this program.\n\
struct map_args args; struct map_args args;
args.str = rtld_progname; args.str = rtld_progname;
args.loader = NULL;
args.is_preloaded = 0;
args.mode = __RTLD_OPENEXEC;
(void) INTUSE(_dl_catch_error) (&objname, &err_str, map_doit, &args); (void) INTUSE(_dl_catch_error) (&objname, &err_str, map_doit, &args);
if (__builtin_expect (err_str != NULL, 0)) if (__builtin_expect (err_str != NULL, 0))
/* We don't free the returned string, the programs stops /* We don't free the returned string, the programs stops
@ -1084,7 +1091,8 @@ of this helper program; chances are you did not intend to run this program.\n\
} }
/* Read the contents of the file. */ /* Read the contents of the file. */
file = _dl_sysdep_read_whole_file ("/etc/ld.so.preload", &file_size, const char preload_file[] = "/etc/ld.so.preload";
file = _dl_sysdep_read_whole_file (preload_file, &file_size,
PROT_READ | PROT_WRITE); PROT_READ | PROT_WRITE);
if (__builtin_expect (file != MAP_FAILED, 0)) if (__builtin_expect (file != MAP_FAILED, 0))
{ {
@ -1139,11 +1147,26 @@ of this helper program; chances are you did not intend to run this program.\n\
while ((p = strsep (&runp, ": \t\n")) != NULL) while ((p = strsep (&runp, ": \t\n")) != NULL)
if (p[0] != '\0') if (p[0] != '\0')
{ {
struct link_map *new_map = INTUSE(_dl_map_object) (GL(dl_loaded), const char *objname;
p, 1, const char *err_str = NULL;
lt_library, struct map_args args;
0, 0);
if (++new_map->l_opencount == 1) args.str = p;
args.loader = GL(dl_loaded);
args.is_preloaded = 1;
args.mode = 0;
(void) INTUSE(_dl_catch_error) (&objname, &err_str, map_doit,
&args);
if (__builtin_expect (err_str != NULL, 0))
{
_dl_error_printf ("\
ERROR: ld.so: object '%s' from %s cannot be preloaded: ignored.\n",
p, preload_file);
/* No need to call free, this is still before the libc's
malloc is used. */
}
else if (++args.map->l_opencount == 1)
/* It is no duplicate. */ /* It is no duplicate. */
++npreloads; ++npreloads;
} }

View File

@ -1,3 +1,8 @@
2004-02-16 Ulrich Drepper <drepper@redhat.com>
* locales/tr_TR: Correct sorting order of the normal and dotless I
[BZ #19].
2004-02-09 Ulrich Drepper <drepper@redhat.com> 2004-02-09 Ulrich Drepper <drepper@redhat.com>
* locales/fa_IR: Add to_outpunct info and change decimal_point and * locales/fa_IR: Add to_outpunct info and change decimal_point and

View File

@ -1132,9 +1132,9 @@ UNDEFINED IGNORE;IGNORE;IGNORE
<U1E1F> <U0046>;<DOT>;<SMALL>;IGNORE <U1E1F> <U0046>;<DOT>;<SMALL>;IGNORE
<f8> <f8>
<UFB00> "<U0046><U0046>";"<NONE><NONE>";"<UFB00><UFB00>";IGNORE <UFB00> "<U0046><U0046>";"<NONE><NONE>";"<UFB00><UFB00>";IGNORE
<UFB01> "<U0046><U0049>";"<NONE><NONE>";"<UFB01><UFB01>";IGNORE <UFB01> "<U0046><U0069>";"<NONE><NONE>";"<UFB01><UFB01>";IGNORE
<UFB02> "<U0046><U004C>";"<NONE><NONE>";"<UFB02><UFB02>";IGNORE <UFB02> "<U0046><U004C>";"<NONE><NONE>";"<UFB02><UFB02>";IGNORE
<UFB03> "<U0046><U0046><U0049>";"<NONE><NONE><NONE>";"<UFB03><UFB03><UFB03>";IGNORE <UFB03> "<U0046><U0046><U0069>";"<NONE><NONE><NONE>";"<UFB03><UFB03><UFB03>";IGNORE
<UFB04> "<U0046><U0046><U004C>";"<NONE><NONE><NONE>";"<UFB04><UFB04><UFB04>";IGNORE <UFB04> "<U0046><U0046><U004C>";"<NONE><NONE><NONE>";"<UFB04><UFB04><UFB04>";IGNORE
<U0047> <U0047>;<NONE>;<CAPITAL>;IGNORE <U0047> <U0047>;<NONE>;<CAPITAL>;IGNORE
<U0067> <U0047>;<NONE>;<SMALL>;IGNORE <U0067> <U0047>;<NONE>;<SMALL>;IGNORE
@ -1174,41 +1174,41 @@ UNDEFINED IGNORE;IGNORE;IGNORE
<h8> <h8>
<U0049> <U0131>;<NONE>;<CAPITAL>;IGNORE <U0049> <U0131>;<NONE>;<CAPITAL>;IGNORE
<U0131> <U0131>;<NONE>;<SMALL>;IGNORE <U0131> <U0131>;<NONE>;<SMALL>;IGNORE
<U0130> <U0049>;<NONE>;<CAPITAL>;IGNORE <U0130> <U0069>;<NONE>;<CAPITAL>;IGNORE
<U0069> <U0049>;<NONE>;<SMALL>;IGNORE <U0069> <U0069>;<NONE>;<SMALL>;IGNORE
<U00CD> <U0049>;<ACUTE>;<CAPITAL>;IGNORE <U00CD> <U0069>;<ACUTE>;<CAPITAL>;IGNORE
<U00ED> <U0049>;<ACUTE>;<SMALL>;IGNORE <U00ED> <U0069>;<ACUTE>;<SMALL>;IGNORE
<U00CC> <U0049>;<GRAVE>;<CAPITAL>;IGNORE <U00CC> <U0069>;<GRAVE>;<CAPITAL>;IGNORE
<U00EC> <U0049>;<GRAVE>;<SMALL>;IGNORE <U00EC> <U0069>;<GRAVE>;<SMALL>;IGNORE
<U0208> <U0049>;<DOUBLE-GRAVE>;<CAPITAL>;IGNORE <U0208> <U0069>;<DOUBLE-GRAVE>;<CAPITAL>;IGNORE
<U0209> <U0049>;<DOUBLE-GRAVE>;<SMALL>;IGNORE <U0209> <U0069>;<DOUBLE-GRAVE>;<SMALL>;IGNORE
<U012C> <U0049>;<BREVE>;<CAPITAL>;IGNORE <U012C> <U0069>;<BREVE>;<CAPITAL>;IGNORE
<U012D> <U0049>;<BREVE>;<SMALL>;IGNORE <U012D> <U0069>;<BREVE>;<SMALL>;IGNORE
<U020A> <U0049>;<INVERTED-BREVE>;<CAPITAL>;IGNORE <U020A> <U0069>;<INVERTED-BREVE>;<CAPITAL>;IGNORE
<U020B> <U0049>;<INVERTED-BREVE>;<SMALL>;IGNORE <U020B> <U0069>;<INVERTED-BREVE>;<SMALL>;IGNORE
<U00CE> <U0049>;<CIRCUMFLEX>;<CAPITAL>;IGNORE <U00CE> <U0069>;<CIRCUMFLEX>;<CAPITAL>;IGNORE
<U00EE> <U0049>;<CIRCUMFLEX>;<SMALL>;IGNORE <U00EE> <U0069>;<CIRCUMFLEX>;<SMALL>;IGNORE
<U01CF> <U0049>;<CARON>;<CAPITAL>;IGNORE <U01CF> <U0069>;<CARON>;<CAPITAL>;IGNORE
<U01D0> <U0049>;<CARON>;<SMALL>;IGNORE <U01D0> <U0069>;<CARON>;<SMALL>;IGNORE
<U00CF> <U0049>;<DIAERESIS>;<CAPITAL>;IGNORE <U00CF> <U0069>;<DIAERESIS>;<CAPITAL>;IGNORE
<U00EF> <U0049>;<DIAERESIS>;<SMALL>;IGNORE <U00EF> <U0069>;<DIAERESIS>;<SMALL>;IGNORE
<U1E2E> <U0049>;<DIAERESIS+ACUTE>;<CAPITAL>;IGNORE <U1E2E> <U0069>;<DIAERESIS+ACUTE>;<CAPITAL>;IGNORE
<U1E2F> <U0049>;<DIAERESIS+ACUTE>;<SMALL>;IGNORE <U1E2F> <U0069>;<DIAERESIS+ACUTE>;<SMALL>;IGNORE
<U1EC8> <U0049>;<HOOK>;<CAPITAL>;IGNORE <U1EC8> <U0069>;<HOOK>;<CAPITAL>;IGNORE
<U1EC9> <U0049>;<HOOK>;<SMALL>;IGNORE <U1EC9> <U0069>;<HOOK>;<SMALL>;IGNORE
<U0128> <U0049>;<TILDE>;<CAPITAL>;IGNORE <U0128> <U0069>;<TILDE>;<CAPITAL>;IGNORE
<U0129> <U0049>;<TILDE>;<SMALL>;IGNORE <U0129> <U0069>;<TILDE>;<SMALL>;IGNORE
<U1E2C> <U0049>;<TILDE-BELOW>;<CAPITAL>;IGNORE <U1E2C> <U0069>;<TILDE-BELOW>;<CAPITAL>;IGNORE
<U1E2D> <U0049>;<TILDE-BELOW>;<SMALL>;IGNORE <U1E2D> <U0069>;<TILDE-BELOW>;<SMALL>;IGNORE
<U1ECA> <U0049>;<DOT-BELOW>;<CAPITAL>;IGNORE <U1ECA> <U0069>;<DOT-BELOW>;<CAPITAL>;IGNORE
<U1ECB> <U0049>;<DOT-BELOW>;<SMALL>;IGNORE <U1ECB> <U0069>;<DOT-BELOW>;<SMALL>;IGNORE
<U012E> <U0049>;<OGONEK>;<CAPITAL>;IGNORE <U012E> <U0069>;<OGONEK>;<CAPITAL>;IGNORE
<U012F> <U0049>;<OGONEK>;<SMALL>;IGNORE <U012F> <U0069>;<OGONEK>;<SMALL>;IGNORE
<U012A> <U0049>;<MACRON>;<CAPITAL>;IGNORE <U012A> <U0069>;<MACRON>;<CAPITAL>;IGNORE
<U012B> <U0049>;<MACRON>;<SMALL>;IGNORE <U012B> <U0069>;<MACRON>;<SMALL>;IGNORE
<i8> <i8>
<U0132> "<U0049><U004A>";"<U0132><U0132>";"<CAPITAL><CAPITAL>";IGNORE <U0132> "<U0069><U004A>";"<U0132><U0132>";"<CAPITAL><CAPITAL>";IGNORE
<U0133> "<U0049><U004A>";"<U0132><U0132>";"<SMALL><SMALL>";IGNORE <U0133> "<U0069><U004A>";"<U0132><U0132>";"<SMALL><SMALL>";IGNORE
<U004A> <U004A>;<NONE>;<CAPITAL>;IGNORE <U004A> <U004A>;<NONE>;<CAPITAL>;IGNORE
<U006A> <U004A>;<NONE>;<SMALL>;IGNORE <U006A> <U004A>;<NONE>;<SMALL>;IGNORE
<U0134> <U004A>;<CIRCUMFLEX>;<CAPITAL>;IGNORE <U0134> <U004A>;<CIRCUMFLEX>;<CAPITAL>;IGNORE
@ -3553,7 +3553,7 @@ END LC_MEASUREMENT
LC_NAME LC_NAME
name_fmt "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/ name_fmt "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
<U0025><U006D><U0025><U0074><U0025><U0066>" <U0025><U006D><U0025><U0074><U0025><U0066>"
% Say-Mýn-A % Say.MŽýn
name_gen "<U0053><U0061><U0079><U0131><U006E>" name_gen "<U0053><U0061><U0079><U0131><U006E>"
% Bay % Bay
name_mr "<U0042><U0061><U0079>" name_mr "<U0042><U0061><U0079>"