TOMOYO-PATTERNIZE(8)
β¨ TOMOYO-PATTERNIZE β¨
okay bestie, so this is a page from the System Administration Utilities collection β it's tomoyo-patternize(8), and it is literally the glow-up tool for your policy files π
πΈ NAME πΈ
tomoyo-patternize β the utility that converts pathnames in your policy into patterns π¦
π SYNOPSIS π
tomoyo-patternize
tomoyo-patternize [configfile]
π DESCRIPTION π
So here's the vibe: this program reads your domain policy from standard input and swaps out pathnames for patterns. The replacement rules live in /etc/tomoyo/tools/patternize.conf β that's the config, that's where the magic is defined, no cap. β¨
The resulting policy gets sent straight to standard output, and it is so useful for shortening and simplifying your domain or exception policy. Like, it's giving "make my policy cute and compact" energy.
Important tea: pathnames used for domain names themselves will not be replaced. Nope, those stay exactly as they are π
Also, only the first matching rule is used for any particular pathname β first come, first served, periodt. And if a pathname doesn't match any rules? It's left unchanged. Untouched. Iconic behaviour honestly. π
π§ EXAMPLES π§
okay these are the examples from the config, and they ate:
Replace "proc:/self/fd/0" with "proc:/self/fd/\$"
rewrite path_pattern proc:/self/fd/\$
Replace "proc:/123/status" with "proc/\$/status"
rewrite head_pattern proc:/\$
Replace "dev(8,1):/etc/mtab~456" with "dev(8,1):/etc/mtab~\$"
rewrite tail_pattern /etc/mtab~\$
Replace "/tmp/phpZjk1k3" with @GROUP1
rewrite path_pattern /tmp/php\?\?\?\?\?\? @GROUP1
Replace integers between 0-100 or 100-200 with @GROUP2
rewrite number_pattern 0-100 @GROUP2
rewrite number_pattern 100-200 @GROUP2
Replace loopback addresses with @LOCALHOST
rewrite address_pattern 127.0.0.1 @LOCALHOST
rewrite address_pattern 0:0:0:0:0:0:0:1 @LOCALHOST
β¨ psst β see the configuration file for more info on rule syntax, bestie. that's where the full lore lives.
π BUGS π
If you find any bugs, send an email to <tomoyo-users-en@lists.osdn.me>. like, pls tell them, they wanna know π«Ά
π AUTHORS π
- Tetsuo Handa
<penguin-kernel@I-love.SAKURA.ne.jp>β Main author. π§ - Jamie Nguyen
<jamie@tomoyolinux.co.uk>β Documentation and website. π
π SEE ALSO π
See <https://tomoyo.osdn.jp> for more information.
and that's the whole page, bestie β no notes, absolutely slayed π β¨
this was tomoyo-tools version 2.6.0, dated 2019-02-05, and it's the TOMOYO-PATTERNIZE(8) manual page. thanks for coming to my ted talk, mwah ππ
π¦ where this page comes from
- debian bookworm: tomoyo-tools 2.6.1-20210910-1+b1 Β· GPL-2.0-only
- ubuntu jammy: tomoyo-tools 2.6.1-20210910-1 Β· GPL-2.0-only
- ubuntu noble: tomoyo-tools 2.6.1-20210910-1 Β· GPL-2.0-only
- ubuntu questing: tomoyo-tools 2.6.1-20210910-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms