diff options
author | Eric Paris <eparis@redhat.com> | 2012-03-20 14:35:12 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2012-04-09 12:22:48 -0400 |
commit | eed7795d0a2c9b2e934afc088e903fa2c17b7958 (patch) | |
tree | 8f402c793774abfea12fd86bec741f0056302324 /security/selinux/ss/services.c | |
parent | aa893269de6277b44be88e25dcd5331c934c29c4 (diff) |
SELinux: add default_type statements
Because Fedora shipped userspace based on my development tree we now
have policy version 27 in the wild defining only default user, role, and
range. Thus to add default_type we need a policy.28.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r-- | security/selinux/ss/services.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 2ea108c2c048..1ded0ec7e8c2 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -1472,12 +1472,18 @@ static int security_compute_sid(u32 ssid, | |||
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | /* Set the type to default values. */ | 1474 | /* Set the type to default values. */ |
1475 | if ((tclass == policydb.process_class) || (sock == true)) { | 1475 | if (cladatum && cladatum->default_type == DEFAULT_SOURCE) { |
1476 | /* Use the type of process. */ | ||
1477 | newcontext.type = scontext->type; | 1476 | newcontext.type = scontext->type; |
1478 | } else { | 1477 | } else if (cladatum && cladatum->default_type == DEFAULT_TARGET) { |
1479 | /* Use the type of the related object. */ | ||
1480 | newcontext.type = tcontext->type; | 1478 | newcontext.type = tcontext->type; |
1479 | } else { | ||
1480 | if ((tclass == policydb.process_class) || (sock == true)) { | ||
1481 | /* Use the type of process. */ | ||
1482 | newcontext.type = scontext->type; | ||
1483 | } else { | ||
1484 | /* Use the type of the related object. */ | ||
1485 | newcontext.type = tcontext->type; | ||
1486 | } | ||
1481 | } | 1487 | } |
1482 | 1488 | ||
1483 | /* Look for a type transition/member/change rule. */ | 1489 | /* Look for a type transition/member/change rule. */ |