diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2011-04-06 17:08:27 -0400 |
---|---|---|
committer | Steve Lawrence <slawrence@tresys.com> | 2011-04-08 10:28:02 -0400 |
commit | 20b43b3fd3d392c4f12a963a4e46c264e7ed5163 (patch) | |
tree | b2905c34e51dd1891e8ae9fc805fdb189fa34f46 /libselinux/src/label.c | |
parent | 1629d2f89a8c5f758413b87b94740aaaa5f21144 (diff) | |
download | android_external_selinux-20b43b3fd3d392c4f12a963a4e46c264e7ed5163.tar.gz android_external_selinux-20b43b3fd3d392c4f12a963a4e46c264e7ed5163.tar.bz2 android_external_selinux-20b43b3fd3d392c4f12a963a4e46c264e7ed5163.zip |
This patch adds a new subs_dist file.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The idea is to allow distributions to ship a subs file as well as let
the user modify subs.
In F16 we are looking at shipping a
file_contexts.subs_dist file like this
cat file_contexts.subs_dist
/run /var/run
/run/lock /var/lock
/var/run/lock /var/lock
/lib64 /lib
/usr/lib64 /usr/lib
The we will remove all (64)? from policy.
This will allow us to make sure all /usr/lib/libBLAH is labeled the same
as /usr/lib64/libBLAH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk2c1ksACgkQrlYvE4MpobNXcQCgqgAiQJxmwa1+NdIq8E3tQRp6
QT0An0ihA60di9CRsEqEdVbSaHOwtte5
=LXgd
-----END PGP SIGNATURE-----
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
Diffstat (limited to 'libselinux/src/label.c')
-rw-r--r-- | libselinux/src/label.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libselinux/src/label.c b/libselinux/src/label.c index 2fd19c51..ba316df5 100644 --- a/libselinux/src/label.c +++ b/libselinux/src/label.c @@ -56,12 +56,11 @@ static char *selabel_sub(struct selabel_sub *ptr, const char *src) return NULL; } -static struct selabel_sub *selabel_subs_init(void) +static struct selabel_sub *selabel_subs_init(const char *path,struct selabel_sub *list) { char buf[1024]; - FILE *cfg = fopen(selinux_file_context_subs_path(), "r"); + FILE *cfg = fopen(path, "r"); struct selabel_sub *sub; - struct selabel_sub *list = NULL; if (cfg) { while (fgets_unlocked(buf, sizeof(buf) - 1, cfg)) { @@ -160,7 +159,10 @@ struct selabel_handle *selabel_open(unsigned int backend, memset(rec, 0, sizeof(*rec)); rec->backend = backend; rec->validating = selabel_is_validate_set(opts, nopts); - rec->subs = selabel_subs_init(); + + rec->subs = NULL; + rec->subs = selabel_subs_init(selinux_file_context_subs_dist_path(), rec->subs); + rec->subs = selabel_subs_init(selinux_file_context_subs_path(), rec->subs); if ((*initfuncs[backend])(rec, opts, nopts)) { free(rec); |