<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi Panu,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I finally got back to file hooks and tried to look into this with a fresh head. I think given our previous discussion, I would propose to have only two symmetrical hooks inside FSM for plugins. I would also make rpm to ignore any return code from them now, since there isn’t much that we can really do even if they return some failure. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>FSM_INIT (const char* path, mode_t mode)<o:p></o:p></p><p class=MsoNormal>Called after fsm.Init() has finished, can be used by plugins to get pre-warned that this file will be now installed to filesystem.<o:p></o:p></p><p class=MsoNormal>Currently in msm plugin this hook is used very wrongly in a sense that it attempts to stop the file writing. I am looking forward to change this, but first I would need to resolve the conflict hook problem (see below). However, when the need to do this ugly functionality in this hook goes away, I think plugins might still be able to benefit from the hook or at least for symmetry looks (we do have pre and post hooks for ts and te).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>FSM_COMMIT (const char* path, mode_t mode)<o:p></o:p></p><p class=MsoNormal>- Called inside fsm.commit(), can be used by plugins to perform file labelling<o:p></o:p></p><p class=MsoNormal>- in the future it would be nice to pass to this hook also fidigest and digestalgo that plugins also can access the digest of the file that got written to fs and do additional labelling (like signing the file based on digest for IMA or smth like this). <span style='mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In addition to these two FSM hooks, we do need a file conflict hook in order to be able to prevent packages rewriting each other files when rpm is run with --<b>replacefiles</b> mode.  Previously you mentioned that when the hook is called, signatures of all packages have been already verified, so in principle it should not be a problem to access at this point the info about who signed this particular package that brings this file. However, I can’t understand how could it already be verified, if the hook is called inside rpmtsPrepare().  You mentioned that with future changes and introduction of an object we might be able to get needed parameters passed to the hook, but I think I don’t understand how it will be working while looking to the code. Could you please explain a bit on this? <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For FSM hooks, if there are no objections, I can send you a patch tomorrow for a review. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best Regards,<br>Elena.<o:p></o:p></p></div></body></html>