|
From: Jim C. <jim...@po...> - 2006-12-06 19:27:11
|
I was successfully using fetchmail 6.3.4 (Apple built/shipped) on Mac
OS X 10.4.8 (ppc), launched at startup by launchd.
I migrated over to Mac OS X 10.4.8 (i386). fetchmail 6.3.4 (Apple
built/shipped) failed to work, reporting that it couldn't create
the .fetchmail.pid file. (In actually debugging the problem, it was
created in / because fmhome was an empty string - details below.)
I'm launching fetchmail with launchd, using it in nodetach daemon
mode. HOME and FETHMAILHOME are *not* set in the environment.
It looks like env.c:105 sets up the user global by making a copy
user = xstrdup(pwp->pw_name);
but env.c:111 does not make a copy when setting up the home global
home = pwp->pw_dir;
The memory pointed at by home later gets modified because fetchmail
calls getpwname at fetchmail.c:1214 (after setting up the globals.
The man page for getpwnam says:
The functions getpwent(), getpwnam(), and getpwuid(), leave
their results
in an internal static object and return a pointer to that
object. Subse-
quent calls to the same function will modify the same object.
Patch attached.
|