diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-08-19 03:17:03 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-08-19 03:17:03 +0000 |
commit | 4b1baa5a70964e94ecc4733a9f8cd3f318c758ea (patch) | |
tree | 5fcde1f2eadb9c65dcf66ff4bb15a88b5d6ed4ba /source3/utils/net_ads.c | |
parent | 2b93ecc90b79d95455b19e46082f1b0039b71e35 (diff) | |
download | samba-4b1baa5a70964e94ecc4733a9f8cd3f318c758ea.tar.gz samba-4b1baa5a70964e94ecc4733a9f8cd3f318c758ea.tar.bz2 samba-4b1baa5a70964e94ecc4733a9f8cd3f318c758ea.zip |
added a 'net ads lookup' command that does a CLDAP NetLogon query to a
win2000 server. It does seem to work, and win200 sends us a valid
reply, but we don't parse it yet. Maybe tomorrow :)
(This used to be commit 6352508c54cee333ed7c0e3ebc372be7cd60ed62)
Diffstat (limited to 'source3/utils/net_ads.c')
-rw-r--r-- | source3/utils/net_ads.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index ad405fe68c..16450c5b29 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -56,6 +56,31 @@ int net_ads_usage(int argc, const char **argv) } +/* + this implements the CLDAP based netlogon lookup requests + for finding the domain controller of a ADS domain +*/ +static int net_ads_lookup(int argc, const char **argv) +{ + ADS_STRUCT *ads; + + ads = ads_init(NULL, NULL, opt_host); + if (ads) { + ads->auth.no_bind = 1; + } + + ads_connect(ads); + + if (!ads || !ads->config.realm) { + d_printf("Didn't find the cldap server!\n"); + return -1; + } + + return ads_cldap_netlogon(ads); +} + + + static int net_ads_info(int argc, const char **argv) { ADS_STRUCT *ads; @@ -1009,6 +1034,7 @@ int net_ads(int argc, const char **argv) {"PRINTER", net_ads_printer}, {"SEARCH", net_ads_search}, {"WORKGROUP", net_ads_workgroup}, + {"LOOKUP", net_ads_lookup}, {"HELP", net_ads_help}, {NULL, NULL} }; |