Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/pecoff Read /usr/libexec/ld.so.dll if failed to read



details:   https://anonhg.NetBSD.org/src/rev/e93654e28dae
branches:  trunk
changeset: 524310:e93654e28dae
user:      oki <oki%NetBSD.org@localhost>
date:      Sun Mar 24 05:55:49 2002 +0000

description:
Read /usr/libexec/ld.so.dll if failed to read
 /emul/pecoff/usr/libexec/ld.so.dll.
reported via IRC from kent, thanks.

diffstat:

 sys/compat/pecoff/pecoff_exec.c |  17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 21b986052bf8 -r e93654e28dae sys/compat/pecoff/pecoff_exec.c
--- a/sys/compat/pecoff/pecoff_exec.c   Sun Mar 24 05:55:31 2002 +0000
+++ b/sys/compat/pecoff/pecoff_exec.c   Sun Mar 24 05:55:49 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pecoff_exec.c,v 1.15 2002/03/18 07:11:06 oki Exp $     */
+/*     $NetBSD: pecoff_exec.c,v 1.16 2002/03/24 05:55:49 oki Exp $     */
 
 /*
  * Copyright (c) 2000 Masaru OKI
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pecoff_exec.c,v 1.15 2002/03/18 07:11:06 oki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pecoff_exec.c,v 1.16 2002/03/24 05:55:49 oki Exp $");
 
 /*#define DEBUG_PECOFF*/
 
@@ -203,8 +203,17 @@
        const char *bp;
 
        if ((error = emul_find(p, NULL, epp->ep_esch->es_emul->e_path,
-                              path, &bp, 0)))
-               return error;
+                              path, &bp, 0))) {
+               char *ptr;
+               int len;
+
+               len = strlen(path) + 1;
+               if (len > MAXPATHLEN)
+                       return error;
+               ptr = malloc(len, M_TEMP, M_WAITOK);
+               copystr(path, ptr, len, 0);
+               bp = ptr;
+       }
        NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, bp, p);
        if ((error = namei(&nd)) != 0) {
                free((void *)bp, M_TEMP);



Home | Main Index | Thread Index | Old Index