Bug#2279: depmod creates files modprobe won't grok
Package: modules
Version: 1.2.8-1
AFAIK this doesn't happen with standard debian packages, I noticed it
only when modprobing modules from a locally installed ISDN package
(Matthias Urlich's isdn driver)
When a module depends on > 4 modules, depmod will break the line using
the `\` convention but modprobe can't read continuation lines !!!
The error persists in 1.3.57, as a workaround the patch below (against
1.3.57) disables line splitting and increases buffer sizes.
For depmod's author: personally I appreciate you are writing this in
C++, but I suggest you use one of the suffixes .C, .cc or even .cpp on
your source files.
Greetings
Siggy
diff -ur orig/modules-1.3.57/depmod/modprobe.c bora/modules-1.3.57/depmod/modprobe.c
--- orig/modules-1.3.57/depmod/modprobe.c Fri Dec 29 22:31:24 1995
+++ bora/modules-1.3.57/depmod/modprobe.c Sat Feb 3 14:04:08 1996
@@ -1,3 +1,4 @@
+/* -*- C++ -*- */
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@@ -191,10 +192,10 @@
depmod_error ("Can't open dependancies file %s (%s)"
,cfgfile,strerror(errno));
}else{
- char buf[300];
+ char buf[4096];
ret = 0;
while(fgets(buf,sizeof(buf)-1,fin)!=NULL){
- char line[300];
+ char line[4096];
str_strip (buf,line);
if (line[0] != '\0'){
char *pt = line;
diff -ur orig/modules-1.3.57/depmod/module2.c bora/modules-1.3.57/depmod/module2.c
--- orig/modules-1.3.57/depmod/module2.c Tue Dec 26 10:21:30 1995
+++ bora/modules-1.3.57/depmod/module2.c Sat Feb 3 09:48:20 1996
@@ -1,3 +1,4 @@
+/* -*- C++ -*- */
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
@@ -54,8 +55,7 @@
qsort(tbdep,nbdepmod,sizeof(MODULE*),cmp);
fprintf (fout,"%s:",ptmod->name);
for (int m=0; m<nbdepmod; m++){
- if (m != 0 && (m & 3) == 0) fprintf (fout,"\\\n");
- fprintf (fout,"\t%s",tbdep[m]->name);
+ fprintf (fout," %s",tbdep[m]->name);
}
fprintf (fout,"\n\n");
}
--
mailto:bsb@uni-muenster.de // programmer/admin for hire
bsb@beck.westfalen.de \\ Opinions are strictly my own,
voice: +49-251-8619-99 \\ everything else is GPLed
http://www.westfalen.de/private/beck/
Reply to: