From 39a236883ee4015980ff3d3cab8a8e5fec858502 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 May 2004 08:02:20 +0000 Subject: r904: - fixed account expiry testing in auth_sam - added printf style format attribute checking to samdb varargs fns - fix nt_time_to_unix() for zero and -1 times (This used to be commit 41f9b144f9fe77e92f960bd11b1df397a63fd2d5) --- source4/rpc_server/samr/samdb.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source4/rpc_server') diff --git a/source4/rpc_server/samr/samdb.c b/source4/rpc_server/samr/samdb.c index 9995f013ae..fd643c7bb0 100644 --- a/source4/rpc_server/samr/samdb.c +++ b/source4/rpc_server/samr/samdb.c @@ -136,7 +136,7 @@ int samdb_search(void *ctx, const char *basedn, struct ldb_message ***res, const char * const *attrs, - const char *format, ...) + const char *format, ...) _PRINTF_ATTRIBUTE(6,7) { va_list ap; int count; @@ -193,7 +193,7 @@ const char *samdb_search_string(void *ctx, TALLOC_CTX *mem_ctx, const char *basedn, const char *attr_name, - const char *format, ...) + const char *format, ...) _PRINTF_ATTRIBUTE(5,6) { va_list ap; const char *str; @@ -214,7 +214,7 @@ uint_t samdb_search_uint(void *ctx, uint_t default_value, const char *basedn, const char *attr_name, - const char *format, ...) + const char *format, ...) _PRINTF_ATTRIBUTE(6,7) { va_list ap; int count; @@ -240,7 +240,7 @@ int64_t samdb_search_int64(void *ctx, int64_t default_value, const char *basedn, const char *attr_name, - const char *format, ...) + const char *format, ...) _PRINTF_ATTRIBUTE(6,7) { va_list ap; int count; @@ -267,7 +267,7 @@ int samdb_search_string_multiple(void *ctx, const char *basedn, const char ***strs, const char *attr_name, - const char *format, ...) + const char *format, ...) _PRINTF_ATTRIBUTE(6,7) { va_list ap; int count, i; @@ -406,7 +406,7 @@ NTTIME samdb_result_allow_pwd_change(void *ctx, TALLOC_CTX *mem_ctx, return 0; } - minPwdAge = samdb_search_int64(ctx, mem_ctx, 0, "minPwdAge", "dn=%s", domain_dn); + minPwdAge = samdb_search_int64(ctx, mem_ctx, 0, NULL, "minPwdAge", "dn=%s", domain_dn); /* yes, this is a -= not a += as minPwdAge is stored as the negative of the number of 100-nano-seconds */ @@ -429,9 +429,9 @@ NTTIME samdb_result_force_pwd_change(void *ctx, TALLOC_CTX *mem_ctx, return 0; } - maxPwdAge = samdb_search_int64(ctx, mem_ctx, 0, "maxPwdAge", "dn=%s", domain_dn); + maxPwdAge = samdb_search_int64(ctx, mem_ctx, 0, NULL, "maxPwdAge", "dn=%s", domain_dn); if (maxPwdAge == 0) { - attr_time = 0; + return 0; } else { attr_time -= maxPwdAge; } -- cgit