When started using Fedora Core 10 "service" minidlna segfaults. The reason is that the "service" utility clears all environment variables for security reasons prior to executing the daemon, including the environment var $LOGNAME. During init the function getfriendlyname() gets called which tries to strcat $LOGNAME to the friendly string (minidlna.c revision 1.39 line 186) Since it's cleared getenv() will return a NULL pointer causing a segmentation fault in strcat()
Proposed fix: - check for NULL return of getenv() before using it.
- use getpwuid(getuid()) instead of getenv("LOGNAME")
User workaround: set LOGNAME to some value before executing minidlna
Possible second problem: getfriendlyname() is called even if a friendly name is already supplied in the config file. Is this correct?
Log in to post a comment.