TOMOYO-PATTERNIZE(8)

NAME
tomoyo-patternize - a tool to convert pathnames in policy into patterns or wildcard expressions

SYNOPSIS
tomoyo-patternize <pattern>

DESCRIPTION
This program reads domain policy from standard input and replaces pathnames with patterns according to the patterns given at the command line. The result is written to standard output. This is useful to shorten and simplify domain or exception policy.

Pathnames for domain names will not be replaced. Only the first matching rule is used for any particular pathname. If a pathname does not match any rules, it is left unchanged.

EXAMPLES
Replace pathnames that match /tmp/php\?\?\?\?\?\? pattern with /tmp/php\?\?\?\?\?\? :
tomoyo-patternize '/tmp/php\?\?\?\?\?\?' < /etc/tomoyo/domain_policy.conf > /etc/tomoyo/domain_policy2.conf

Replace pathnames that match /tmp/php\?\?\?\?\?\? pattern with /tmp/php\?\?\?\?\?\? :
tomoyo-patternize 'file_pattern /tmp/php\?\?\?\?\?\?' < /etc/tomoyo/domain_policy.conf > /etc/tomoyo/domain_policy2.conf

Replace pathnames that match /tmp/php\?\?\?\?\?\? pattern with @GROUP1 :
tomoyo-patternize 'path_group GROUP1 /tmp/php\?\?\?\?\?\?' < /etc/tomoyo/domain_policy.conf > /etc/tomoyo/domain_policy2.conf

Replace integers between 0-100 or 100-200 with @GROUP2 :
tomoyo-patternize 'number_group GROUP2 0-100' 'number_group GROUP2 100-200'< /etc/tomoyo/domain_policy.conf > /etc/tomoyo/domain_policy2.conf

Replace ip addresses 127.0.0.1 or 0:0:0:0:0:0:0:1 with @LOCALHOST :
tomoyo-patternize 'address_group LOCALHOST 127.0.0.1' 'address_group LOCALHOST 0:0:0:0:0:0:0:1' < /etc/tomoyo/domain_policy.conf > /etc/tomoyo/domain_policy2.conf

AUTHORS

Main authors:

    • Tetsuo Handa <penguin-kernel AT I-love.SAKURA.ne.jp>

Other contributers:

    • Jamie Nguyen <jamie AT tomoyolinux.co.uk>

    Man pages, documentation and website.

SEE ALSO

tomoyo-findtemp(8), tomoyo-diffpolicy(8)

See http://tomoyo.sourceforge.jp/ for more information.