summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadtalos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch')
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch b/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
new file mode 100644
index 000000000..9fafec4b5
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
@@ -0,0 +1,53 @@
+From 2a603acb65993698c21f1c6eb7664f93ad830d52 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Fri, 9 Sep 2016 16:00:42 -0300
+Subject: [PATCH] handle read-only files
+Organization: O.S. Systems Software LTDA.
+
+Patch from:
+https://github.com/darealshinji/patchelf/commit/40e66392bc4b96e9b4eda496827d26348a503509
+
+Upstream-Status: Pending
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/patchelf.cc | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index 136098f..aea360e 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -388,7 +388,17 @@ void ElfFile<ElfFileParamNames>::sortShdrs()
+
+ static void writeFile(string fileName)
+ {
+- int fd = open(fileName.c_str(), O_TRUNC | O_WRONLY);
++ struct stat st;
++ int fd;
++
++ if (stat(fileName.c_str(), &st) != 0)
++ error("stat");
++
++ if (chmod(fileName.c_str(), 0600) != 0)
++ error("chmod");
++
++ fd = open(fileName.c_str(), O_TRUNC | O_WRONLY);
++
+ if (fd == -1)
+ error("open");
+
+@@ -397,6 +407,10 @@ static void writeFile(string fileName)
+
+ if (close(fd) != 0)
+ error("close");
++
++ if (chmod(fileName.c_str(), st.st_mode) != 0)
++ error("chmod");
++
+ }
+
+
+--
+2.1.4
+
OpenPOWER on IntegriCloud