Bug#376603: [pkg-fetchmail-maint] Bug#376603: fetchmail: empty pidfile in ~/ causes fetchmail to fail silently

Matthias Andree matthias.andree at gmx.de
Tue Jul 4 09:57:13 UTC 2006


Justin Pryzby <justinpryzby at users.sourceforge.net> writes:

> It notices that there's an rc file:
> |open("/home/pryzbyj/.fetchmailrc", O_RDONLY) = 4
>
> WTF?
> |ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xafa04e58) = -1 ENOTTY
> (Inappropriate ioctl for device)

glibc at work, probably isatty() or equivalent to find out the default
buffer size (line vs. fully buffered).

> Huh?  Yes, we are a process..
> |kill(0, SIG_0)                          = 0
> |close(4)                                = 0

That's indeed a bug, and it's easy to fix (patch attached, description
below). The fscanf() in fm_lock_state() returns EOF; which isn't handled
in <= 6.3.4.

Nico, I suggest to demote the severity to "normal" or "minor" (your
decision), tag fixed-upstream,confirmed,patch and add the attached
patch since it'll take some time until 6.3.5, there are some nontrivial
fixes in the pipeline.

I find the PID of 0 astonishing however. Is Debian's GCC different than
SUSE's?  The PID passed to kill is an uninitialized auto variable, and
that it's 0 on your AND Nico's computer leaves me at a loss (and this is
what causes the "lockfile exists" issue), it should contain garbage
(which would cause fetchmail to erase the lockfile in most of the
cases).

> It *tries* to tell me something:

Please report logging issues separately. Merging two issues into one bug
report isn't particularly helpful. I'm cloning the bug.

Patch description (doesn't address logging): (1) fix lockfile bug, by
treating short lockfiles as stale. (2) close the lockfile stream before
attempting to delete the file, and report "removing stale lockfile"
before trying so. (Note that the fclose() before exit() is just
cosmetics and not fixing a leak, exit() is supposed to close all open
files anyways.)

-- 
Matthias Andree
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fetchmail-debian376603.diff
Type: text/x-patch
Size: 957 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-fetchmail-maint/attachments/20060704/ee7eb911/fetchmail-debian376603.bin


More information about the pkg-fetchmail-maint mailing list