lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 21 Mar 2008 09:17:13 -0400
From:	"Theodore Ts'o" <tytso@....EDU>
To:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Cc:	"Theodore Ts'o" <tytso@....edu>
Subject: [PATCH, E2FSPROGS] debugfs, tune2fs: Handle daylight savings time when parsing a time string

We need to set tm_isdst to -1 so that mktime will automatically
determine whether or not daylight savings time (DST) is in effect.
Previously tm_isdst was set to 0, which caused mktime to interpret the
time as if it was always not using DST.

Addresses-Debian-Bug: #471882

Signed-off-by: "Theodore Ts'o" <tytso@....edu>
---
 debugfs/util.c |    1 +
 misc/tune2fs.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/debugfs/util.c b/debugfs/util.c
index 0633960..ebce9d6 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -231,6 +231,7 @@ extern time_t string_to_time(const char *arg)
 	    ts.tm_min > 59 || ts.tm_sec > 61)
 		ts.tm_mday = 0;
 #endif
+	ts.tm_isdst = -1;
 	ret = mktime(&ts);
 	if (ts.tm_mday == 0 || ret == ((time_t) -1)) {
 		/* Try it as an integer... */
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 4f66d42..4e731f5 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -540,6 +540,7 @@ static time_t parse_time(char *str)
 			str);
 		usage();
 	}
+	ts.tm_isdst = -1;
 	return (mktime(&ts));
 }
 
-- 
1.5.4.1.144.gdfee-dirty

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists