summaryrefslogtreecommitdiff
path: root/src/krb5_plugin
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-06-08 15:47:34 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-06-10 10:17:38 -0400
commit06247775aa9c49ffce72827921eb45e2d04c6aa1 (patch)
treec3e53abf07faa3c8e161cff30746d54af6a78791 /src/krb5_plugin
parente5196fd7da44e4ae04ab8b5d2e7191167762cf0b (diff)
downloadsssd-06247775aa9c49ffce72827921eb45e2d04c6aa1.tar.gz
sssd-06247775aa9c49ffce72827921eb45e2d04c6aa1.tar.bz2
sssd-06247775aa9c49ffce72827921eb45e2d04c6aa1.zip
Properly handle read() and write() throughout the SSSD
We need to guarantee at all times that reads and writes complete successfully. This means that they must be checked for returning EINTR and EAGAIN, and all writes must be wrapped in a loop to ensure that they do not truncate their output.
Diffstat (limited to 'src/krb5_plugin')
-rw-r--r--src/krb5_plugin/sssd_krb5_locator_plugin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c
index dfc9c197..70479efd 100644
--- a/src/krb5_plugin/sssd_krb5_locator_plugin.c
+++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c
@@ -133,7 +133,7 @@ static int get_krb5info(const char *realm, struct sssd_ctx *ctx,
memset(buf, 0, BUFSIZE+1);
while (len != 0 && (ret = read(fd, p, len)) != 0) {
if (ret == -1) {
- if (errno == EINTR) continue;
+ if (errno == EINTR || errno == EAGAIN) continue;
PLUGIN_DEBUG(("read failed [%d][%s].\n", errno, strerror(errno)));
close(fd);
goto done;