NTSTATUS trick for NTTIME?
Andrew Bartlett
abartlet at samba.org
Mon Mar 7 13:28:31 MST 2011
On Mon, 2011-03-07 at 16:48 +0100, Stefan (metze) Metzmacher wrote:
> Hi Volker,
>
> > In the past we've had quite a few bugs where we mixed up
> > unix time_t and NTTIME, both of which are integral types.
> >
> > What about the following:
> >
> > #if defined(HAVE_IMMEDIATE_STRUCTURES)
> > typedef struct {uint64_t v;} nt_time_t;
> > #define nt_time(x) ((nt_time) { x })
> > #define nt_time_v(x) ((x).v)
> > #else
> > typedef uint64_t nt_time_t;
> > #define nt_time(x) (x)
> > #define nt_time_v(x) (x)
> > #endif
> >
> > This would potentially involve a LOT of code, that's why I'm
> > asking here.
> >
> > The reason why I'm bringing this up now is that I want to
> > convert the s3 passdb interface to use NTTIME, and I want to
> > automatically catch all places where this matters.
>
> While it seems I suggested to use uint64_t (see commit
> 579c13da43d5b40ac6d6c1436399fbc1d8dfd054)
> I think changing NTTIME to a NTSTATUS like structure would be good.
> (I just wanted to get rid of the high, low splitting)
>
> I guess it shouldn't be a large change (unless we have real bugs).
It would be good to understand exactly how big a change this would be,
and how many bugs we have had in this area in the past. The NTSTATUS
trick is quite disruptive to the code - but was the right thing to do at
the time when NTSTATUS was new and this bug occurred often.
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Cisco Inc.
More information about the samba-technical
mailing list