summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2019-09-04 14:40:22 +0000
committercheloha <cheloha@openbsd.org>2019-09-04 14:40:22 +0000
commit612d413b9d71186a1d9aa84a05fb932a36f9abc1 (patch)
treec9d8327e13acb0e13c8df121c48d9f8a21076fbd
parentRemove DST/TIMEZONE options(4) from kernel configs; ok jca@ deraadt@ (diff)
downloadwireguard-openbsd-612d413b9d71186a1d9aa84a05fb932a36f9abc1.tar.xz
wireguard-openbsd-612d413b9d71186a1d9aa84a05fb932a36f9abc1.zip
msdosfs: remove timezone support
This support is undocumented, only works if you're using the kernel timezone, and breaks during a DST shift. It also preferences file systems managed by a Windows installation: many implementations, like ours, use UTC by default (think: phones, digital cameras). No complaints on tech@. "good riddance" tedu@, "Yep." deraadt@
-rw-r--r--sys/msdosfs/msdosfs_conv.c8
-rw-r--r--usr.sbin/makefs/msdos/msdosfs_vfsops.c11
2 files changed, 5 insertions, 14 deletions
diff --git a/sys/msdosfs/msdosfs_conv.c b/sys/msdosfs/msdosfs_conv.c
index 80eec767891..11f263ee326 100644
--- a/sys/msdosfs/msdosfs_conv.c
+++ b/sys/msdosfs/msdosfs_conv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_conv.c,v 1.19 2015/10/23 10:45:31 krw Exp $ */
+/* $OpenBSD: msdosfs_conv.c,v 1.20 2019/09/04 14:40:22 cheloha Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.24 1997/10/17 11:23:54 ws Exp $ */
/*-
@@ -108,8 +108,7 @@ unix2dostime(struct timespec *tsp, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
- t = tsp->tv_sec - (tz.tz_minuteswest * 60)
- /* +- daylight saving time correction */ ;
+ t = tsp->tv_sec;
t &= ~1;
/*
* Before 1/1/1980 there is only a timeless void. After 12/31/2107
@@ -228,8 +227,7 @@ dos2unixtime(u_int dd, u_int dt, u_int dh, struct timespec *tsp)
days += ((dd & DD_DAY_MASK) >> DD_DAY_SHIFT) - 1;
lastseconds = (days * 24 * 60 * 60) + SECONDSTO1980;
}
- tsp->tv_sec = seconds + lastseconds + (tz.tz_minuteswest * 60)
- /* -+ daylight saving time correction */ ;
+ tsp->tv_sec = seconds + lastseconds;
tsp->tv_nsec = (dh % 100) * 10000000;
}
diff --git a/usr.sbin/makefs/msdos/msdosfs_vfsops.c b/usr.sbin/makefs/msdos/msdosfs_vfsops.c
index 4af65f5fe63..91032db91ab 100644
--- a/usr.sbin/makefs/msdos/msdosfs_vfsops.c
+++ b/usr.sbin/makefs/msdos/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.11 2016/12/17 16:43:30 krw Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.12 2019/09/04 14:40:22 cheloha Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,6 @@
*/
#include <sys/param.h>
-#include <sys/time.h>
#include "ffs/buf.h"
@@ -87,7 +86,6 @@ msdosfs_mount(struct mkfsvnode *devvp, int flags)
uint8_t SecPerClust;
int ronly = 0, error;
int bsize;
- struct timezone tz;
unsigned secsize = 512;
DPRINTF(("%s(bread 0)\n", __func__));
@@ -125,12 +123,7 @@ msdosfs_mount(struct mkfsvnode *devvp, int flags)
pmp->pm_SecPerTrack = getushort(b50->bpbSecPerTrack);
pmp->pm_Heads = getushort(b50->bpbHeads);
pmp->pm_Media = b50->bpbMedia;
-
- if (gettimeofday(NULL, &tz) == -1) {
- error = errno;
- goto error_exit;
- }
- pmp->pm_minuteswest = tz.tz_minuteswest;
+ pmp->pm_minuteswest = 0;
DPRINTF(("%s(BytesPerSec=%u, ResSectors=%u, FATs=%d, RootDirEnts=%u, "
"Sectors=%u, FATsecs=%lu, SecPerTrack=%u, Heads=%u, Media=%u)\n",