#include "ads.h"
#include "nss_info.h"
#include "../libcli/security/dom_sid.h"
+#include "libsmb/samlogon_cache.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_IDMAP
goto return_mapping;
}
+ /*
+ * Check of last resort: A domain is valid if a user from that
+ * domain has recently logged in. The samlogon_cache these
+ * days also stores the domain sid.
+ */
+ if (netsamlogon_cache_have(&sid)) {
+ /*
+ * We keep the legacy behavior and
+ * just return the mapping, but
+ * the reverse mapping would not
+ * still not work.
+ */
+ goto return_mapping;
+ }
+
if (id->xid.type == ID_TYPE_NOT_SPECIFIED) {
/*
* idmap_hash used to bounce back the requested type,