Skip to content

Commit

Permalink
Don't close file descriptors in .target.bash calls (bsc#1218064)
Browse files Browse the repository at this point in the history
because Ruby uses some FDs for thread communication and closing that one
results in abort(3) later.

Alternatively we could query Ruby's rb_reserved_fd_p(fd)
  • Loading branch information
Martin Vidner committed Jan 8, 2024
1 parent f024117 commit ebfff16
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions agent-system/src/ShellCommand.cc
Expand Up @@ -145,9 +145,10 @@ shellcommand ( const string &target_root, const string &command, const string &t

// #223602
// close all file descriptors above stderr
for ( int i = getdtablesize() - 1; i > 2; --i ) {
close( i );
}
//
// But Ruby uses some for thread communications,
// bsc#1218064, so don't.
// Systemd daemon handling has meanwhile solved the original bug.

// we want to work on different target root
if (target_root != "/")
Expand Down

0 comments on commit ebfff16

Please sign in to comment.