On 02/22/2013 11:25 AM, Panu Matilainen wrote:
On 02/20/2013 11:01 AM, Reshetova, Elena wrote:
I think it looks much better now and integrating hooks to it is a
pleasure. I
am attaching the new version. Hope I didn't miss any strange case, but it
looked very easy now after your change!

I'm actually going to be mildly surprised if there aren't any strange
cases we've missed wrt hard links or such :) Anyway, the patch looks as
obviously-correct as it gets within fsm. Applied, thanks for the patch!

Right, no surprises: there is an issue with hard links :)

The problem is that the links are created in one go when we come to the final link of a set, but the hooks are getting called for all the links and will likely fail because the path passed to the post-hook doesn't exist despite fsm->action being FA_CREATE.

How to deal with it is another question though: it could be worked around by passing eg FA_SKIP to the hooks for these files, but then plugins might want to know these files *are* actually going to be created, only later. We could introduce FA_DELAYED or such to signal the condition but then the plugins still wont know when exactly they are going to be created. And then because hardlinks are quite special, many plugins would probably want to differentiate them from other cases (eg for selinux, it makes no sense to repeatedly set a security context when a hardlink set can only have one context). OTOH some other plugins might want to know about them. Dunno... needs more thought (and a less tired mind to think with :)

Regardless of how exactly the hardlinks are handled, perhaps we should pass a pointer to the entire stat struct instead of just st_mode to the hooks, that'd at least allow plugins to know they're dealing with hardlinks (and various other possibly useful information).

A different issue (much easier and one that we already discussed iirc) is that I think we must check the return code from rpmpluginsCallFsmFilePost() and allow it to fail, otherwise its not possible to preserve the current behavior where eg failure to set SELinux context (or other similar security thing) causes package installation to fail.

The good news is that other than the two above issues, the plugin API seems to work quite nicely for SELinux.

        - Panu -
_______________________________________________
Rpm-maint mailing list
[email protected]
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to