summaryrefslogtreecommitdiff
path: root/bzip2-ocloexec.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-09-19 09:26:20 +0000
committerCoprDistGit <infra@openeuler.org>2023-09-19 09:26:20 +0000
commitd2c9d4af117a675454c696aa07b3445c18fe2fda (patch)
tree1c1a21de59fff7717ce5a29da45ebf96883ee7e6 /bzip2-ocloexec.patch
parentf99cedb0c9358dc859d1cbfc53cba5f1e0cc57b2 (diff)
automatic import of bzip2openeuler22.03_LTS
Diffstat (limited to 'bzip2-ocloexec.patch')
-rw-r--r--bzip2-ocloexec.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/bzip2-ocloexec.patch b/bzip2-ocloexec.patch
new file mode 100644
index 0000000..18f53e3
--- /dev/null
+++ b/bzip2-ocloexec.patch
@@ -0,0 +1,21 @@
+Index: bzip2-1.0.7/bzlib.c
+===================================================================
+--- bzip2-1.0.7.orig/bzlib.c 2019-06-27 20:15:39.000000000 +0200
++++ bzip2-1.0.7/bzlib.c 2019-06-27 23:10:21.399272583 +0200
+@@ -1414,7 +1414,15 @@ BZFILE * bzopen_or_bzdopen
+ }
+ mode++;
+ }
+- strcat(mode2, writing ? "w" : "r" );
++
++ /* open fds with O_CLOEXEC _only_ when we are the initiator
++ * aka. bzopen() but not bzdopen() */
++ if(open_mode == 0) {
++ strcat (mode2, writing ? "we" : "re" );
++ } else {
++ strcat(mode2, writing ? "w" : "r" );
++ }
++
+ strcat(mode2,"b"); /* binary mode */
+
+ if (open_mode==0) {