Comment 9 for bug 1862348

Revision history for this message
Alex Murray (alexmurray) wrote :

Thanks for the excellent reviews - I had already wondered about a symlink attack hence the code first checks if /var/run/apport a dir and if not unlinks it - but yes this could be raced still so that is a good point. It does indeed seem best to then just put it somewhere where only root has write access to start with (although I have a feeling that apport can sometimes run as a user which in this case this is not going to work but perhaps I am mistaken - although my patch still assumes this file must be root owned anyway which is no different) - so then /var/run/apport.lock does seem like a simpler and better solution. I'll cook up a patch based on that instead.