apparmor_parser --show-cache writes "(null)" cache file for stdin
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
New
|
Undecided
|
Unassigned |
Bug Description
I just noticed a funny behaviour of the parser:
# apparmor_parser --show-cache
Cache: added primary location '/var/cache/
Warnung aus stdin (Zeile 1): Cache: added readonly location '/usr/share/
Warnung aus stdin (Zeile 1): apparmor_parser: cannot use or update cache, disable, or force-complain via stdin
Cache miss: stdin
Wrote cache: /var/cache/
(I pressed Ctrl-D when the parser waited for input)
# ls -l /var/cache/
-rw------- 1 root root 0 1. Jan 1970 /var/cache/
I'm not sure if it makes sense to write cache files for stdin - actually the parser already warns "cannot use or update cache ... via stdin".
Even if you really think writing cache for stdin makes sense, it's probably a good idea not to use "(null)" as filename ;-)
currently apparmor can not use the cache for stdin because the cache file names are based on the policy file names, not the profiles in the file. As the profiles within the file are kept together as a single load unit.
It could be possible to add support for caching stdin via a content hashing mechanism.