[pacman-dev] [PATCH] Fix double close of the lock file

Jonathan Conder jonno.conder at gmail.com
Sun Feb 27 06:31:25 EST 2011


----- Original message -----
> On Sat, Feb 5, 2011 at 1:39 AM, Jonathan Conder <jonno.conder at gmail.com>
> wrote:
> > According to FOPEN(3), using fclose on an fdopen'd file stream also
> > closes the underlying file descriptor. This happened in _alpm_lckmk
> > (util.c), which meant that when alpm_trans_release closed it again, the
> > log file (which reused the original file descriptor) was closed
> > instead.
> > 
> > Signed-off-by: Jonathan Conder <jonno.conder at gmail.com>
> > ---
> 
> So no one ever spotted this because logs are only made during a
> transaction ? Anyway nice finding :)

Pretty much, yeah. Even then it might not affect pacman if the log file gets opened before a transaction is initialized. However, it does affect my frontend, and maybe it would have caused other bugs in future. Thanks, it was a tough one to track down :)

> Signed-off-by: Xavier Chantry <chantry.xavier at gmail.com>


More information about the pacman-dev mailing list