From: KaiGai Kohei <kaigai@ak.jp.nec.com>
To: Andy Warner <warner@rubix.com>
Cc: Eamon Walsh <ewalsh@tycho.nsa.gov>,
KaiGai Kohei <kaigai@kaigai.gr.jp>,
selinux@tycho.nsa.gov
Subject: Re: [PATCH] libselinux: selabel_*() support for database objects
Date: Fri, 12 Mar 2010 10:05:18 +0900 [thread overview]
Message-ID: <4B99934E.2030802@ak.jp.nec.com> (raw)
In-Reply-To: <4B987150.10609@ak.jp.nec.com>
[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]
>> Lastly, regarding tuples, I noticed the ability to label tuples was
>> removed because tuples are not named. Would it be useful to label all
>> tuples under an object (e.g., table) as follows. I am sure you
>> considered this, just curious of your thoughts:
>>
>> db_tuple *.pg_catalog.pg_table.* system_u:object_r:sepgsql_tuple_t:s0
>>
>> So that all tuples under the *.pg_catalog.pg_table table would have a
>> context of system_u:object_r:sepgsql_tuple_t:s0. Or, is the fact that
>> you are not able to use anything other than * as the tuple's name simply
>> make things too messy? I would assume there would be a similar issue in
>> constructing a key value for a tuple in the call to selabel_lookup.
>
> Hmm. Indeed, it makes sense.
> I'll add db_tuple again. Please wait for a while.
The attached patch supports initial labeling of db_tuple class again.
If DBMS identifies tuples using the relation which owns the tuples,
libselinux can return a hint of the security context to be assigned.
Below are only differences from the previous patch.
diff --git a/libselinux/include/selinux/label.h b/libselinux/include/selinux/label.h
index 60503bd..0435365 100644
--- a/libselinux/include/selinux/label.h
+++ b/libselinux/include/selinux/label.h
@@ -127,6 +127,7 @@ void selabel_stats(struct selabel_handle *handle);
#define SELABEL_DB_VIEW 6
#define SELABEL_DB_PROCEDURE 7
#define SELABEL_DB_BLOB 8
+#define SELABEL_DB_TUPLE 9
#ifdef __cplusplus
}
diff --git a/libselinux/src/label_db.c b/libselinux/src/label_db.c
index 9e4f52b..e1bfab7 100644
--- a/libselinux/src/label_db.c
+++ b/libselinux/src/label_db.c
@@ -136,6 +136,8 @@ process_line(const char *path, char *line_buf, unsigned int line_num,
spec->type = SELABEL_DB_PROCEDURE;
else if (!strcmp(type, "db_blob"))
spec->type = SELABEL_DB_BLOB;
+ else if (!strcmp(type, "db_tuple"))
+ spec->type = SELABEL_DB_TUPLE;
else {
selinux_log(SELINUX_WARNING,
"%s: line %d has invalid object type %s\n",
--
KaiGai Kohei <kaigai@ak.jp.nec.com>
[-- Attachment #2: libselinux-selabel-sepgsql.4.patch --]
[-- Type: application/octect-stream, Size: 18545 bytes --]
next prev parent reply other threads:[~2010-03-12 1:05 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
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 [this message]
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=4B99934E.2030802@ak.jp.nec.com \
--to=kaigai@ak.jp.nec.com \
--cc=ewalsh@tycho.nsa.gov \
--cc=kaigai@kaigai.gr.jp \
--cc=selinux@tycho.nsa.gov \
--cc=warner@rubix.com \
/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.