public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: kay.sievers@vrfy.org, linux-kernel@vger.kernel.org
Subject: Re: modprobe bug for aliases with regular expressions
Date: Fri, 14 Apr 2006 09:19:27 -0700	[thread overview]
Message-ID: <20060414161927.GA15830@kroah.com> (raw)
In-Reply-To: <1144990770.31267.29.camel@localhost.localdomain>

On Fri, Apr 14, 2006 at 02:59:30PM +1000, Rusty Russell wrote:
> On Thu, 2006-04-13 at 16:35 -0700, Greg KH wrote:
> > Recently it's been pointed out to me that the modprobe functionality
> > with aliases doesn't quite work properly for some USB modules.
> 
> Sorry, my bad.  I got a patch for this a while ago from Sam Morris.
> Originally noone was using ranges in [].
> 
> This is fixed in 3.3-pre1.  I should release 3.3 proper sometime this
> weekend.

So, the patch that fixes it is the patch below? (needed for distros that
don't want to rev the whole package...)

thanks,

greg k-h


diff -Naur module-init-tools-3.2.2/modprobe.c module-init-tools-3.3-pre1/modprobe.c
--- module-init-tools-3.2.2/modprobe.c	2005-12-01 15:42:09.000000000 -0800
+++ module-init-tools-3.3-pre1/modprobe.c	2006-02-04 15:18:07.000000000 -0800
@@ -990,13 +990,27 @@
 	return ret;
 }
 
+/* Careful!  Don't munge - in [ ] as per Debian Bug#350915 */
 static char *underscores(char *string)
 {
 	if (string) {
 		unsigned int i;
-		for (i = 0; string[i]; i++)
-			if (string[i] == '-')
-				string[i] = '_';
+		int inbracket = 0;
+		for (i = 0; string[i]; i++) {
+			switch (string[i]) {
+			case '[':
+				inbracket++;
+				break;
+			case ']':
+				inbracket--;
+				break;
+			case '-':
+				if (!inbracket)
+					string[i] = '_';
+			}
+		}
+		if (inbracket)
+			warn("Unmatched bracket in %s\n", string);
 	}
 	return string;
 }

  reply	other threads:[~2006-04-14 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-13 23:35 modprobe bug for aliases with regular expressions Greg KH
2006-04-14  4:59 ` Rusty Russell
2006-04-14 16:19   ` Greg KH [this message]
2006-04-14  5:17 ` Thayumanavar Sachithanantham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060414161927.GA15830@kroah.com \
    --to=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox