glibc/copy-and-spawn-sgid-double-close.patch
Andreas Schwab d6ae5339fb Accepting request 911560 from home:Andreas_Schwab:Factory
- Don't create separate debuginfo packages for cross packages

- ldconfig-leak-empty-paths.patch: ldconfig: avoid leak on empty paths in
  config file
- gconv-parseconfdir-memory-leak.patch: gconv_parseconfdir: Fix memory leak
- gaiconf-init-double-free.patch: gaiconf_init: Avoid double-free in label
  and precedence lists
- copy-and-spawn-sgid-double-close.patch: copy_and_spawn_sgid: Avoid
  double calls to close()
- icon-charmap-close-output.patch: iconv_charmap: Close output file when
  done
- fcntl-time-bits-64-redirect.patch: Linux: Fix fcntl, ioctl, prctl
  redirects for _TIME_BITS=64 (BZ #28182)
- librt-null-pointer.patch: librt: fix NULL pointer dereference (BZ
  #28213)

OBS-URL: https://build.opensuse.org/request/show/911560
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=603
2021-08-12 08:36:15 +00:00

29 lines
944 B
Diff

From 45caed9d67a00af917d8b5b88d4b5eb1225b7aef Mon Sep 17 00:00:00 2001
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date: Tue, 3 Aug 2021 21:10:53 +0530
Subject: [PATCH] copy_and_spawn_sgid: Avoid double calls to close()
If close() on infd and outfd succeeded, reset the fd numbers so that
we don't attempt to close them again.
Reviewed-by: Arjun Shankar <arjun@redhat.com>
---
support/support_capture_subprocess.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/support/support_capture_subprocess.c b/support/support_capture_subprocess.c
index 27bfd19c93..0bacf6dbc2 100644
--- a/support/support_capture_subprocess.c
+++ b/support/support_capture_subprocess.c
@@ -170,6 +170,7 @@ copy_and_spawn_sgid (char *child_id, gid_t gid)
support_subprogram because we only want the program exit status, not the
contents. */
ret = 0;
+ infd = outfd = -1;
char * const args[] = {execname, child_id, NULL};
--
2.32.0