Redo preserve_fds support to remap high fds so we can get the most

out of closefrom().  The fds are then restored after closefrom().
This commit is contained in:
Todd C. Miller
2013-12-24 15:01:00 -07:00
parent 76544011ed
commit 4d80e7cea4
3 changed files with 132 additions and 39 deletions

View File

@@ -536,7 +536,7 @@ command_info_to_details(char * const info[], struct command_details *details)
memset(details, 0, sizeof(*details));
details->closefrom = -1;
details->preserved_fds.maxfd = -1;
TAILQ_INIT(&details->preserved_fds);
#define SET_STRING(s, n) \
if (strncmp(s, info[i], sizeof(s) - 1) == 0 && info[i][sizeof(s) - 1]) { \