Check also /var/db/zoneinfo when looking for system timezone
Recently I found the right 'To Do' pane displayed wrong time on FreeBSD, and Evolution said my system timezone was UTC in the preferences window. It seems that the code to detect system timezone is in src/calendar/libecal/e-cal-system-timezone.c
, and it decides the system timezone from the symlink target of /etc/localtime
with a lot of different fallbacks. FreeBSD installer uses tzsetup
program to configure the system timezone, and tzsetup
supports both copying and symlinking files from /usr/share/zoneinfo
. However, tzsetup
choose copying by default, so /etc/localtime
is usually a regular file on FreeBSD. system_timezone_read_etc_localtime_content
function seems to be able to handle the copying case, but it will stop working if users forget to reinstall the timezone file to /etc/localtime
after system updates.
A similar problem was also found in GLib a few months ago: https://bugzilla.gnome.org/show_bug.cgi?id=795165. The solution there was to read the content of /var/db/zoneinfo
file, where tzsetup
stores the timezone selected by the user. Do you think we should do the same thing in evolution-data-server?