diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-06-08 15:47:34 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-06-10 10:17:38 -0400 |
commit | 06247775aa9c49ffce72827921eb45e2d04c6aa1 (patch) | |
tree | c3e53abf07faa3c8e161cff30746d54af6a78791 /src/sss_client/pam_sss.c | |
parent | e5196fd7da44e4ae04ab8b5d2e7191167762cf0b (diff) | |
download | sssd-06247775aa9c49ffce72827921eb45e2d04c6aa1.tar.gz sssd-06247775aa9c49ffce72827921eb45e2d04c6aa1.tar.xz 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/sss_client/pam_sss.c')
-rw-r--r-- | src/sss_client/pam_sss.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c index 2faa3ad2e..644073f5b 100644 --- a/src/sss_client/pam_sss.c +++ b/src/sss_client/pam_sss.c @@ -489,7 +489,7 @@ static errno_t display_pw_reset_message(pam_handle_t *pamh, while (total_len < stat_buf.st_size) { ret = read(fd, msg_buf + total_len, stat_buf.st_size - total_len); if (ret == -1) { - if (errno == EINTR) continue; + if (errno == EINTR || errno == EAGAIN) continue; ret = errno; D(("read failed [%d][%s].", ret, strerror(ret))); goto done; |