commit edca7a667dcb5e2698b6729aece8d0afadcbc805 from: Stefan Sperling via: Thomas Adam date: Fri Mar 21 13:22:47 2025 UTC remove closefrom() in gotd when gotsys is run closefrom doesn't have the desired effect as it may affect unrelated open files in the parent process. The right way to deal with this seems to be setting the close-on-exec flag on file descriptors instead. commit - 80c9647f807399e8d8bed8a18109a87ea8222f56 commit + edca7a667dcb5e2698b6729aece8d0afadcbc805 blob - 05ef4dfeeabfc25a6b0672d91d6aba2a5c36c9a4 blob + cd527684c45a60e3c604889ca3fb1a3f94ebf2b4 --- gotd/gotd.c +++ gotd/gotd.c @@ -1961,8 +1961,6 @@ run_gotsys_check(struct gotd_client *client, struct go fatal("cannot redirect stderr"); } else if (fcntl(proc->pipe[1], F_SETFD, 0) == -1) fatal("cannot fcntl stderr"); - - closefrom(STDERR_FILENO + 1); argv[argc++] = GOTD_PATH_PROG_GOTSYS; argv[argc++] = "check"; @@ -2012,8 +2010,6 @@ run_gotsys_apply(struct gotd_repo *repo) log_debug("running gotsys apply (PID %d)", pid); return; } - - closefrom(STDERR_FILENO + 1); argv[argc++] = GOTD_PATH_PROG_GOTSYS; argv[argc++] = "apply";