aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 53174b965afc2edbc5ee5d7d27d2630cc1dc67e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
inotifymask
===========

This tool sets up Linux kernel `inotify` hooks on a set of directories to apply
a bit mask to their permissions on file creation within or movement into the
watched directories, logging each permission change.  This can be used as a way
to enforce permissions for uncooperative applications that don't allow
specifying permissions or masking.

Install
-------

You need Perl v5.10.1 or newer.

    $ cpanm Const::Fast Linux::Inotify2
    $ perl Makefile.PL
    $ make
    $ sudo make install

Use
---

    $ inotifymask 0177 ~/.cache/private ~/.cache/private/templates

Works well as a user-level systemd service; see included `inotifymask.service`
template.

    $ mkdir -p ~/.config/systemd/user
    $ cp inotifymask.service ~/.config/systemd/user
    $ vi ~/.config/systemd/user/inotifymask.service  # Change command line to specify your paths
    $ systemctl --user start inotifymask.service
    $ systemctl --user status inotifymask.service
    $ systemctl --user enable inotifymask.service

License
-------

Copyright (c) [Tom Ryder][1]. Distributed under [MIT License][2].

[1]: https://sanctum.geek.nz/
[2]: https://opensource.org/licenses/MIT