Bug 243087 - Conflict between use of local timestamps and RFC3659 MDTM usage
Conflict between use of local timestamps and RFC3659 MDTM usage
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: vsftpd (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Martin Nagy
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-07 05:15 EDT by Ted Rule
Modified: 2016-07-26 19:46 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-12-04 07:39:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to add a "log_localtime" option to vsftpd (3.82 KB, text/x-patch)
2007-06-07 05:15 EDT, Ted Rule
no flags Details

  None (edit)
Description Ted Rule 2007-06-07 05:15:26 EDT
Description of problem:

If the "use_localtime" option is enabled so as to force non-UTC timestamps
to be used in log files or syslog, the MTDM command also returns a non-UTC
timestamp in violation of the timestamp specification in RFC3659 (Para 2.3
time-val defintition).

Ideally, I believe the "use_localtime" option should NOT affect MDTM operation
at all, but this might affect backwards compatibility. As a workround, I have
implemented a "log_localtime" option which leaves MDTM unaffected. The preferred
settings then become "use_localtime=NO, log_localtime=YES", whilst the defaults
are "use_localtime=NO, log_localtime=NO" for backwards compatibility.

A patch against the current FC6 version is attached.

Version-Release number of selected component (if applicable):

This has been tested against a patched version on FC4 and FC6, but should be
applicable to ALL RedHat distributions using vsftpd-2.0.5.

How reproducible:

Enable use_localtime during summertime, and MDTM response violate RFC3659.
Disale use_localtime during summertime, and log entries have UTC timestamps.


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Ted Rule 2007-06-07 05:15:26 EDT
Created attachment 156436 [details]
Patch to add a "log_localtime" option to vsftpd
Comment 2 Charles R. Anderson 2007-10-11 15:29:19 EDT
I believe this issue still applies to vsftpd in Fedora 7 and 8.  Can the
submitter please update this and change the version to "devel".  Thanks.
Comment 3 Ted Rule 2007-10-13 07:16:19 EDT
Within postlogin.c, the handle_mdtm() function in the latest devel version of
vsftpd.RPM does indeed still appear to exhibit the problem, as in:

From:

../download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/vsftpd-2.0.5-19.fc8.src.rpm


handle_mdtm()
...
str_alloc_text(&s_mdtm_res_str,
                     vsf_sysutil_statbuf_get_numeric_date(
                       s_p_statbuf, tunable_use_localtime));
...

Consequently, I'll amend the status from FC6 to devel to reflect the desire to
fix this in FC8.



Comment 4 Martin Nagy 2007-12-04 03:16:58 EST
Thanks for the patch, but I decided to just revert the changes made in Bug
#143687 This means that use_localtime now does not have any affect on logging
(logs will be in local time). My reasons are, that there is already too much
options in vsftpd and I don't consider this change to be so drastic that we need
backward compatibility. Also, this way, we are more closer to the upstream.
Comment 5 Ted Rule 2007-12-04 04:29:59 EST
So presumably means that the following applies:

Pre-Bugzilla 143687:

Logs timestamp      - always UTC
LS response listing - toggled by use_localtime option
MDTM response       - toggled by use_localtime option

Current RPM:

Logs timestamp      - toggled by use_localtime option
LS response listing - toggled by use_localtime option
MDTM response       - toggled by use_localtime option

My patch - Bugzilla 243087:

Logs timestamp      - toggled by my log_localtime option
LS response listing - toggled by use_localtime option
MDTM response       - toggled by use_localtime option

RedHat response to Bugzlla 2243087:

Logs timestamp      - always local timestamp
LS response listing - toggled by use_localtime option
MDTM response       - toggled by use_localtime option

Seems fair - the backwards compatibility effect is thereby only to upset those
who rely on a UTC timestamp in the logs, which is probably a very small subset;
I would guess that most people enabled use_localtime=yes to get the logging
"correct" and somewhat ignored the downside of "broken" non-UTC timestamps in th
LS and MDTM responses.



Comment 6 Martin Nagy 2007-12-04 06:03:04 EST
You are correct, except for one thing:
Pre-Bugzilla 143687
Logs timestamp - always local timestamp
I know that the reporter of Bug #143687 stated otherwise, but all I did was that
I removed the patch and it works just fine for me. So I guess that he just
misconfigured something.
Comment 7 Martin Nagy 2007-12-04 07:39:03 EST
Fixed in vsftpd-2.0.5-21.fc9

Note You need to log in before you can comment on or make changes to this bug.