summaryrefslogtreecommitdiffstats
path: root/source3/lib/time.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-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.
* Make cli_getatr() async.Jeremy Allison2009-05-051-1/+1
| | | | Jeremy.
* Make cli_getattrE async.Jeremy Allison2009-05-051-1/+1
| | | | Jeremy.
* tidy up timestamp checksBjörn Jacke2009-02-121-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.
* add Tru64 sub-second resolution timestamp supportBjörn Jacke2009-01-291-0/+24
|
* add missing semicolonsBjörn Jacke2009-01-291-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
* setting mtime setted atime on BSD systems, fix thisBjörn Jacke2009-01-291-2/+2
|
* add AIX sub-second resolution timestamp supportBjörn Jacke2009-01-291-0/+24
|
* This change allows for the autoconfigre detection of sub-second time ↵todd stecher2009-01-231-0/+12
| | | | resolution in the FreeBSD stat structure
* Fix use of "time offset" parameter, and add test to make sure I don't break ↵Jelmer Vernooij2008-12-231-2/+0
| | | | it again :-)
* Use standard types.Jelmer Vernooij2008-10-221-16/+16
|
* Cope with changed signature of http_timestring().Jelmer Vernooij2008-10-111-558/+0
|
* Deal with systems that don't initialize birthtime correctly.Jeremy Allison2008-08-291-4/+10
| | | | | | Pointed out by SATOH Fumiyasu <fumiyas@osstech.jp>. Jeremy. (This used to be commit 4f60348c0a934123a8e15bc741076366f6713390)
* Add st_birthtime and friends for accurate create times on systems that ↵Jeremy Allison2008-08-271-10/+30
| | | | | | | | support it (*BSD and MacOSX). Should have done this ages ago, sorry. Jeremy. (This used to be commit 4c3a9558906f213948c3bdc081be73f8fed148cb)
* time: move uint64s_nt_time_to_unix_abs() to lib/time.cGünther Deschner2008-06-231-0/+7
| | | | | Guenther (This used to be commit 58f54f180f0a942776455ab6e813628422493dac)
* Fix bug #5531 - fix conversion of ns units when converting from nttime to ↵Jeremy Allison2008-06-201-2/+6
| | | | | | | | timespec. Fix from hkurma@datadomain.com. Jeremy. (This used to be commit 8c87a4319cc83f55fb105cae81a8efbc3fb5b98b)
* Add a talloc context parameter to current_timestring() to fix memleaks.Michael Adam2008-03-281-2/+2
| | | | | | | | | | | | | | current_timestring used to return a string talloced to talloc_tos(). When called by DEBUG from a TALLOC_FREE, this produced messages "no talloc stackframe around, leaking memory". For example when used from net conf. This also adds a temporary talloc context to alloc_sub_basic(). For this purpose, the exit strategy is slightly altered: a common exit point is used for success and failure. Michael (This used to be commit 16b5800d4e3a8b88bac67b2550d14e0aaaa302a9)
* Some C++ warningsVolker Lendecke2007-12-211-2/+2
| | | | (This used to be commit 5ab82d4f574f2a2e2761e9e414c66a70aeffb05d)
* Remove the explicit TALLOC_CTX * from cli_struct.Jeremy Allison2007-11-291-3/+3
| | | | | | | Make us very explicit about how long a talloc ctx should last. Jeremy. (This used to be commit ba9e2be2b5a59684e854609f9d82ea1633448c62)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-12/+12
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* r24949: Remove some static buffersVolker Lendecke2007-10-101-10/+8
| | | | (This used to be commit df648d47ff3c4e24f439fda839653bda98323100)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r23357: timespec_current() was returning the wrong ns timeJeremy Allison2007-10-101-1/+1
| | | | | | (multiplying tv_sec, not tv_usec). Jeremy. (This used to be commit bafd3b93f9ce74d7a8e2d6b36735f0977a22882c)
* r23041: Remainder of fix for 4630: fix special case of unix_to_nt_time() forJim McDonough2007-10-101-2/+10
| | | | | TIME_T_MAX, and also display of it in http_timestring() (This used to be commit 2553b6a56d20ef6273001ae3b090e156e676592c)
* r23006: Arg. Fix stupid typo in 64-bit path.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 80a63123907c3291d8bdc6d364bf7343f4f084a0)
* r23005: If we're running on a system where time_t is 8 bytesJeremy Allison2007-10-101-0/+31
| | | | | | | | | we have to take care to preserve the "special" values for Windows of 0x80000000 and 0x7FFFFFFF when casting between time_t and uint32. Add conversion functions (and use them). Jeremy. (This used to be commit 4e1a0b2549f7c11326deed2801de19564af0f16a)
* r21714: Change the VFS interface to use struct timespecJeremy Allison2007-10-101-31/+113
| | | | | | | | | | | for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy. (This used to be commit 8f3d530c5a748ea90f42ed8fbe68ae92178d4875)
* r21637: Get "password never expires" account policy working.Jim McDonough2007-10-101-3/+9
| | | | | | 0x8000000000000000LL is "infinity" to NT and should not be converted numerically to time_t. (This used to be commit f3a8048a628753990f9c5401b2bb50c19d4f66e3)
* r21060: Start refactoring out the non-return case statementsJeremy Allison2007-10-101-8/+8
| | | | | | into functions. Jeremy. (This used to be commit 461db3c8ed045cac70eccf3200bf9163dbce5826)
* r20695: Remove duplication of constants.Jeremy Allison2007-10-101-11/+2
| | | | | Jeremy. (This used to be commit 66cca893e1aa035fa0aa05c0d542848f084fac31)
* r20694: To get this right we need to do signed 64-bitJeremy Allison2007-10-101-7/+7
| | | | | | | | comparisons here, not unsigned as we're eventually casting into what it normall a signed 32 bit value. Guenther please check (but I think I'm right here). Jeremy. (This used to be commit 31f8e0edc0c3e76654728b2c204faa70830e1f1b)
* r20692: Fix bug found by Guenther -Jeremy Allison2007-10-101-1/+1
| | | | | | | | | | | | | | | | Just try to log on in offline mode without the fix: all accounts are expired, although they are set to never expire in the PAC/info3. NTTIME "Never" needs to get (time_t) -1. We were casting a uint64 to time_t before comparing, and we should have been doing it the other way around. Guenther please check this fixes things. Jeremy. (This used to be commit f4e898b6224fd82d9805da771ef6040065de7b12)
* r18597: A C++ warningVolker Lendecke2007-10-101-1/+1
| | | | (This used to be commit 528082aed8c24b54d5781c6b3a6062b6cded74ef)
* r18188: merge 3.0-libndr branchJelmer Vernooij2007-10-101-848/+838
| | | | (This used to be commit 1115745caed3093c25d6be01ffee21819fb0a675)
* r18009: Fixes bug 4026.Derrell Lipman2007-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | This completes the work Jeremy began last week, disambiguating the meaning of c_time. (In POSIX terminology, c_time means "status Change time", not "create time".) All uses of c_time, a_time and m_time have now been replaced with change_time, access_time, and write_time, and when creation time is intended, create_time is used. Additionally, the capability of setting and retrieving the create time have been added to the smbc_setxattr() and smbc_getxattr() functions. An example of setting all four times can be seen with the program examples/libsmbclient/testacl with the following command line similar to: testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt' The -f option turns on the new mode which uses full time names in the attribute specification (e.g. ACCESS_TIME vs A_TIME). (This used to be commit 8e119b64f1d92026dda855d904be09912a40601c)
* r17834: Another bug found by Volker's tests in the build farm !Jeremy Allison2007-10-101-7/+1
| | | | | | Correctly map large nt timevals to TIME_T_MAX. Jeremy. (This used to be commit 63b13d28795bbce6d9fe9e0aa4f518ef94c44f18)
* r17831: Attempt to fix the build farm: 0x7fffffffffffffff needs special ↵Volker Lendecke2007-10-101-0/+6
| | | | | | | | | | | | | | | | | | | | casing too I think. This broke 'make test' because the newly created user was set to be kicked off Mi, 22 Jan 1975 23:55:33 CET (unix time 159663333) with the setuserinfo21 call. I'm not 100% sure that 0x7ff... means max time as I do it here, I vaguely remember it to mean "don't touch". Does anybody know that for sure? Jeremy, please check this. Thanks, Volker (This used to be commit 872d1299ebffb7b7d696013fc676820f1fa1777c)
* r17818: Fixup uint64 time calc. NT time is a 64 bit number,Jeremy Allison2007-10-101-3/+3
| | | | | | not high value seconds, low value 100ns units. Jeremy. (This used to be commit ead75870d5d3c690fabd131a9dd8776e854638dc)
* r17812: Fix bad unsigned comparisons with TIME_T_MIN/TIME_T_MAX.Jeremy Allison2007-10-101-3/+3
| | | | | Jeremy. (This used to be commit bd1fbdfb824883060b02be969a10f999d387973f)
* r17809: Add in 64-bit integer time calculations (taken fromJeremy Allison2007-10-101-41/+160
| | | | | | | | Samba4) for machines that have 64-bit integers. Leave the (double) code for machines that don't. Needs testing.... :-). Jeremy. (This used to be commit 9e65c175b0794bea3082785b5da6f5b281887ce7)
* r17800: Start using struct timespec internally for file timesJeremy Allison2007-10-101-26/+147
| | | | | | | | | | on the wire. This allows us to go to nsec resolution for systems that support it. It should also now be easy to add a correct "create time" (birth time) for systems that support it (*BSD). I'll be watching the build farm closely after this one for breakage :-). Jeremy. (This used to be commit 425280a1d23f97ef0b0be77462386d619f47b21d)
* r17767: Argggg. Broke the build. Need to fix callers of put_long_date()Jeremy Allison2007-10-101-68/+29
| | | | | | and interpret_long_date() first. Reverting... Jeremy. (This used to be commit 5d9c308e7b780c956f9810c9f345d1ef32d0f528)
* r17766: Getting ready to properly expose 100ns times onJeremy Allison2007-10-101-29/+68
| | | | | | | the wire. Move the internals of nt_time functions to use struct timespecs. Jeremy. (This used to be commit 4ece92f7ef070c86ee7c6f523a207cfaccf84478)
* r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison2007-10-101-1/+46
| | | | | | | | to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
* r16230: Fix Klocwork #861 and others. localtime and asctimeJeremy Allison2007-10-101-6/+32
| | | | | | can return NULL. Ensure we check all returns correctly. Jeremy. (This used to be commit 6c61dc8ed6d84f310ef391fb7700e93ef42c4afc)
* r16047: Remove unnecessary line, as this value is set in either branch of theJim McDonough2007-10-101-1/+0
| | | | | 'if' below. Spotted by Aleksey Fedoseev. (This used to be commit 00eb42791abf3e34dc42a2067f07b8549ea31abb)
* r15449: Remove unused function get_nttime_max (which claims itJames Peach2007-10-101-6/+0
| | | | | is incorrect). (This used to be commit e7ddcd8c33de1d2f053ac4c5fdaef5c31c280318)
* r13427: Fix ctime -> st_ctime.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 95793d7e64d30190ebf917745c719f9c5a1b31e2)
* r13423: Write wrapper functions (and configure tests) so we canJeremy Allison2007-10-101-0/+102
| | | | | | | | always assume we can get a struct timespec out of a stat struct. This will allow us to portably move to nsec timestamps on files and directories in the file server code in future. Jeremy. (This used to be commit 07132d8796a08aa71d6719cb07b5b2c999930632)