selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominick Grift <dominick.grift@defensec.nl>
To: James Carter <jwcart2@gmail.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: CIL typealiases
Date: Thu, 28 May 2020 15:28:34 +0200	[thread overview]
Message-ID: <520dd447-7ba4-9ea5-0353-425a7da4497b@defensec.nl> (raw)
In-Reply-To: <CAP+JOzRQzA=PU+djvZmyA_RtdcduMQuyhZPvNSpNodpE_G4xGg@mail.gmail.com>



On 5/28/20 3:19 PM, James Carter wrote:
> On Thu, May 28, 2020 at 7:21 AM Dominick Grift
> <dominick.grift@defensec.nl> wrote:
>>
>>
>> tl;dr typalias (and possibly typealiasactual) statement does not like periods
>>
>> systemd plans to consolidate systemd-udevd and udevadm and so I was
>> looking to consolidate the policy. For compatibility I wanted to add a
>> (typealias .udev.udevadm.exec) and (typealiasactual .udev.udevadm.exec
>> .udev.daemon.exec)
>>
>> That reminded me that it does not like the period name space
>> delimiter in at least the typealias statement.
>>
>> Example:
>>
>> [root@brutus ~]# echo "(block test (type test1) (typealias test2.test1)
>> (typealiasactual test2.test1 test.test1))" > mytest.cil
>> [root@brutus ~]# semodule -vvv -i mytest.cil
>>
>> <snip>
>> Building AST from Parse Tree
>> Invalid character "." in test2.test1
>> Invalid name
>> Failed to create node
>> Bad typealias declaration at
>> /var/lib/selinux/mydssp3-mcs/tmp/modules/400/mytest/cil:1
>> Problem at /var/lib/selinux/mydssp3-mcs/tmp/modules/400/mytest/cil:1
>> Failed to build ast
>> semodule:  Failed!
>>
> 
> CIL doesn't like "." in any name used in a declaration.
> 
> If you want an alias with a "." in it, then use blocks.
> (block udev
>   (block daemon
>      (type exec)
>   )
>   (block udevadm
>      (typealias exec)
>      (typealiasactual exec .udev.daemon.exec)
>   )
> )
> 
> Or something like that.

Right, thanks that works and sorry about that. Feels like deja vu, must
have not been the first time I encountered this.

Feels kind of un-intuitive but makes perfect sense thinking about it.
Just need to get used to it.


> 
> Jim
> 

  reply	other threads:[~2020-05-28 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 11:12 CIL typealiases Dominick Grift
2020-05-28 13:19 ` James Carter
2020-05-28 13:28   ` Dominick Grift [this message]
2020-05-28 13:36     ` James Carter

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=520dd447-7ba4-9ea5-0353-425a7da4497b@defensec.nl \
    --to=dominick.grift@defensec.nl \
    --cc=jwcart2@gmail.com \
    --cc=selinux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).