Description of problem: When gssftpd does a chroot(), it loses access to /etc/localtime and generates timestamps defaulting to GMT. This can be very misleading, because the log entries just before the chroot() are in the correct timezone. Version-Release number of selected component (if applicable): 1.4.3-5.1 How reproducible: below Steps to Reproduce: 1. Install gssftpd (krb5-workstation) and configure it for anonymous login. 2. Connect to the server as anonymous, and get a file. 3. The entry for the connection in /var/log/messages will disagree with the entry for the "get". Actual results: On my computer in GMT -0700: Nov 9 16:18:22 mail ftpd[11338]: connection from 192.168.1.8 (pvr.redfish-solutions.com) at Thu Nov 9 16:18:22 2006 Nov 9 16:19:21 mail ftpd[11338]: ANONYMOUS FTP LOGIN FROM 192.168.1.8, pvr.redfish-solutions.com (philipp) Nov 9 23:19:50 mail ftpd[11338]: get /pub/paypal4.eml Nov 9 23:19:50 mail ftpd[11338]: get: 55296 bytes transferred Expected results: Nov 9 16:18:22 mail ftpd[11338]: connection from 192.168.1.8 (pvr.redfish-solutions.com) at Thu Nov 9 16:18:22 2006 Nov 9 16:19:21 mail ftpd[11338]: ANONYMOUS FTP LOGIN FROM 192.168.1.8, pvr.redfish-solutions.com (philipp) Nov 9 16:19:50 mail ftpd[11338]: get /pub/paypal4.eml Nov 9 16:19:50 mail ftpd[11338]: get: 55296 bytes transferred Additional info: This bug was reported to krbdev, but never heard back: http://diswww.mit.edu:8008/menelaus.mit.edu/krb5dev/11935
Created attachment 141595 [details] Proposed fix
Something's not right with that patch -- I think 'char *tm;' in the second chunk is meant to be 'char *tz'. I don't think that setting the "TZ" environment variable is really the proper fix here; it's more likely one of the functions being called (probably localtime()) is causing libc to read the local timezone information before calling chroot(). Does copying /etc/localtime into the FTP server's chroot accomplish the same thing?
(In reply to comment #2) > Something's not right with that patch -- I think 'char *tm;' in the second chunk > is meant to be 'char *tz'. Sorry, it was "*tz". I had to hand-edit the patch because it overlapped another patch (graylisting) that we build against locally. > I don't think that setting the "TZ" environment variable is really the proper > fix here; it's more likely one of the functions being called (probably > localtime()) is causing libc to read the local timezone information before > calling chroot(). Does copying /etc/localtime into the FTP server's chroot > accomplish the same thing? I've tried the patch with the "setenv" commented out, and it doesn't work. I've also tried calling "tzset()" instead, and that doesn't work either. If you're testing gets different results, I'd like to hear about it. I'm also thinking that there should be a way to tell glibc that "I'm about to do a chroot(), so grab whatever state you need before that happens." Frankly, I was as surprised as you that localtime() doesn't cause the contents of /etc/localtime to be cached. Maybe Ulrich can shed some light on this? I tried to read through time/tzset.c and time/tzfile.c, but it's kind of hairy.
Created attachment 141965 [details] Corrected fix Corrected the variable declaration in 2nd hunk.
Created attachment 142252 [details] Revised simplified fix. Simplified, more portable fix.
Created attachment 142253 [details] More portable patch using tzset().
Fedora apologizes that these issues have not been resolved yet. We're sorry it's taken so long for your bug to be properly triaged and acted on. We appreciate the time you took to report this issue and want to make sure no important bugs slip through the cracks. If you're currently running a version of Fedora Core between 1 and 6, please note that Fedora no longer maintains these releases. We strongly encourage you to upgrade to a current Fedora release. In order to refocus our efforts as a project we are flagging all of the open bugs for releases which are no longer maintained and closing them. http://fedoraproject.org/wiki/LifeCycle/EOL If this bug is still open against Fedora Core 1 through 6, thirty days from now, it will be closed 'WONTFIX'. If you can reporduce this bug in the latest Fedora version, please change to the respective version. If you are unable to do this, please add a comment to this bug requesting the change. Thanks for your help, and we apologize again that we haven't handled these issues to this point. The process we are following is outlined here: http://fedoraproject.org/wiki/BugZappers/F9CleanUp We will be following the process here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this doesn't happen again. And if you'd like to join the bug triage team to help make things better, check out http://fedoraproject.org/wiki/BugZappers
This message is a reminder that Fedora 8 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 8. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '8'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 8's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 8 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.