I'm not too familiar with apparmor rules any more, but an alternative approach might be to try and break things on '/'.

If this is possible without too much difficulty, it might be a more approachable tree
 { "bin" {"bash" = "ixr}}

or from augtool 'get /files/etc/apparmor/<stuff>/bin/bash'

This seems a bit more in line with your original thoughts. Though I'm not sure if the end product would make much sense..... the scope might look very odd if '<stuff>' was itself 'bash.rules' or something...

Pat

On 03/12/2013 08:22 AM, Raphaël Pinson wrote:
Hi Smetana,


The '/' character is illegal in node names, it can only be used in values. In this case, you might actually want to use a seq for node names, and store the path as a value, generating a tree like:

    { "1" = "/bin/bash" { "value" = "ixr" } }


Regards,


On Tue, Mar 12, 2013 at 2:15 PM, Serge Smetana <serge.smet...@gmail.com <mailto:serge.smet...@gmail.com>> wrote:

    Hello,

    I'm trying to create lens for apparmor.
    Simple entry for apparmor rule is something like

       /bin/bash ixr,

    But if I describe lens as

      let rule = [ Util.indent . key Rx.fspath . Sep.space . store Rx.word
     . Util.del_str "," . Util.eol ]

    I get the following exception:

        Failed to compile rule
        exception: The key regexp /[^ \t\n]+/ matches a '/'

    Is it possible to use filesystem path as a key?



    Thanks,
    Serge

    _______________________________________________
    augeas-devel mailing list
    augeas-devel@redhat.com <mailto:augeas-devel@redhat.com>
    https://www.redhat.com/mailman/listinfo/augeas-devel




--
Raphaël Pinson
Administrateur Systèmes & Réseaux
Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com <http://www.camptocamp.com>


_______________________________________________
augeas-devel mailing list
augeas-devel@redhat.com
https://www.redhat.com/mailman/listinfo/augeas-devel


--
Pat Riehecky

Scientific Linux developer
http://www.scientificlinux.org/

_______________________________________________
augeas-devel mailing list
augeas-devel@redhat.com
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to