Re: Bug#240886: module-init-tools: modprobe pass wrong ide options to insmod

From: Rusty Russell (rusty_at_rustcorp.com.au)
Date: 03/31/04

  • Next message: Martin J. Bligh: "Re: BUG_ON(!cpus_equal(cpumask, tmp));"
    To: 240886@bugs.debian.org
    Date:	Wed, 31 Mar 2004 11:14:20 +1000
    
    

    On Wed, 2004-03-31 at 02:25, Marco d'Itri wrote:
    ...
    > modprobe -v -k ide-mod options="ide=nodma hdc=cdrom"
    >
    > resulting in
    >
    > insmod the_module "options=ide=nodma hdc=cdrom"
    >
    > will not work.

    There are two problems here: one is in modprobe, but the real problem is
    that putting:

            options ide-mod options="ide=nodma hdc=cdrom"

    will be handed to ide-mod as:

            "ide=nodma hdc=cdrom"

    ie. with the quotes intact. It doesn't handle that, and probably
    shouldn't.

    Name: Fix Quote Handling in Parameters
    Status: Tested on 2.6.5-rc3

    Agustin Martin <agmartin@debian.org> pointed out that this doesn't
    work:

            options ide-mod options="ide=nodma hdc=cdrom"

    The quotes are understood by kernel/params.c (ie. it skips over spaces
    inside them), but are not stripped before handing to the underlying
    function. They should be.

    diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .7471-linux-2.6.5-rc3/kernel/params.c .7471-linux-2.6.5-rc3.updated/kernel/params.c
    --- .7471-linux-2.6.5-rc3/kernel/params.c 2003-10-09 18:03:02.000000000 +1000
    +++ .7471-linux-2.6.5-rc3.updated/kernel/params.c 2004-03-31 11:02:44.000000000 +1000
    @@ -96,6 +96,13 @@ static char *next_arg(char *args, char *
             else {
                     args[equals] = '\0';
                     *val = args + equals + 1;
    +
    + /* Don't include quotes in value. */
    + if (**val == '"') {
    + (*val)++;
    + if (args[i-1] == '"')
    + args[i-1] = '\0';
    + }
             }
     
             if (args[i]) {

    -- 
    Anyone who quotes me in their signature is an idiot -- Rusty Russell
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Martin J. Bligh: "Re: BUG_ON(!cpus_equal(cpumask, tmp));"

    Relevant Pages

    • Re: [PATCH 2.6] Remove spaces from PCI IDE pci_driver.name field
      ... anyone who writes perl scripts on the command line doesn't mind ... >> surrounding an expression in quotes. ... > Except when the quotes are already open. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] aoe: add documentation for udev users
      ... > This will fail and print ... > Fix: Always put quotes around variables. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: Git-commits mailing list feed.
      ... Matt Domsch wrote: ... Use quotes! ... The exit code should reflect the status from gpg. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [DOCUMENTATION] Revised Unreliable Kernel Locking Guide
      ... I've put the html version up for your reading pleasure: the diff ... Feedback welcome, ... Anyone who quotes me in their sig is an idiot. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] [2.6.2-rc3] Fix module.c pointer arithmetics
      ... Above in this file, there is the declaration: ... Anyone who quotes me in their sig is an idiot. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)