Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As the question states, what if I pass

kernel /vmlinuz audit=1 audit=0

Will auditing enabled or disabled? Or will the kernel just freak out? Or is it undefined and will depend on the build of the kernel/argument being passed?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Well, looking at the Vanilla code in linux/kernel/params.c and the parse_one function (for v3.2.6) I would assume that audit=0 would be the version used by the kernel as its the last one in the list.

static int parse_one(char *param,
                   char *val,
                   const struct kernel_param *params,
                   unsigned num_params,
                   int (*handle_unknown)(char *param, char *val))   {
     unsigned int i;
     int err;

     /* Find parameter */
     for (i = 0; i < num_params; i++) {
             if (parameq(param, params[i].name)) {
                     /* No one handled NULL, so do it here. */
                     if (!val && params[i].ops->set != param_set_bool)
                             return -EINVAL;
                     DEBUGP("They are equal!  Calling %p\n",
                            params[i].ops->set);
                     mutex_lock(&param_lock);
                     err = params[i].ops->set(val, &params[i]);
                     mutex_unlock(&param_lock);
                     return err;
             }
     }

     if (handle_unknown) {
             DEBUGP("Unknown argument: calling %p\n", handle_unknown);
             return handle_unknown(param, val);
     }

     DEBUGP("Unknown argument `%s'\n", param);
     return -ENOENT;  }

I am not near a GNU/Linux machine to verify this right now, and it would also depend on patches done by the distributor of your kernel.

share|improve this answer
    
Cool, thanks. I'll look in RHELs src for this file and verify it is indeed the same. –  Flamewires Feb 18 '12 at 2:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.