diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-07-18 07:30:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:28:48 -0500 |
commit | e0c4034393a05acba9b6ba7dd015cfc3e6d46c0f (patch) | |
tree | 88977561c75d80ef8686aa8b1c275907d1ea44c6 | |
parent | e6c6c0438d07d4362b2a773199b288ed5335c23d (diff) | |
download | samba-e0c4034393a05acba9b6ba7dd015cfc3e6d46c0f.tar.gz samba-e0c4034393a05acba9b6ba7dd015cfc3e6d46c0f.tar.xz samba-e0c4034393a05acba9b6ba7dd015cfc3e6d46c0f.zip |
r23943: - always provide ads_setup_sasl_wrapping() function
- read/write returning 0 means EOF and we need to return direct
metze
(This used to be commit 885d557ae746c318df0aabc0a03dce1587918cce)
-rw-r--r-- | source3/libads/sasl_wrapping.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/libads/sasl_wrapping.c b/source3/libads/sasl_wrapping.c index 77a71d8e96..931273f40c 100644 --- a/source3/libads/sasl_wrapping.c +++ b/source3/libads/sasl_wrapping.c @@ -93,7 +93,7 @@ static ber_slen_t ads_saslwrap_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t ret = LBER_SBIOD_READ_NEXT(sbiod, ads->ldap.in.buf + ads->ldap.in.ofs, 4 - ads->ldap.in.ofs); - if (ret < 0) return ret; + if (ret <= 0) return ret; ads->ldap.in.ofs += ret; if (ads->ldap.in.ofs < 4) goto eagain; @@ -120,7 +120,7 @@ static ber_slen_t ads_saslwrap_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t ret = LBER_SBIOD_READ_NEXT(sbiod, ads->ldap.in.buf + ads->ldap.in.ofs, ads->ldap.in.needed); - if (ret < 0) return ret; + if (ret <= 0) return ret; ads->ldap.in.ofs += ret; ads->ldap.in.needed -= ret; @@ -227,7 +227,7 @@ static ber_slen_t ads_saslwrap_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_ ret = LBER_SBIOD_WRITE_NEXT(sbiod, ads->ldap.out.buf + ads->ldap.out.ofs, ads->ldap.out.left); - if (ret < 0) return ret; + if (ret <= 0) return ret; ads->ldap.out.ofs += ret; ads->ldap.out.left -= ret; @@ -302,5 +302,11 @@ ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads, return ADS_SUCCESS; } - +#else +ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads, + const struct ads_saslwrap_ops *ops, + void *private_data) +{ + return ADS_ERROR_NT(NT_STATUS_NOT_SUPPORTED); +} #endif /* HAVE_LDAP_SASL_WRAPPING */ |