From: Yu Watanabe Date: Fri, 19 Sep 2025 06:48:14 +0000 (+0900) Subject: importd: some minor tweaks (#39008) X-Git-Tag: v259-rc1~505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8835034df842c46f650a0f26dd99761ba889e426;p=thirdparty%2Fsystemd.git importd: some minor tweaks (#39008) --- 8835034df842c46f650a0f26dd99761ba889e426 diff --cc src/import/import-common.c index c55dad179f9,2de01953a39..b6e47fee4d6 --- a/src/import/import-common.c +++ b/src/import/import-common.c @@@ -33,14 -32,14 +33,16 @@@ int import_fork_tar_x(const char *path if (pipe2(pipefd, O_CLOEXEC) < 0) return log_error_errno(errno, "Failed to create pipe for tar: %m"); + (void) fcntl(pipefd[0], F_SETPIPE_SZ, IMPORT_BUFFER_SIZE); + use_selinux = mac_selinux_use(); - r = safe_fork_full("(tar)", - (int[]) { pipefd[0], -EBADF, STDERR_FILENO }, - NULL, 0, - FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG, &pid); + r = pidref_safe_fork_full( + "(tar)", + (int[]) { pipefd[0], -EBADF, STDERR_FILENO }, + NULL, 0, + FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG, + &pid); if (r < 0) return r; if (r == 0) { @@@ -104,14 -103,14 +106,16 @@@ int import_fork_tar_c(const char *path if (pipe2(pipefd, O_CLOEXEC) < 0) return log_error_errno(errno, "Failed to create pipe for tar: %m"); + (void) fcntl(pipefd[0], F_SETPIPE_SZ, IMPORT_BUFFER_SIZE); + use_selinux = mac_selinux_use(); - r = safe_fork_full("(tar)", - (int[]) { -EBADF, pipefd[1], STDERR_FILENO }, - NULL, 0, - FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG, &pid); + r = pidref_safe_fork_full( + "(tar)", + (int[]) { -EBADF, pipefd[1], STDERR_FILENO }, + NULL, 0, + FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG_SIGTERM|FORK_REARRANGE_STDIO|FORK_LOG, + &pid); if (r < 0) return r; if (r == 0) {