Skip to content

Rebuild fapolicyd-magic.mgc on service start up - #442

Open
bachradsusi wants to merge 1 commit into
linux-application-whitelisting:mainfrom
bachradsusi:fapolicyd-magic
Open

bachradsusi wants to merge 1 commit into
linux-application-whitelisting:mainfrom
bachradsusi:fapolicyd-magic

Conversation

@bachradsusi

Copy link
Copy Markdown
Member

Sometimes file's libmagic can dump the compiled magic-file format version (VERSIONNO) which has an effect that fapolicyd-magic.mgc generated during fapolicyd becomes invalid and fapolicyd is not able to start anymore.

With this change, /usr/share/fapolicyd/fapolicyd-magic is installed together with /usr/share/fapolicyd/fapolicyd-magic.mgc so that it's possible to regenerate .mgc file during fapolicyd.service startup.

ExecStartPre command is used with '-' in order not to break startup on systems with read only '/usr'

Fixes:
/usr/share/fapolicyd/fapolicyd-magic.mgc, 1: Warning: offset �' invalid /usr/share/fapolicyd/fapolicyd-magic.mgc, 2: Warning: offset ' invalid
/usr/share/fapolicyd/fapolicyd-magic.mgc, 4: Warning: offset `

o' invalid
Unable to load fast magic database

Sometimes file's libmagic can dump the compiled magic-file format
version (VERSIONNO) which has an effect that fapolicyd-magic.mgc generated
during fapolicyd becomes invalid and fapolicyd is not able to start anymore.

With this change, /usr/share/fapolicyd/fapolicyd-magic is installed together
with /usr/share/fapolicyd/fapolicyd-magic.mgc so that it's possible to
regenerate .mgc file during fapolicyd.service startup.

ExecStartPre command is used with '-' in order not to break startup on systems
with read only '/usr'

Fixes:
    /usr/share/fapolicyd/fapolicyd-magic.mgc, 1: Warning: offset `�' invalid
    /usr/share/fapolicyd/fapolicyd-magic.mgc, 2: Warning: offset `' invalid
    /usr/share/fapolicyd/fapolicyd-magic.mgc, 4: Warning: offset `

    o' invalid
    Unable to load fast magic database
@bachradsusi

Copy link
Copy Markdown
Member Author

@stevegrubb

Copy link
Copy Markdown
Member

Wouldn't it be better to just make the rpm dependency tighter? One effect I can't really tell is where does the newly compiled magic file live? We can't really put it in /usr/share because that could be mounted readonly or NFS. So, we'd need to put it in /var somewhere or /etc. We'd need to ghost the file, too. If the dependencies were tighter, then we'd still get the bz filed but it would be that we're preventing an upgrade which is not as bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants