Subject: bin/24379: modload(8) failure if module file name exceed 80 characters
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <njoly@pasteur.fr>
List: netbsd-bugs
Date: 02/10/2004 11:52:09
>Number: 24379
>Category: bin
>Synopsis: modload(8) failure if module file name exceed 80 characters
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Feb 10 10:53:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Nicolas Joly
>Release: NetBSD 1.6ZI (-current 20040209)
>Organization:
Institut Pasteur
>Environment:
System: NetBSD hal.sis.pasteur.fr 1.6ZI NetBSD 1.6ZI (HAL) #0: Mon Feb 9 14:48:34 CET 2004 njoly@hal.sis.pasteur.fr:/local/src/NetBSD/obj/i386/sys/arch/i386/compile/HAL i386
Architecture: i386
Machine: i386
>Description:
modload(8) does not load kernel modules if file name is longer than 80
characters :
root@hal [~]# modload /local/src/DRI2/xc/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/tdfx/tdfx.o
modload: module object must end in .o
root@hal [~]# ident /sbin/modload
/sbin/modload:
$NetBSD: crt0.c,v 1.13 2003/07/26 19:24:27 salo Exp $
$NetBSD: modload.c,v 1.41 2003/09/06 19:23:20 jdolecek Exp $
$NetBSD: elf.c,v 1.15 2003/10/21 02:31:08 fvdl Exp $
>How-To-Repeat:
run modload with a long absolute file name.
>Fix:
Replace hard coded 80 characters with `MAXPATHLEN+1'.
Index: sbin/modload/modload.c
===================================================================
RCS file: /cvsroot/src/sbin/modload/modload.c,v
retrieving revision 1.41
diff -u -r1.41 modload.c
--- sbin/modload/modload.c 2003/09/06 19:23:20 1.41
+++ sbin/modload/modload.c 2004/02/10 10:43:50
@@ -251,7 +251,7 @@
char *post = NULL;
char *ldscript = NULL;
char *modobj;
- char modout[80], *p;
+ char modout[MAXPATHLEN+1], *p;
struct stat stb;
int strtablen;
size_t modsize; /* XXX */
>Release-Note:
>Audit-Trail:
>Unformatted: