openSUSE/snapper — pull request #2 by oniko (2012-09-26 11:35:25+00:00)
Title: Oniko

Hello Arvin,

I've been doing sort of code preview for the dbus interface to get it into the Fedora and found out the match rule somehow not optimal. I tested the code and it was causing too many wake-ups of the snapperd daemon. So I propose following changes:

- define prefix org.opensuse.Snapper.Client prefix for well known name every client can take
- snapperd is now listening only for names prefixed with the ...Client
- if client is connected invisible, his first task is to verify the client name

suppose client owns well known name: ok, let him live and communicate
suppose client doesn't own well known name: reply the first message with error and ignore each following message from the client. revoked clients zombify themselves so that they can be removed from the snapperd structures during periodic() call

- if client drops the well known name, it is considered disconnected
- well known names exchanges between clients is not supported

I don't know if you will find these patches helpful or not, but for me it was quite a good exercise to understand your code and i didn't want all the effort to go in vain. so here it is and feel free to use/discard it.

I've done some basic testing and it looks good (concerning the patches), but I need to test more intensively several cases where clients are possibly trying to harm the daemon.