troglobit / mrouted

The original DVMRP (dynamic multicast routing) implementation for UNIX
https://troglobit.com/projects/mrouted/
Other
83 stars 17 forks source link

Generation ID stored in /var/lib should be in /var/lib/misc (FHS) #37

Closed troglobit closed 4 years ago

troglobit commented 4 years ago

In #25 we added support for persistent genid, but got the path wrong.

On Linux based systems we should honor the FHS:

"An application (or a group of inter-related applications) must use a subdirectory of /var/lib for its data. There is one > required subdirectory, /var/lib/misc, which is intended for state files that don't need a subdirectory; ..."

On UNIX systems we should use /var/db.

Hence, _PATH_VARDB in /usr/include/paths.h really is the one to rely on here. Except some C-libraries on Linux still use /var/db, and the system is not guaranteed to have that path, or even a symlink to /var/lib/misc. So, we can either guess/probe on the system or make this a configure option, because some users don't even want to follow the FHS or a traditional hier(7).