Your message dated Mon, 16 Jul 2007 18:53:40 +0200
with message-id <[EMAIL PROTECTED]>
and subject line Removed
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: modutils
Version: 2.4.11-1
Severity: normal
Tags: patch
Modprobe almost implements MS-DOS-style wildcards ('*' is very hungry, '?'
is not implemented) when matching aliases, not shell-style globbing as
needed by devfsd.
To get autoloading to work together with devfsd, I have the lines
# SCSI CD-ROMs
probeall /dev/sr scsi-hosts sr_mod
alias /dev/sr* /dev/sr
alias /dev/scsi/*/cd sr_mod
[...]
# SCSI generic
probeall /dev/sg scsi-hosts sg
alias /dev/sg* /dev/sg
alias /dev/scsi/*/generic /dev/sg
in /etc/modutils/1devfsd (and thusly in /etc/modules.conf) and when saying
'modprobe /dev/scsi/host0/bus0/target6/lun0/generic' (as devfsd would) I was
somewhat surprised to see modprobe load 'sr_mod' instead.
Reading the source (modprobe.c:any_alias()), I found that '*' made modprobe
stop the name matching and report success , effectively rewriting the
relevant lines into
alias /dev/scsi/* sr_mod
alias /dev/scsi/* /dev/sg
which obviously clashes, with undefined results. Interesingly enough, a
comment in any_alias() promises that "shell-globbing aliases [are] allowed".
The enclosed patch makes good on that promise.
My patch uses fnmatch(3) for pattern matching. The 'flags' argument is a
matter of policy --- no matter what --- and should be chosen with some care.
As can be seen I set the FNM_EXTMATCH flag for some nifty Korn shell
extensions. Additionally, the FNM_FILE_NAME flag looks like a good flag to
use, or equally, to avoid.
The man-page changes should be rechecked (and maybe rewritten for greater
clarity).
It might be useful to forward this report (and patch) to the upstream
mmaintainer.
/Sverker Wiberg
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux catskinner 2.4.15-greased-turkey #1 Sun Nov 25 16:52:43 CET 2001
i686
Locale: LANG=C, LC_CTYPE=
Versions of packages modutils depends on:
ii libc6 2.2.4-6 GNU C Library: Shared libraries an
ii sysvinit 2.84-1 System-V like init.
Versions of other packages mentioned:
ii devfsd 1.3.19-1 Daemon for the device filesystem
diff -urb modutils-2.4.11.orig/insmod/modprobe.c
modutils-2.4.11/insmod/modprobe.c
--- modutils-2.4.11.orig/insmod/modprobe.c Mon Feb 26 02:07:17 2001
+++ modutils-2.4.11/insmod/modprobe.c Sun Dec 2 00:11:44 2001
@@ -29,6 +29,7 @@
#include <errno.h>
#include <stdlib.h>
#include <getopt.h>
+#include <fnmatch.h>
#include <ctype.h>
#include <limits.h>
#include <sys/param.h>
@@ -180,7 +181,7 @@
static const char *any_alias(const char *mod)
{
int i;
- const char *newmod;
+ const char *glob_match = NULL;
/*
* Specification: /etc/modules.conf / alias / format
@@ -202,28 +203,20 @@
}
/* else maybe devfs, check full name (shell-globbing aliases allowed) */
for (i = 0; aliases && aliases[i].name; i++) {
- char *p = aliases[i].name;
- const char *q = mod;
-
- for (; *p && *q; ++p, ++q) {
- if (*p == '*') /* ok break */
- break;
- if (*p != *q && *p != '?') /* failed */
+ /* Exact match? */
+ if(strcmp(aliases[i].name, mod) == 0) {
+ if (aliases[i].opts && aliases[i].opts->pathc)
+ return aliases[i].opts->pathv[0];
break;
}
-
- if (*p == '*' || (*p == '\0' && *q == '\0')) {
- if (aliases[i].opts && aliases[i].opts->pathc) {
- newmod = aliases[i].opts->pathv[0];
- if (strcmp(mod, newmod))
- return(newmod);
- else
- return(NULL);
- }
- break;
+ /* Globbing match? */
+ if(fnmatch(aliases[i].name, mod, FNM_EXTMATCH) == 0) {
+ if (aliases[i].opts && aliases[i].opts->pathc)
+ glob_match = aliases[i].opts->pathv[0];
}
}
- return NULL;
+
+ return glob_match;
}
static NODE *lookup(NODE * nod, const char *str)
diff -urb modutils-2.4.11.orig/man/modprobe.8 modutils-2.4.11/man/modprobe.8
--- modutils-2.4.11.orig/man/modprobe.8 Wed Aug 15 14:44:20 2001
+++ modutils-2.4.11/man/modprobe.8 Sat Dec 1 22:02:51 2001
@@ -93,15 +93,21 @@
can also be used to select
(and override)
a different
-configuration file from the default /etc/modules.conf (or
-/etc/conf.modules (deprecated)).
+configuration file from the default
+.I /etc/modules.conf
+(or
+.I /etc/conf.modules
+(deprecated)).
.TP
.B Note:
-Module names must not contain paths (no '/') nor may they contain the
-trailing '.o'. For example, slip is a valid module name for
+Module names may contain paths ('/') but may not contain the trailing
+\'.o'. For example, psaux and /dev/misc/psaux are valid module names for
.IR modprobe ,
-/lib/modules/2.2.19/net/slip and slip.o are invalid. This applies to
-the command line and to entries in the configfile.
+while psaux.o is invalid (also the final module name must be plain (no
+\'/', like 'psaux'): Thus names with paths (such as '/dev/misc/psaux')
+are only permitted when defining or using various mappings (alias,
+probe or probeall)). This applies to the command line and to entries
+in the configfile.
.SH DESCRIPTION
The
.B modprobe
diff -urb modutils-2.4.11.orig/man/modules.conf.5
modutils-2.4.11/man/modules.conf.5
--- modutils-2.4.11.orig/man/modules.conf.5 Sun Nov 11 06:06:44 2001
+++ modutils-2.4.11/man/modules.conf.5 Sat Dec 1 21:43:57 2001
@@ -328,7 +328,26 @@
.fi
makes it possible to write
.B "modprobe iso9660"
-although there is no object file for such a module available.
+although there is no object file for such a module available. The
+alias name is either a plain string or (for devfs compatibility) a
+.BR glob (7)-style
+pattern. Such a pattern must begin with a '/' character as in the line:
+.nf
+
+ alias /dev/sr[0-4] sr_mod
+
+.fi
+Exact matches are preferred before globs, but globs are not ranked
+individually. This means that with the mappings
+.nf
+
+ alias a0 Alice
+ alias a? Bob
+ alias a* Charlie
+
+.fi
+the name 'a0' will expand to 'Alice', while 'a1' expands to either 'Bob' or
+\'Charlie' (it is undefined which one).
.br
Note that the line:
.nf
--- End Message ---
--- Begin Message ---
This package has been removed from Debian unstable. I'm therefore
closing this bug report. The package has been removed because it
has been replaced by module-init-tools. modutils was for 2.4 kernels
only. It's quite unlikely that your bug still exists in
module-init-tools, but please let me know if it does.
--
Martin Michlmayr
http://www.cyrius.com/
--- End Message ---