diff options
author | Günther Deschner <gd@samba.org> | 2006-05-13 01:29:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:01 -0500 |
commit | 453e4b50aae52089eb2c2ae6a2abc3b48425ee55 (patch) | |
tree | 34b0d97e2f94c4488584f7c3b600bad395064b67 | |
parent | bae13fd8c834f79cf42faae0bc963ac96d505baf (diff) | |
download | samba-453e4b50aae52089eb2c2ae6a2abc3b48425ee55.tar.gz samba-453e4b50aae52089eb2c2ae6a2abc3b48425ee55.tar.bz2 samba-453e4b50aae52089eb2c2ae6a2abc3b48425ee55.zip |
r15559: Smaller fixes for the new cldap code:
* replace printf to stderr with DEBUG statements as they get printed in
daemons
* "net ads lookup" return code
Guenther
(This used to be commit 8dd925c5fbfcbe711c596d08e8eadc19607d5492)
-rw-r--r-- | source3/libads/cldap.c | 10 | ||||
-rw-r--r-- | source3/utils/net_ads.c | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c index 775d43dc3f..f438f98599 100644 --- a/source3/libads/cldap.c +++ b/source3/libads/cldap.c @@ -66,7 +66,7 @@ static unsigned pull_netlogon_string(char *ret, const char *ptr, uint8 len = (uint8)*(ptr++); if ((pret - ret + len + 1) >= MAX_DNS_LABEL) { - d_fprintf(stderr, "DC returning too long DNS name\n"); + DEBUG(1,("DC returning too long DNS name\n")); return 0; } @@ -151,13 +151,13 @@ static int send_cldap_netlogon(int sock, const char *domain, asn1_pop_tag(&data); if (data.has_error) { - d_fprintf(stderr, "Failed to build cldap netlogon at offset %d\n", (int)data.ofs); + DEBUG(2,("Failed to build cldap netlogon at offset %d\n", (int)data.ofs)); asn1_free(&data); return -1; } if (write(sock, data.data, data.length) != (ssize_t)data.length) { - d_fprintf(stderr, "failed to send cldap query (%s)\n", strerror(errno)); + DEBUG(2,("failed to send cldap query (%s)\n", strerror(errno))); } asn1_free(&data); @@ -203,7 +203,7 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply) alarm(0); if (ret <= 0) { - d_fprintf(stderr, "no reply received to cldap netlogon\n"); + DEBUG(1,("no reply received to cldap netlogon\n")); return -1; } blob.length = ret; @@ -225,7 +225,7 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply) asn1_end_tag(&data); if (data.has_error) { - d_fprintf(stderr, "Failed to parse cldap reply\n"); + DEBUG(1,("Failed to parse cldap reply\n")); return -1; } diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index a514b6c4e6..e75090449d 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -83,7 +83,6 @@ int net_ads_usage(int argc, const char **argv) */ static int net_ads_cldap_netlogon(ADS_STRUCT *ads) { - int ret; struct cldap_netlogon_reply reply; if ( !ads_cldap_netlogon( inet_ntoa(ads->ldap_ip), ads->server.realm, &reply ) ) { @@ -147,7 +146,7 @@ static int net_ads_cldap_netlogon(ADS_STRUCT *ads) d_printf("LMNT Token: %.2x\n", reply.lmnt_token); d_printf("LM20 Token: %.2x\n", reply.lm20_token); - return ret; + return 0; } |