* [PATCH] libkmod-config: Only match dot before '=' in /proc/cmdline
@ 2014-03-05 12:27 Michal Marek
2014-03-05 15:30 ` Lucas De Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Michal Marek @ 2014-03-05 12:27 UTC (permalink / raw)
To: linux-modules
Otherwise, we also parse strings like
BOOT_IMAGE=/boot/vmlinuz-3.12.12-57.g5f654cf-default
In practice, this is not a problem, because there is no module named
BOOT_IMAGE=/boot/vmlinuz-3. It just disturbs in modprobe -c output.
---
libkmod/libkmod-config.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 4417871..9905d5e 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -523,7 +523,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
{
char buf[KCMD_LINE_SIZE];
int fd, err;
- char *p, *modname, *param = NULL, *value = NULL;
+ char *p, *modname, *param = NULL, *value = NULL, is_module = 1;
fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
if (fd < 0) {
@@ -544,9 +544,11 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
switch (*p) {
case ' ':
*p = '\0';
- kcmdline_parse_result(config, modname, param, value);
+ if (is_module)
+ kcmdline_parse_result(config, modname, param, value);
param = value = NULL;
modname = p + 1;
+ is_module = 1;
break;
case '.':
if (param == NULL) {
@@ -557,12 +559,15 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
case '=':
if (param != NULL)
value = p + 1;
+ else
+ is_module = 0;
break;
}
}
*p = '\0';
- kcmdline_parse_result(config, modname, param, value);
+ if (is_module)
+ kcmdline_parse_result(config, modname, param, value);
return 0;
}
--
1.8.4.5
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] libkmod-config: Only match dot before '=' in /proc/cmdline
2014-03-05 12:27 [PATCH] libkmod-config: Only match dot before '=' in /proc/cmdline Michal Marek
@ 2014-03-05 15:30 ` Lucas De Marchi
2014-03-06 14:03 ` Lucas De Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2014-03-05 15:30 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-modules
Hi,
On Wed, Mar 5, 2014 at 9:27 AM, Michal Marek <mmarek@suse.cz> wrote:
> Otherwise, we also parse strings like
>
> BOOT_IMAGE=/boot/vmlinuz-3.12.12-57.g5f654cf-default
>
> In practice, this is not a problem, because there is no module named
> BOOT_IMAGE=/boot/vmlinuz-3. It just disturbs in modprobe -c output.
> ---
Applied.
Since you already touched the testsuite in previous patches, could you
add tests for these, too?
Thanks
Lucas De Marchi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libkmod-config: Only match dot before '=' in /proc/cmdline
2014-03-05 15:30 ` Lucas De Marchi
@ 2014-03-06 14:03 ` Lucas De Marchi
2014-03-06 17:00 ` Michal Marek
0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2014-03-06 14:03 UTC (permalink / raw)
To: Michal Marek; +Cc: linux-modules
Hi,
On Wed, Mar 5, 2014 at 12:30 PM, Lucas De Marchi
<lucas.de.marchi@gmail.com> wrote:
> Hi,
>
> On Wed, Mar 5, 2014 at 9:27 AM, Michal Marek <mmarek@suse.cz> wrote:
>> Otherwise, we also parse strings like
>>
>> BOOT_IMAGE=/boot/vmlinuz-3.12.12-57.g5f654cf-default
>>
>> In practice, this is not a problem, because there is no module named
>> BOOT_IMAGE=/boot/vmlinuz-3. It just disturbs in modprobe -c output.
>> ---
>
> Applied.
>
> Since you already touched the testsuite in previous patches, could you
> add tests for these, too?
So... I went ahead and added some tests that I'm sending to the ML.
could you take a look?
thanks
Lucas De Marchi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libkmod-config: Only match dot before '=' in /proc/cmdline
2014-03-06 14:03 ` Lucas De Marchi
@ 2014-03-06 17:00 ` Michal Marek
0 siblings, 0 replies; 4+ messages in thread
From: Michal Marek @ 2014-03-06 17:00 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: linux-modules
On 2014-03-06 15:03, Lucas De Marchi wrote:
> Hi,
>
> On Wed, Mar 5, 2014 at 12:30 PM, Lucas De Marchi
> <lucas.de.marchi@gmail.com> wrote:
>> Hi,
>>
>> On Wed, Mar 5, 2014 at 9:27 AM, Michal Marek <mmarek@suse.cz> wrote:
>>> Otherwise, we also parse strings like
>>>
>>> BOOT_IMAGE=/boot/vmlinuz-3.12.12-57.g5f654cf-default
>>>
>>> In practice, this is not a problem, because there is no module named
>>> BOOT_IMAGE=/boot/vmlinuz-3. It just disturbs in modprobe -c output.
>>> ---
>>
>> Applied.
>>
>> Since you already touched the testsuite in previous patches, could you
>> add tests for these, too?
>
> So... I went ahead and added some tests that I'm sending to the ML.
> could you take a look?
Thanks, I will have a look later. I was chasing another testsuite bug
this afternoon. Will send the patch soon.
Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-06 17:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 12:27 [PATCH] libkmod-config: Only match dot before '=' in /proc/cmdline Michal Marek
2014-03-05 15:30 ` Lucas De Marchi
2014-03-06 14:03 ` Lucas De Marchi
2014-03-06 17:00 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).