Преглед изворни кода

libdpkg: Fix fd_fd_filter to execute the filter on the child

There was a logic error in the pid check, and the filter code was being
executed in the parent instead of the child.

Regression introduced in commit 269bbee973c46e1be0aaef82cb7e19bbc9a95aa7.

Reported-by: Sven Joachim <svenjoac@gmx.de>
Guillem Jover пре 15 година
родитељ
комит
0d55f02275
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/dpkg/compress.c

+ 1 - 1
lib/dpkg/compress.c

@@ -52,7 +52,7 @@ fd_fd_filter(int fd_in, int fd_out, const char *desc, const char *file, ...)
 	pid_t pid;
 
 	pid = subproc_fork();
-	if (pid != 0) {
+	if (pid == 0) {
 		if (fd_in != 0) {
 			m_dup2(fd_in, 0);
 			close(fd_in);