Let the sun shine upon all the polkit children

So, it’s about time I wrote a post about how’s my GSoC going, isn’t it? It indeed is!

The title suits current state of things pretty well, as it’s been hot as hell here past few weeks (uh) and sun’s shining as crazy…


Well, let’s get started! Some of you may have noticed I closed some bugs with loads of duplicates after I finally managed to reproduce the “sudden” crash in polkit-qt which seemed to be related to something in the GCancellable usage.

It sure was! Scumbag cancellable was already gone when we tried to use it, resulting in getting a nice segmentation fault when it was used while one polkit request was already being processed.

I’m not giving up with bughunting, especially this leak seems really juicy, I’m sure I’ll find the source soon, I’m just spreading the work over days to not go insane from all that Valgrind.

To the less noticeable parts of the program…

Qt 5 port status

I’m constantly working on making the full Qt5 port work when you have Qt4 installed at the same time. Turns out it’s not as much fun as I thought because maintaining backwards compatibility with Qt4 makes you use some of the newer stuff like quite recent versions of CMake and creates a HORRIBLE mess in your CMakeLists, not mentioning all the ifdefs needed to be sure there’s no dependency on Qt4 when you compile only against Qt5.

That results in reading a lot of documentation and compiling and testing every slight change to see if I didn’t break anything.

Of course, my development environment isn’t really prepared to use all the flashy new stuff out of the box so I was struggling to compile some recent version of Qt5 and KF5. Not a surprise I ended up with compiling master branches of all projects in the end. What baffles me a bit is the fact I succeeded quite soon.

I’ll start my own authentication agent, with blackj… oh wait!

Also, there was some noticeable work done in direction to have an easy way how to create a fully functional polkit agent for one single process which then can handle its own requests without us having to hack our way around focus stealing prevention.

To make use of as much of existing code as possible, I split the polkit-kde-agent-1 package into a dynamically linked library (libpolkit-kde-1) which is currently being used by the global KDE agent only. The library is providing a really simplistic API, giving the user opportunity only to make the agent listen and to set different parent windows for different actions.

If you’re interested in how it looks right now, I pushed current status in the process_agent branch of my repository clone. Please note it’s still about to change. When I’m satisfied with the state and Dario approves, I’ll start pushing stable commits into a new branch in the main repository.

I’m planning to demonstrate usage of this feature in KAuth. However, I’m afraid it won’t be possible to push the change any time soon as there’s a lot of work pending, which could collide with how the things work now and I’d like to not break anything what has already been released.

By that, I’m implying I’m planning to create all the separate goals of my GSoC project as separate branches in my clone and start merging them after a thorough peer review somewhere around the end of the summer which for now leaves the testing to you (apart from me, of course), dear enthusiasts! I’d love to see you come to our channel #polkit-kde@freenode to give us (me particularly) your opinions about how it’s all standing and what should I do better!

What comes next?

As I’m already bugging around KAuth, I think rewriting the policy generator is imminent, from what I know there shouldn’t be much of a change, yet as I’ll be at it, I’ll think about adding some new features (especially if you suggest some!) to it.

After that, all while still working on the Qt5 port, there’s KAuth integration, of course! And in the meantime, I’ll have to contact some usability experts in regards of what to do next with the password dialogs. In the first place, there was an idea to implement the dialog via KRunner, but as it seems right now, its design doesn’t allow such a change.

Anyway, clearly, polkit’s concept is to show the user the dialog as a part of the DE UI, not the application’s, (not surprisingly) as GNOME does.  I have some ideas in my head currently, ranging from (yes, I really LOVE it) modifying KRunner to support this kind of input, abusing Plasma notifications or just sticking the dialog in the middle of the display… Actually, every of these three gives me a better impression than working around focus stealing protection.

So, that’s it with what I wanted to say. Sorry for the lack of images, I’ll try to make some more weird mock actions until next time.