All of lore.kernel.org
 help / color / mirror / Atom feed
From: KaiGai Kohei <kaigai@kaigai.gr.jp>
To: Eamon Walsh <ewalsh@tycho.nsa.gov>
Cc: KaiGai Kohei <kaigai@ak.jp.nec.com>, selinux@tycho.nsa.gov
Subject: Re: [PATCH] libselinux: selabel_*() support for database objects
Date: Wed, 10 Mar 2010 07:16:42 +0900	[thread overview]
Message-ID: <4B96C8CA.1090301@kaigai.gr.jp> (raw)
In-Reply-To: <4B96AAA7.5090909@tycho.nsa.gov>

(2010/03/10 5:08), Eamon Walsh wrote:
> On 03/08/2010 08:42 PM, KaiGai Kohei wrote:
> 
> diff --git a/libselinux/src/label_db.c b/libselinux/src/label_db.c
> new file mode 100644
> index 0000000..fa41b59
> --- /dev/null
> +++ b/libselinux/src/label_db.c
> @@ -0,0 +1,334 @@
> +/*
> + * Media contexts backend for DB objects
> + *
> + * Author: KaiGai Kohei<kaigai@ak.jp.nec.com>
> 
> [snip]
> 
> +static int
> +process_line(const char *path, char *line_buf, unsigned int line_num,
> +	     catalog_t *catalog)
> +{
> +	spec_t	       *spec =&catalog->specs[catalog->nspec];
> +	char	       *type, *key, *context, *temp;
> +	int		items;
> +
> +	/* Cut off comments */
> +	temp = strchr(line_buf, '#');
> +	if (temp)
> +		*temp = '\0';
> +
> +	/*
> +	 * Every entry must have the following format
> +	 *<object class>  <object name>  <security context>
> +	 */
> +	type = key = context = temp = NULL;
> +	items = sscanf(line_buf, "%as %as %as %as",
> +		&type,&key,&context,&temp);
> 
> 
> What is the meaning of the fourth "temp" argument here. Aren't lines
> only supposed to have three entries? Please remove this if it is not needed.

If the line has four or more elements, we want to raise an error, rather than
ignoring it.
If here is not the fourth %as, sscanf() does not return 4, does it?

Thanks,
-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2010-03-09 22:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19  8:21 [PATCH] libselinux: selabel_*() support for database objects KaiGai Kohei
2009-11-21  3:01 ` Eamon Walsh
2009-11-21 14:16   ` KaiGai Kohei
2009-11-25 23:29     ` KaiGai Kohei
2009-11-30 21:30       ` Eamon Walsh
2010-03-02  2:53         ` KaiGai Kohei
2010-03-08 23:13           ` Eamon Walsh
2010-03-08 23:26             ` Andy Warner
2010-03-08 23:34               ` KaiGai Kohei
2010-03-09  0:40             ` KaiGai Kohei
2010-03-09  1:22               ` Eamon Walsh
2010-03-09  1:42                 ` KaiGai Kohei
2010-03-09 20:08                   ` Eamon Walsh
2010-03-09 22:16                     ` KaiGai Kohei [this message]
2010-03-10 17:11                       ` Eamon Walsh
2010-03-10 18:04                         ` Andy Warner
2010-03-11  4:28                           ` KaiGai Kohei
2010-03-12  1:05                             ` KaiGai Kohei
2010-03-15 23:13                               ` Eamon Walsh
2010-03-16  0:01                                 ` KaiGai Kohei

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=4B96C8CA.1090301@kaigai.gr.jp \
    --to=kaigai@kaigai.gr.jp \
    --cc=ewalsh@tycho.nsa.gov \
    --cc=kaigai@ak.jp.nec.com \
    --cc=selinux@tycho.nsa.gov \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.