OSDN Git Service

If /etc/ld.so.preload was size 0, the shared lib loader would
authorEric Andersen <andersen@codepoet.org>
Mon, 6 Aug 2001 19:27:51 +0000 (19:27 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 6 Aug 2001 19:27:51 +0000 (19:27 -0000)
choke and die.  Test for non-zero size as well,
 -Erik

ldso/ldso/boot1.c
ldso/ldso/ldso.c

index 4a3dbce..038a68d 100644 (file)
@@ -672,7 +672,7 @@ found_got:
                        struct stat st;
                        char *preload;
 
-                       if (!_dl_stat(LDSO_PRELOAD, &st)) {
+                       if (!_dl_stat(LDSO_PRELOAD, &st) && st.st_size > 0) {
                                if ((fd = _dl_open(LDSO_PRELOAD, O_RDONLY)) < 0) {
                                        _dl_fprintf(2, "%s: can't open file '%s'\n", 
                                                _dl_progname, LDSO_PRELOAD);
index 4a3dbce..038a68d 100644 (file)
@@ -672,7 +672,7 @@ found_got:
                        struct stat st;
                        char *preload;
 
-                       if (!_dl_stat(LDSO_PRELOAD, &st)) {
+                       if (!_dl_stat(LDSO_PRELOAD, &st) && st.st_size > 0) {
                                if ((fd = _dl_open(LDSO_PRELOAD, O_RDONLY)) < 0) {
                                        _dl_fprintf(2, "%s: can't open file '%s'\n", 
                                                _dl_progname, LDSO_PRELOAD);