NTSTATUS trick for NTTIME?

Stefan (metze) Metzmacher metze at samba.org
Mon Mar 7 08:48:12 MST 2011


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).

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110307/811cfff7/attachment.pgp>


More information about the samba-technical mailing list