summaryrefslogtreecommitdiff
path: root/source3/lib/time.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-21s3:lib: Define TIME_FIXUP_CONSTANT_INT using INT64_C() macroJoseph Sutton1-5/+1
This is more portable than using preprocessor conditionals. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-12-19smbd: Remove unused srv_put_dos_date2()Volker Lendecke1-6/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2023-12-19smbd: Introduce srv_put_dos_date2_ts()Volker Lendecke1-0/+6
All but one uses of srv_put_dos_date2() converted from struct timespec. Put that into a new routine. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2023-10-04libsmb: Pass NTTIME to interpret_long_date()Volker Lendecke1-3/+1
Separate concerns of conversion and pulling off the wire. Needed soon for smb311 pidl generated parsing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-08-08s3:lib: Consistently return a string with a trailing newlineJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-12-06s3:lib: use nt_time_to_full_timespec() in interpret_long_date()Ralph Boehme1-1/+1
interpret_long_date() is now only used in the client. To enable correct processing of dates before the UNIX epoch, call nt_time_to_full_timespec(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-12-06s3:lib: add pull_long_date_full_timespec()Ralph Boehme1-0/+7
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-12-06s3:lib: add put_long_date_full_timespec()Ralph Boehme1-0/+12
put_long_date_full_timespec() will be used in the fileserver to marshall struct timespec timestamps that are sent to the client. By using full_timespec_to_nt_time() which supports tv_sec=0 and negative values, we can return timestamps to clients with a date before the UNIX epoch. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-12-06s3:lib: let round_timespec() handle SAMBA_UTIME_OMITRalph Boehme1-0/+4
This ensures callers are not required to do the check themselves and we don't clobber omit-timespecs in this function. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-12-06s3:lib: remove unused uint64s_nt_time_to_unix_abs()Ralph Boehme1-7/+0
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12lib: remove unused function nttime_from_string()Swen Schillig1-9/+0
Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_timeVolker Lendecke1-1/+1
Both take and return values now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30lib: Align unix_timespec_to_nt_time with nt_time_to_unix_timespecVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-18lib: Use BVAL macro in interpret_long_dateVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2012-09-19s3: Use SBVAL in put_long_date_timespecVolker Lendecke1-2/+1
Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Sep 19 01:16:25 CEST 2012 on sn-devel-104
2012-09-18s3: Fix some nonempty line endingsVolker Lendecke1-12/+12
Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Sep 18 22:39:07 CEST 2012 on sn-devel-104
2011-10-26s3:lib: make_unix_date3() is the same as pull_dos_date3()Stefan Metzmacher1-5/+1
Except for a 'void *' vs. 'uint8_t *'. As a first step let make_unix_date() call pull_dos_date(), so that we he the logic only once. We can fix the callers later. metze
2011-10-26s3:lib: make_unix_date2() is the same as pull_dos_date2()Stefan Metzmacher1-7/+1
Except for a 'void *' vs. 'uint8_t *'. As a first step let make_unix_date() call pull_dos_date(), so that we he the logic only once. We can fix the callers later. metze
2011-10-26s3:lib: make_unix_date() is the same as pull_dos_date()Stefan Metzmacher1-19/+1
Except for a 'void *' vs. 'uint8_t *'. As a first step let make_unix_date() call pull_dos_date(), so that we he the logic only once. We can fix the callers later. metze
2011-09-23lib/util: move some timespec helpers from source3 to the toplevelStefan Metzmacher1-146/+0
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Sep 23 00:15:31 CEST 2011 on sn-devel-104
2011-03-01lib/util/time: Merge time functions from source3/lib/time.cAndrew Bartlett1-63/+0
2010-09-14Ensure incoming timespec values correctly wrap at nsecs.Jeremy Allison1-0/+4
Jeremy.
2010-08-31s3: use clock_gettime() in timespec_current()Björn Jacke1-4/+1
2010-08-05s3: Remove some pointless wrapper functionsVolker Lendecke1-19/+0
2010-08-05s3: Remove some pointless wrapper functionsVolker Lendecke1-17/+1
2010-05-21s3:passdb Remove use of uint8 uint16 and uint32 in favour of C99 typesAndrew Bartlett1-2/+2
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-23s3-time: Added a function to get the startup time of the server.Andreas Schneider1-0/+13
Signed-off-by: Günther Deschner <gd@samba.org>
2010-01-08s3-time: fix build warnings after we moved to shared time functions.Günther Deschner1-6/+6
Bjoern, please check. Guenther
2010-01-07s3:lib/time: remove TIME_T_MIN/MAX definesBjörn Jacke1-8/+0
we already get them from lib/util/time.h
2010-01-07ѕ3:lib/time: replace make_dos_ and put_dos_ functions with those from lib/util/Björn Jacke1-89/+6
2010-01-07s3:lib/time: remoce null_mtime() - use null_time()Björn Jacke1-13/+2
2010-01-07s3:lib/time: remove unused nt_time_equalsBjörn Jacke1-8/+0
we have nt_time_equal doing the same in lib/util/
2009-11-19s3: Factor timeval_string out of current_timestring()Volker Lendecke1-12/+13
2009-11-17Remove "store create time" code, cause create time to be storedJeremy Allison1-0/+27
in the "user.DOSATTRIB" EA. From the docs: In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store the create time for a file as well as the DOS attributes. This is done in a backwards compatible way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this extended attribute by earlier versions of Samba, but they will not be able to read the create time stored there. Storing the create time separately from the normal filesystem meta-data allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem. Passes make test but will need more testing. Jeremy.
2009-08-24Second attempt at fix for bug 6529 - Offline files conflict with Vista and ↵Jeremy Allison1-4/+20
Office 2003. Confirmation from reporter that this fixes the issue in master on ext3/ext4. Back-ports to follow. Jeremy.
2009-08-24Use existing time_t rounding function, don't invent my own.Jeremy Allison1-1/+1
Jeremy.
2009-08-24Second part of fix for 6529 - Offline files conflict with Vista and Office 2003.Jeremy Allison1-0/+10
ext4 may be able to store ns timestamps, but the only API to *set* timestamps takes usec, not nsec. Round to usec on set requests. Jeremy.
2009-08-21Fix bug 6529 - Offline files conflict with Vista and Office 2003Jeremy Allison1-0/+11
On filesystems that can't store less than one second timestamps, round the incoming timestamp set requests so the client can't discover that a time set request has been truncated by the filesystem. Needs backporting to 3.4, 3.3, 3.2 and (even) 3.0. Jeremy
2009-05-26Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke1-245/+0
This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
2009-05-05Make cli_getatr() async.Jeremy Allison1-1/+1
Jeremy.
2009-05-05Make cli_getattrE async.Jeremy Allison1-1/+1
Jeremy.
2009-02-12tidy up timestamp checksBjörn Jacke1-33/+33
AC_CHECK_MEMBERS should be a sufficient check, there's no need to do manual compile tests. We can also assume that we have ctime and atime members when we have the mtime member.
2009-01-29add Tru64 sub-second resolution timestamp supportBjörn Jacke1-0/+24
2009-01-29add missing semicolonsBjörn Jacke1-6/+6
the fixed configure check led to a missing semicolon in the now activated BSD code. Then this error was even copypasted into the new AIX code. grrr
2009-01-29setting mtime setted atime on BSD systems, fix thisBjörn Jacke1-2/+2
2009-01-29add AIX sub-second resolution timestamp supportBjörn Jacke1-0/+24
2009-01-23This change allows for the autoconfigre detection of sub-second time ↵todd stecher1-0/+12
resolution in the FreeBSD stat structure
2008-12-23Fix use of "time offset" parameter, and add test to make sure I don't break ↵Jelmer Vernooij1-2/+0
it again :-)
2008-10-22Use standard types.Jelmer Vernooij1-16/+16
2008-10-11Cope with changed signature of http_timestring().Jelmer Vernooij1-558/+0