Nested Booleans
Why is it not possible to nest booleans - this is always causing problems for me. For example, right now I can't compile my policy, because it contains code like this:
if (mozilla_writehome) { write_untrusted($1_mozilla_t, $1) file_type_auto_trans($1_mozilla_t, { $1_home_t $1_home_dir_t }, $1_untrusted_content_t)
}file_type_auto_trans($1_mozilla_t, { tmp_t $1_tmp_t }, $1_untrusted_content_t)
and then:
################################################
# write_untrusted(source, role_prefix)
#
define(write_untrusted', write_network_home($1)create_dir_file($1, $2_untrusted_content_t)
') dnl write_untrusted
and:
################################################
# write_network_home(source)
#
# Allows source domain to create directories and
# files on network file system
define(write_network_home',
allow $1 home_root_t:dir search;
if (use_nfs_home_dirs) {create_dir_file($1, nfs_t)
}
if (use_samba_home_dirs) {create_dir_file($1, cifs_t)
}
allow $1 autofs_t:dir { search getattr };
') dnl write_network_home
Signature · 8 lines
Ivan Gyurdiev <[email protected]> Cornell University -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Ivan Gyurdiev
Why is it not possible to nest booleans - this is always causing problems for me. For example, right now I can't compile my policy, because it contains code like this:
On second thought this is poorly structured, and doesn't make sense - will fix. However, I still think that it would be nice if I could nest booleans.. or put apostrophes in comments without fear.
Signature · 8 lines
Ivan Gyurdiev <[email protected]> Cornell University -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ivan Gyurdiev
Sent: Friday, June 10, 2005 8:49 PM
To: [email protected]
Subject: Re: Nested Booleans
Quoted 8 lines
Quoted 3 lines · Ivan Gyurdiev
Why is it not possible to nest booleans - this is always causing problems for me. For example, right now I can't compile my policy, because it contains code like this:
On second thought this is poorly structured, and doesn't make sense - will fix. However, I still think that it would be nice if I could nest booleans..
Me too - if you squint at the patches that Josh sent for modules you will see the infrastructure to support this. The goal is to transform nested conditionals into non-nested conditionals with appropriate expressions (so that the kernel will not need changes to understand the nesting). For example:
if (foo) {
allow a . . .
if (bar) {
allow b
}
}Would become:
if (foo) {
allow a . . .
}
if (foo && bar) {
allow b . . .
}
The fun really starts when you consider type transition rules and arbitrary nesting with optional blocks for modules (both nesting conditional blocks in optional blocks and optional blocks in conditionals at arbitrary depths). The infrastructure we have submitted (and will resubmit with fixes next week) should handle all of that with some parsing magic. Not certain when we will be able to create that parsing magic, though, as it is not in our short term plans.
Karl
---
Karl MacMillan
Tresys Technology
http://www.tresys.com
(410) 290-1411 ext 134
Quoted 9 lines
--
Ivan Gyurdiev <[email protected]>
Cornell University--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.