linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mi Jinlong <mijinlong@cn.fujitsu.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: NFSv3 list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] libnfs.a: fix a bug when parse section's arg
Date: Wed, 24 Nov 2010 17:07:00 +0800	[thread overview]
Message-ID: <4CECD5B4.5090409@cn.fujitsu.com> (raw)
In-Reply-To: <4CEAA8EE.4090301@RedHat.com>



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


  reply	other threads:[~2010-11-24  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-11-29 16:06       ` Steve Dickson
2010-11-29 16:06 ` Steve Dickson

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=4CECD5B4.5090409@cn.fujitsu.com \
    --to=mijinlong@cn.fujitsu.com \
    --cc=SteveD@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).