Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
843566d8
...
843566d88f5b19bd8ad9bf81ebc6b9282b2a02f7
authored
2003-12-01 13:01:08 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sendmail_send_message): Don't close the descriptor if it happens to make part of tunnel pipe.
1 parent
117abd5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
mailbox/sendmail.c
mailbox/sendmail.c
View file @
843566d
...
...
@@ -166,6 +166,9 @@ sendmail_close (mailer_t mailer)
return
0
;
}
/* Close FD unless it is part of pipe P */
#define SCLOSE(fd,p) if (p[0]!=fd&&p[1]!=fd) close(fd)
static
int
sendmail_send_message
(
mailer_t
mailer
,
message_t
msg
,
address_t
from
,
address_t
to
)
...
...
@@ -299,9 +302,9 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from,
sendmail
->
pid
=
vfork
();
if
(
sendmail
->
pid
==
0
)
/* Child. */
{
close
(
STDIN_FILENO
);
close
(
STDOUT_FILENO
);
close
(
STDERR_FILENO
);
SCLOSE
(
STDIN_FILENO
,
tunnel
);
SCLOSE
(
STDOUT_FILENO
,
tunnel
);
SCLOSE
(
STDERR_FILENO
,
tunnel
);
close
(
tunnel
[
1
]);
dup2
(
tunnel
[
0
],
STDIN_FILENO
);
execv
(
sendmail
->
path
,
argvec
);
...
...
Please
register
or
sign in
to post a comment