}
struct namemap_cache_find_sid_state {
- void (*fn)(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+ void (*fn)(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data);
void *private_data;
bool ok;
return;
}
- state->fn(domain, name, (enum lsa_SidType)type, timeout,
+ state->fn(domain,
+ name,
+ (enum lsa_SidType)type,
+ timeout <= time(NULL),
state->private_data);
state->ok = true;
}
bool namemap_cache_find_sid(const struct dom_sid *sid,
- void (*fn)(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+ void (*fn)(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data),
void *private_data)
{
struct namemap_cache_find_name_state {
void (*fn)(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data);
void *private_data;
bool ok;
return;
}
- state->fn(&sid, (enum lsa_SidType)type, timeout, state->private_data);
+ state->fn(&sid,
+ (enum lsa_SidType)type,
+ timeout <= time(NULL),
+ state->private_data);
state->ok = true;
}
-bool namemap_cache_find_name(const char *domain, const char *name,
+bool namemap_cache_find_name(const char *domain,
+ const char *name,
void (*fn)(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data),
void *private_data)
{
enum lsa_SidType type,
time_t timeout);
bool namemap_cache_find_sid(const struct dom_sid *sid,
- void (*fn)(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+ void (*fn)(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data),
void *private_data);
-bool namemap_cache_find_name(const char *domain, const char *name,
+bool namemap_cache_find_name(const char *domain,
+ const char *name,
void (*fn)(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data),
void *private_data);
1, 4, {0,0,0,0,0,5}, {21, 123, 456, 789}
};
-static void namemap_cache1_fn1(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+static void namemap_cache1_fn1(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
bool *p_ok = private_data;
}
static void namemap_cache1_fn2(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
bool *p_ok = private_data;
*p_ok = ok;
}
-static void namemap_cache1_fn3(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+static void namemap_cache1_fn3(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
bool *p_ok = private_data;
}
static void namemap_cache1_fn4(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
bool *p_ok = private_data;
*p_ok = ok;
}
-static void namemap_cache1_fn5(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+static void namemap_cache1_fn5(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
bool *p_ok = private_data;
}
static void namemap_cache1_fn6(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
bool *p_ok = private_data;
};
static void wcache_name_to_sid_fn(const struct dom_sid *sid,
- enum lsa_SidType type, time_t timeout,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
struct wcache_name_to_sid_state *state = private_data;
*state->sid = *sid;
*state->type = type;
- state->found = (state->offline || (timeout > time(NULL)));
+ state->found = (!expired || state->offline);
}
static NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
bool found;
};
-static void wcache_sid_to_name_fn(const char *domain, const char *name,
- enum lsa_SidType type, time_t timeout,
+static void wcache_sid_to_name_fn(const char *domain,
+ const char *name,
+ enum lsa_SidType type,
+ bool expired,
void *private_data)
{
struct wcache_sid_to_name_state *state = private_data;
return;
}
*state->type = type;
- state->found = (state->offline || (timeout > time(NULL)));
+ state->found = (!expired || state->offline);
}
static NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain,