aboutsummaryrefslogtreecommitdiff
path: root/contrib/tzcode
Commit message (Collapse)AuthorAgeFilesLines
* ctime.3: Add a cross-reference to clock_gettime(2)Mateusz Piotrowski2022-03-041-1/+2
| | | | MFC after: 1 week
* tzcode: fix tz change detection logicKyle Evans2021-12-211-1/+1
| | | | | | | | | clock_gettime() returns 0 if it succeeds, so don't capture that into the fail logic. With this, WITH_DETECT_TZ_CHANGES successfully detects a change after 61 seconds. Reviewed by: imp, trasz Differential Revision: https://reviews.freebsd.org/D33494
* tzcode: Fix operation without WITH_DETECT_TZ_CHANGESEdward Tomasz Napierala2021-09-141-1/+1
| | | | | | | | | Reviewed By: bdrewery, kevans, cy Reported By: lwhsu, bdrewery Fixes: ddedf2a11eb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31961
* tzcode: Implement timezone change detectionEdward Tomasz Napierala2021-09-121-1/+88
| | | | | | | | | | | | Implement optional timezone change detection for local time libc functions. This is disabled by default; set WITH_DETECT_TZ_CHANGES to build it. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #47 Differential Revision: https://reviews.freebsd.org/D30183
* Remove duplicated lines in contrib/tzcode/stdtime/private.hTim McNamara2021-05-311-9/+0
| | | | | | | | Note by imp: this is clearly a mis-merge from the vendor branch which doesn't have this stutter in it. Reviewed by: imp@,ngie@ Pull Request: https://github.com/freebsd/freebsd-src/pull/154
* ctime(3): Bump .Dd after r362165Gordon Bergling2020-06-171-1/+1
| | | | | | | | | | Reported by: bcr (mentor) Reviewed by: bcr (mentor) Approved by: bcr (mentor) X-MFC-With: r362165 Notes: svn path=/head/; revision=362274
* Add a HISTORY section to ctime(3)Gordon Bergling2020-06-141-0/+27
| | | | | | | | | | | Reviewed by: bcr (mentor) Approved by: bcr (mentor) Obtained from: OpenBSD MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D24635 Notes: svn path=/head/; revision=362165
* ctime.3: Use ASCII asterisks for C, not special unicode math glyphsConrad Meyer2020-05-221-12/+12
| | | | | | | | PR: 246656 Reported by: danfe Notes: svn path=/head/; revision=361385
* Remove no longer relevant comment, as suggested by imp@.Edward Tomasz Napierala2018-10-301-1/+0
| | | | | | | | MFC after: 2 weeks Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=339921
* Remove useless call to access(2) from tzcode. Quoting OpenBSD:Edward Tomasz Napierala2018-10-301-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | > Remove doaccess variable and access(2) call since this interfers with > applications like zdump(8) because pledge(2) doesn't allow access(2) to > /usr/share/zoneinfo. > > millert@ better described why this call can go away: > > "This looks like an attempt to do access checks based on the real uid instead > of the effective uid. Basically for setuid programs we don't want to allow a > user to set TZ to a path they should not be able to otherwise access. > > However, we already have a check for issetugid() above so I think the doaccess > bits can just be removed and we can rely on open()." > > After discussion with tb@, deraadt@ and millert@, this was also OK'ed by them Reviewed by: imp Obtained from: OpenBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17701 Notes: svn path=/head/; revision=339920
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* localtime: return NULL if time_t out of range of struct tmEd Maste2017-02-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would truncate tm.tm_year for any time_t corresponding to a year that does not fit in int. This issue was discovered because it caused the bash-static build to fail when linking with LLD. As reported by Rafael EspĂ­ndola: Configure has AC_FUNC_MKTIME which expands to a test of mktime that fails with the freebsd implementation. Given that, bash compiles a mktime.o file that defines just mktime and uses localtime. That goes in a .a file that is before libc. The freebsd libc defines mktime in localtime.o, which also defines localtime among other functions. When lld sees an undefined reference to mktime from libc, it uses the bash provided one and then tries to find a definition of localtime. It is found on libc's localtime.o, but now we have a duplicated error. The reason it works with bfd is that bash doesn't use mktime directly and the undefined reference from libc is resolved to the libc implementation. It would also fail to link if bash itself directly used mktime. The bash-static configure test verifies that, for many values of t, either localtime(t) returns NULL or mktime(localtime(t)) == t. This test failed when localtime returned a truncated tm_year. This was fixed in tzcode in 2004 but has persisted in our tree since rS2708. Reported by: Rafael EspĂ­ndola Reviewed by: bapt MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9534 Notes: svn path=/head/; revision=313774
* Incorporate a change from OpenBSD by millert@OpenBSD.orgBaptiste Daroussin2016-10-082-33/+11
| | | | | | | | | | | | | | | | | | Don't warn about valid time zone abbreviations. POSIX through 2000 says that an abbreviation cannot start with ':', and cannot contain ',', '-', '+', NUL, or a digit. POSIX from 2001 on changes this rule to say that an abbreviation can contain only '-', '+', and alphanumeric characters from the portable character set in the current locale. To be portable to both sets of rules, an abbreviation must therefore use only ASCII letters." Adapted from tzcode2015f. This is needed to be able to update tzdata to a newer version MFC after: 3 days Notes: svn path=/head/; revision=306852
* Merge:Craig Rodrigues2015-10-083-80/+45
| | | | | | | | | | | | | commit 400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd Author: Paul Eggert <eggert@cs.ucla.edu> Date: Fri Oct 12 07:53:12 2012 -0700 Assume C89. https://github.com/eggert/tz/commit/400ecf36bb0b73f6390f9641e6cb8bbfb91a5cfd Notes: svn path=/head/; revision=289027
* Revert WiP to contrib/tzcode accidentally committed with r274364Enji Cooper2014-11-111-10/+2
| | | | Notes: svn path=/head/; revision=274365
* Add baud rate support to telnet(1)Enji Cooper2014-11-111-2/+10
| | | | | | | | | | | | | | | | This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274364
* Fix typo. Note that although this file is under contrib, it has divergedGavin Atkinson2014-05-151-1/+1
| | | | | | | | | | | | | sufficiently from upstream (including a full whitespace commit and large portions rewritten) that this change does not move us further from the upstream. PR: docs/186608 Submitted by: Jamie Landeg-Jones <jamie@dyslexicfish.net> MFC after: 3 days Notes: svn path=/head/; revision=266111
* tzfile.5: catch up to r204333Benjamin Kaduk2013-12-161-1/+1
| | | | | | | | | | | | | | | The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h is not an installed header, so the man page refers to its location in the source tree. The documentation could be more clear about the internal nature of the header, but those changes should go through upstream tzcode. PR: docs/176864 Approved by: hrs (mentor) Notes: svn path=/head/; revision=259446
* - set progname for use in usage()Eitan Adler2011-12-081-0/+1
| | | | | | | | | | PR: bin/162908 Submitted by: Oleg Ginzburg <olevole@olevole.ru> Approved by: sbruno@ MFC after: 3 days Notes: svn path=/head/; revision=228342
* Fix a memory leak in tzload().Mikolaj Golub2011-10-271-0/+1
| | | | | | | | | Reported by: valgrind Reviewed by: kib MFC after: 3 days Notes: svn path=/head/; revision=226828
* Do not overallocate on the stack. Threaded code might use custom stackKonstantin Belousov2011-09-191-43/+69
| | | | | | | | | | | | | size. Reported by: many Tested by: Jeremie Le Hen <jeremie@le-hen.org> (previous version) Reviewed by: jilles Approved by: re (bz) MFC after: 2 weeks Notes: svn path=/head/; revision=225677
* Sync code with tzcode2010mEdwin Groothuis2010-10-274-29/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asctime.c: * Set errno to EINVAL and return "??? ??? ?? ??:??:?? ????\n" if asctime_r is called with a NULL struct tm pointer. (Note that asctime_r is called by ctime_r and asctime; asctime is called by ctime.) localtime.c: * Set errno to EINVAL and return WRONG if time1 is called with a NULL struct tm pointer; avoid dereference if a NULL struct tm pointer is passed to timelocal, timegm, or timeoff. (Note that time1 is called by mktime, timegm, and timeoff; mktime is called by timelocal.) * more core-avoidance work * Change to set timezone and altzone based on time types with greatest transition times (for the benefit of Asia/Seoul). zic.8: * Warning about case-sensitivity of names, but not of abbrevations zic.c: * Conditionally output extra types with most-recently-use offsets last (for use by systems with pre-2011 versions of localtime.c, helping to ensure that globals "altzone and "timezone" get set correctly). The code has been running for nearly four weeks on my laptop running FreeBSD 8.1 without a problem. MFC after: 1 month Notes: svn path=/head/; revision=214411
* Make mandoc/mdocml happy.Edwin Groothuis2010-06-151-7/+7
| | | | | | | Submitted by: Uli(?) via gmane.comp.time.tz Notes: svn path=/head/; revision=209201
* Update GRANDPARENTED text to match the contents of tzdata/factory r19879.Ed Maste2010-05-031-1/+1
| | | | | | | | | | | This eliminates "warning: time zone abbreviation differs from POSIX" on installworld to an empty filesystem. Reviewed by: edwin MFC after: 1 week Notes: svn path=/head/; revision=207590
* Remove non-contributed code.Edwin Groothuis2010-02-259-1976/+0
| | | | Notes: svn path=/head/; revision=204336
* Copy lib/libc/stdtime to contrib/tzcode/stdtime for the proper splitEdwin Groothuis2010-02-2517-0/+5595
| | | | | | | of contributed code and FreeBSD specific code. Notes: svn path=/head/; revision=204333
* From contrib/tzcode:Edwin Groothuis2010-02-252-11/+0
| | | | | | | | | | | The Makefiles are leftovers from the copies and should live in usr.sbin/zic/* From usr.sbin/zic: The sources are from a vendor contributed source, therefore should live in contrib/tzcode/zic. Notes: svn path=/head/; revision=204332
* Copy usr.sbin/zic to contrib/tzcode/zic for the proper split ofEdwin Groothuis2010-02-2513-0/+5057
contributed code and FreeBSD specific code. Notes: svn path=/head/; revision=204302