1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

124 Commits

Author SHA1 Message Date
Andreas Schneider
3f1cc29814 s3-time: Added a function to get the startup time of the server.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-04-23 16:06:42 +02:00
Günther Deschner
1bc953088f s3-time: fix build warnings after we moved to shared time functions.
Bjoern, please check.

Guenther
2010-01-08 12:35:25 +01:00
Björn Jacke
f5729dbb6e s3:lib/time: remove TIME_T_MIN/MAX defines
we already get them from lib/util/time.h
2010-01-07 00:50:38 +01:00
Björn Jacke
b3e065e0c6 ѕ3:lib/time: replace make_dos_ and put_dos_ functions with those from lib/util/ 2010-01-07 00:50:10 +01:00
Björn Jacke
c5f24c3eac s3:lib/time: remoce null_mtime() - use null_time() 2010-01-07 00:49:57 +01:00
Björn Jacke
c1c7b6cecb s3:lib/time: remove unused nt_time_equals
we have nt_time_equal doing the same in lib/util/
2010-01-07 00:49:49 +01:00
Volker Lendecke
d3d37acb99 s3: Factor timeval_string out of current_timestring() 2009-11-19 19:04:38 +01:00
Jeremy Allison
a770caed0f Remove "store create time" code, cause create time to be stored
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-11-17 14:55:02 -08:00
Jeremy Allison
c69f92d16d Second attempt at fix for bug 6529 - Offline files conflict with Vista and Office 2003.
Confirmation from reporter that this fixes the issue in master on ext3/ext4.
Back-ports to follow.
Jeremy.
2009-08-24 20:57:37 -07:00
Jeremy Allison
7a6c979299 Use existing time_t rounding function, don't invent my own.
Jeremy.
2009-08-24 15:09:29 -07:00
Jeremy Allison
87d30a1968 Second part of fix for 6529 - Offline files conflict with Vista and Office 2003.
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-24 12:30:05 -07:00
Jeremy Allison
1af0aa92b3 Fix bug 6529 - Offline files conflict with Vista and Office 2003
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-08-21 21:44:21 -07:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
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-26 17:48:23 +02:00
Jeremy Allison
4cbd0c77e4 Make cli_getatr() async.
Jeremy.
2009-05-05 20:59:22 -07:00
Jeremy Allison
e091fdc565 Make cli_getattrE async.
Jeremy.
2009-05-05 16:28:44 -07:00
Björn Jacke
263b798db9 tidy up timestamp checks
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-02-12 13:00:44 +01:00
Björn Jacke
d177015a6d add Tru64 sub-second resolution timestamp support 2009-01-29 15:26:13 -08:00
Björn Jacke
29ab9ed933 add missing semicolons
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-29 12:12:29 -08:00
Björn Jacke
12f57f95b5 setting mtime setted atime on BSD systems, fix this 2009-01-29 09:51:36 -08:00
Björn Jacke
3639e525a9 add AIX sub-second resolution timestamp support 2009-01-29 09:51:36 -08:00
todd stecher
7bb3860f49 This change allows for the autoconfigre detection of sub-second time resolution in the FreeBSD stat structure 2009-01-23 21:05:38 -08:00
Jelmer Vernooij
ef80d1b794 Fix use of "time offset" parameter, and add test to make sure I don't break it again :-) 2008-12-23 22:10:34 +01:00
Jelmer Vernooij
e16e6e9cb0 Use standard types. 2008-10-22 03:41:24 +02:00
Jelmer Vernooij
cb78d4593b Cope with changed signature of http_timestring(). 2008-10-11 23:57:44 +02:00
Jeremy Allison
b12c7dbb53 Deal with systems that don't initialize birthtime correctly.
Pointed out by SATOH Fumiyasu <fumiyas@osstech.jp>.
Jeremy.
(This used to be commit 4f60348c0a)
2008-08-29 09:29:07 -07:00
Jeremy Allison
1cae2ac905 Add st_birthtime and friends for accurate create times on systems that support it (*BSD and MacOSX).
Should have done this ages ago, sorry.
Jeremy.
(This used to be commit 4c3a955890)
2008-08-27 15:06:14 -07:00
Günther Deschner
33000d77e4 time: move uint64s_nt_time_to_unix_abs() to lib/time.c
Guenther
(This used to be commit 58f54f180f)
2008-06-23 23:38:52 +02:00
Jeremy Allison
c4d6ca41d9 Fix bug #5531 - fix conversion of ns units when converting from nttime to timespec.
Fix from hkurma@datadomain.com.
Jeremy.
(This used to be commit 8c87a4319c)
2008-06-20 13:23:31 -07:00
Michael Adam
9644b6cb50 Add a talloc context parameter to current_timestring() to fix memleaks.
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 16b5800d4e)
2008-03-28 16:34:51 +01:00
Volker Lendecke
addf598cde Some C++ warnings
(This used to be commit 5ab82d4f57)
2007-12-21 09:58:20 +01:00
Jeremy Allison
d2cf97aeba Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
(This used to be commit ba9e2be2b5)
2007-11-29 13:24:54 -08:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
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 f35a266b3c)
2007-10-18 17:40:25 -07:00
Volker Lendecke
ff0947fbed r24949: Remove some static buffers
(This used to be commit df648d47ff)
2007-10-10 12:30:29 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Jeremy Allison
51ea3a2d00 r23357: timespec_current() was returning the wrong ns time
(multiplying tv_sec, not tv_usec).
Jeremy.
(This used to be commit bafd3b93f9)
2007-10-10 12:23:09 -05:00
Jim McDonough
0afd56aa83 r23041: Remainder of fix for 4630: fix special case of unix_to_nt_time() for
TIME_T_MAX, and also display of it in http_timestring()
(This used to be commit 2553b6a56d)
2007-10-10 12:22:16 -05:00
Jeremy Allison
92dba2329f r23006: Arg. Fix stupid typo in 64-bit path.
Jeremy.
(This used to be commit 80a6312390)
2007-10-10 12:22:14 -05:00
Jeremy Allison
c15c0f2a47 r23005: If we're running on a system where time_t is 8 bytes
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 4e1a0b2549)
2007-10-10 12:22:13 -05:00
Jeremy Allison
4952fe368a r21714: Change the VFS interface to use struct timespec
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 8f3d530c5a)
2007-10-10 12:18:24 -05:00
Jim McDonough
efd510fa18 r21637: Get "password never expires" account policy working.
0x8000000000000000LL is "infinity" to NT and should
not be converted numerically to time_t.
(This used to be commit f3a8048a62)
2007-10-10 12:18:19 -05:00
Jeremy Allison
5c9344fa4c r21060: Start refactoring out the non-return case statements
into functions.
Jeremy.
(This used to be commit 461db3c8ed)
2007-10-10 12:17:31 -05:00
Jeremy Allison
b86d6b75c0 r20695: Remove duplication of constants.
Jeremy.
(This used to be commit 66cca893e1)
2007-10-10 12:17:03 -05:00
Jeremy Allison
ec43849134 r20694: To get this right we need to do signed 64-bit
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 31f8e0edc0)
2007-10-10 12:17:03 -05:00
Jeremy Allison
5a2585416c r20692: Fix bug found by Guenther -
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 f4e898b622)
2007-10-10 12:17:03 -05:00
Volker Lendecke
8bf6d57176 r18597: A C++ warning
(This used to be commit 528082aed8)
2007-10-10 11:51:57 -05:00
Jelmer Vernooij
995205fc60 r18188: merge 3.0-libndr branch
(This used to be commit 1115745cae)
2007-10-10 11:43:56 -05:00
Derrell Lipman
5e44fc4cd4 r18009: Fixes bug 4026.
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 8e119b64f1)
2007-10-10 11:39:47 -05:00
Jeremy Allison
6365dcef4d r17834: Another bug found by Volker's tests in the build farm !
Correctly map large nt timevals to TIME_T_MAX.
Jeremy.
(This used to be commit 63b13d2879)
2007-10-10 11:38:52 -05:00
Volker Lendecke
b9142f20df r17831: Attempt to fix the build farm: 0x7fffffffffffffff needs special 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 872d1299eb)
2007-10-10 11:38:52 -05:00