path: root/modules
diff options
authorDmitry V. Levin <>2014-01-24 13:38:38 +0000
committerDmitry V. Levin <>2014-01-27 15:41:19 +0000
commit47db675c910a065fa9602753a904b050b0322f29 (patch)
treefea2f6afc56a32c39a0d953e56a531c94223a4f5 /modules
parent256b50e1fce2f785f1032a1949dd2d1dbc17e250 (diff)
pam_xauth: avoid potential SIGPIPE when writing to xauth process
Similar issue in pam_unix was fixed by commit Linux-PAM-0-73~8. * modules/pam_xauth/pam_xauth.c (run_coprocess): In the parent process, close the read end of input pipe after writing to its write end.
Diffstat (limited to 'modules')
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_xauth/pam_xauth.c b/modules/pam_xauth/pam_xauth.c
index 70755475..c7ce55ab 100644
--- a/modules/pam_xauth/pam_xauth.c
+++ b/modules/pam_xauth/pam_xauth.c
@@ -179,12 +179,12 @@ run_coprocess(pam_handle_t *pamh, const char *input, char **output,
/* We're the parent, so close the other ends of the pipes. */
- close(ipipe[0]);
/* Send input to the process (if we have any), then send an EOF. */
if (input) {
(void)pam_modutil_write(ipipe[1], input, strlen(input));
+ close(ipipe[0]); /* close here to avoid possible SIGPIPE above */
/* Read data output until we run out of stuff to read. */