* [PATCH] libnfs.a: fix a bug when parse section's arg
@ 2010-11-05 2:45 Mi Jinlong
2010-11-09 1:37 ` Mi Jinlong
2010-11-29 16:06 ` Steve Dickson
0 siblings, 2 replies; 6+ messages in thread
From: Mi Jinlong @ 2010-11-05 2:45 UTC (permalink / raw)
To: SteveD; +Cc: NFSv3 list
When parsing section's arg at configure file, the pointer
should stop when fetch ']', and give the warning message.
---
support/nfs/conffile.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index 24640f4..798e5f3 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
if (ptr == NULL)
return;
line = ++ptr;
- while (*ptr && *ptr != '"')
+ while (*ptr && *ptr != '"' && *ptr != ']')
ptr++;
- if (*ptr == '\0') {
+ if (*ptr == '\0' || *ptr == ']') {
xlog_warn("config file error: line %d: "
"non-matched '\"', ignoring until next section", ln);
} else {
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] libnfs.a: fix a bug when parse section's arg
2010-11-05 2:45 [PATCH] libnfs.a: fix a bug when parse section's arg Mi Jinlong
@ 2010-11-09 1:37 ` Mi Jinlong
2010-11-22 17:31 ` Steve Dickson
2010-11-29 16:06 ` Steve Dickson
1 sibling, 1 reply; 6+ messages in thread
From: Mi Jinlong @ 2010-11-09 1:37 UTC (permalink / raw)
To: SteveD; +Cc: NFSv3 list
When parsing section's arg at configure file, the pointer
should stop when fetch ']', and give the warning message.
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
support/nfs/conffile.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index 24640f4..798e5f3 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
if (ptr == NULL)
return;
line = ++ptr;
- while (*ptr && *ptr != '"')
+ while (*ptr && *ptr != '"' && *ptr != ']')
ptr++;
- if (*ptr == '\0') {
+ if (*ptr == '\0' || *ptr == ']') {
xlog_warn("config file error: line %d: "
"non-matched '\"', ignoring until next section", ln);
} else {
-- 1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] libnfs.a: fix a bug when parse section's arg
2010-11-09 1:37 ` Mi Jinlong
@ 2010-11-22 17:31 ` Steve Dickson
2010-11-24 9:07 ` Mi Jinlong
0 siblings, 1 reply; 6+ messages in thread
From: Steve Dickson @ 2010-11-22 17:31 UTC (permalink / raw)
To: Mi Jinlong; +Cc: NFSv3 list
On 11/08/2010 08:37 PM, Mi Jinlong wrote:
> When parsing section's arg at configure file, the pointer
> should stop when fetch ']', and give the warning message.
>
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
> support/nfs/conffile.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
> index 24640f4..798e5f3 100644
> --- a/support/nfs/conffile.c
> +++ b/support/nfs/conffile.c
> @@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
> if (ptr == NULL)
> return;
> line = ++ptr;
> - while (*ptr && *ptr != '"')
> + while (*ptr && *ptr != '"' && *ptr != ']')
> ptr++;
> - if (*ptr == '\0') {
> + if (*ptr == '\0' || *ptr == ']') {
> xlog_warn("config file error: line %d: "
> "non-matched '\"', ignoring until next section", ln);
> } else {
I'm not seeing how this helps... I realize that with this
patch we are saving the processing of a character or
two... but what problem is this patch solving?
steved.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] libnfs.a: fix a bug when parse section's arg
2010-11-22 17:31 ` Steve Dickson
@ 2010-11-24 9:07 ` Mi Jinlong
2010-11-29 16:06 ` Steve Dickson
0 siblings, 1 reply; 6+ messages in thread
From: Mi Jinlong @ 2010-11-24 9:07 UTC (permalink / raw)
To: Steve Dickson; +Cc: NFSv3 list
Steve Dickson :
> On 11/08/2010 08:37 PM, Mi Jinlong wrote:
>> When parsing section's arg at configure file, the pointer
>> should stop when fetch ']', and give the warning message.
>
>> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
>> ---
>> support/nfs/conffile.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
>> index 24640f4..798e5f3 100644
>> --- a/support/nfs/conffile.c
>> +++ b/support/nfs/conffile.c
>> @@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
>> if (ptr == NULL)
>> return;
>> line = ++ptr;
>> - while (*ptr && *ptr != '"')
>> + while (*ptr && *ptr != '"' && *ptr != ']')
>> ptr++;
>> - if (*ptr == '\0') {
>> + if (*ptr == '\0' || *ptr == ']') {
>> xlog_warn("config file error: line %d: "
>> "non-matched '\"', ignoring until next section", ln);
>> } else {
> I'm not seeing how this helps... I realize that with this
> patch we are saving the processing of a character or
> two... but what problem is this patch solving?
If user sets the section message as [ MountPoint "Mount_point ]"
for some mistake, the function should print the warning message,
but it continues with argument is "Mount_point ]".
After this patch, the function can process this problem correctly.
thanks,
Mi Jinlong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] libnfs.a: fix a bug when parse section's arg
2010-11-24 9:07 ` Mi Jinlong
@ 2010-11-29 16:06 ` Steve Dickson
0 siblings, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2010-11-29 16:06 UTC (permalink / raw)
To: Mi Jinlong; +Cc: NFSv3 list
On 11/24/2010 04:07 AM, Mi Jinlong wrote:
>
>
> Steve Dickson :
>> On 11/08/2010 08:37 PM, Mi Jinlong wrote:
>>> When parsing section's arg at configure file, the pointer
>>> should stop when fetch ']', and give the warning message.
>>
>>> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
>>> ---
>>> support/nfs/conffile.c | 4 ++--
>>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
>>> index 24640f4..798e5f3 100644
>>> --- a/support/nfs/conffile.c
>>> +++ b/support/nfs/conffile.c
>>> @@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
>>> if (ptr == NULL)
>>> return;
>>> line = ++ptr;
>>> - while (*ptr && *ptr != '"')
>>> + while (*ptr && *ptr != '"' && *ptr != ']')
>>> ptr++;
>>> - if (*ptr == '\0') {
>>> + if (*ptr == '\0' || *ptr == ']') {
>>> xlog_warn("config file error: line %d: "
>>> "non-matched '\"', ignoring until next section", ln);
>>> } else {
>> I'm not seeing how this helps... I realize that with this
>> patch we are saving the processing of a character or
>> two... but what problem is this patch solving?
>
> If user sets the section message as [ MountPoint "Mount_point ]"
> for some mistake, the function should print the warning message,
> but it continues with argument is "Mount_point ]".
>
> After this patch, the function can process this problem correctly.
Ok... I see the problem now... Thanks!
steved.
>
> thanks,
> Mi Jinlong
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] libnfs.a: fix a bug when parse section's arg
2010-11-05 2:45 [PATCH] libnfs.a: fix a bug when parse section's arg Mi Jinlong
2010-11-09 1:37 ` Mi Jinlong
@ 2010-11-29 16:06 ` Steve Dickson
1 sibling, 0 replies; 6+ messages in thread
From: Steve Dickson @ 2010-11-29 16:06 UTC (permalink / raw)
To: Mi Jinlong; +Cc: NFSv3 list
On 11/04/2010 10:45 PM, Mi Jinlong wrote:
> When parsing section's arg at configure file, the pointer
> should stop when fetch ']', and give the warning message.
>
> ---
> support/nfs/conffile.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
> index 24640f4..798e5f3 100644
> --- a/support/nfs/conffile.c
> +++ b/support/nfs/conffile.c
> @@ -271,9 +271,9 @@ conf_parse_line(int trans, char *line, size_t sz)
> if (ptr == NULL)
> return;
> line = ++ptr;
> - while (*ptr && *ptr != '"')
> + while (*ptr && *ptr != '"' && *ptr != ']')
> ptr++;
> - if (*ptr == '\0') {
> + if (*ptr == '\0' || *ptr == ']') {
> xlog_warn("config file error: line %d: "
> "non-matched '\"', ignoring until next section", ln);
> } else {
Committed...
steved.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-11-29 16:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-05 2:45 [PATCH] libnfs.a: fix a bug when parse section's arg Mi Jinlong
2010-11-09 1:37 ` Mi Jinlong
2010-11-22 17:31 ` Steve Dickson
2010-11-24 9:07 ` Mi Jinlong
2010-11-29 16:06 ` Steve Dickson
2010-11-29 16:06 ` Steve Dickson
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).