diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-13 13:19:20 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-13 13:19:20 +0000 |
commit | 1fb2f3649d48dceff183ada68c0fac1de108d4cc (patch) | |
tree | b1abe466bcffdc9c6feac0227146b3f9b2b80811 | |
parent | 3a1cd6f427e7cdf92784a71f988def5792fa4e0a (diff) | |
download | samba-1fb2f3649d48dceff183ada68c0fac1de108d4cc.tar.gz samba-1fb2f3649d48dceff183ada68c0fac1de108d4cc.tar.bz2 samba-1fb2f3649d48dceff183ada68c0fac1de108d4cc.zip |
added "net ads info" to fetch basic ADS info without any auth
(This used to be commit b107ecef7097e4b3b870f51fa6628b870703b4de)
-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 4f44930038..c67fbda2c8 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -34,12 +34,37 @@ int net_ads_usage(int argc, const char **argv) "\n\tlist users in the realm\n"\ "\nnet ads group"\ "\n\tlist groups in the realm\n"\ +"\nnet ads info"\ +"\n\tshows some info on the server\n"\ "\nnet ads status"\ "\n\tdump the machine account details to stdout\n" ); return -1; } + +static int net_ads_info(int argc, const char **argv) +{ + ADS_STRUCT *ads; + + ads = ads_init(NULL, NULL, NULL, NULL); + ads_connect(ads); + + if (!ads) { + d_printf("Didn't find the ldap server!\n"); + return -1; + } + + d_printf("LDAP server: %s\n", ads->ldap_server); + d_printf("LDAP server name: %s\n", ads->ldap_server_name); + d_printf("Realm: %s\n", ads->realm); + d_printf("Bind Path: %s\n", ads->bind_path); + d_printf("LDAP port: %d\n", ads->ldap_port); + + return 0; +} + + static ADS_STRUCT *ads_startup(void) { ADS_STRUCT *ads; @@ -214,6 +239,7 @@ static int net_ads_join(int argc, const char **argv) int net_ads(int argc, const char **argv) { struct functable func[] = { + {"INFO", net_ads_info}, {"JOIN", net_ads_join}, {"LEAVE", net_ads_leave}, {"STATUS", net_ads_status}, |