[source] tools/kernel2minor: fix permissions of created files

LEDE Commits lede-commits at lists.infradead.org
Fri Jan 6 07:38:37 PST 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/b9857b21c27c3ba98a400cd797c540baa9f40be1

commit b9857b21c27c3ba98a400cd797c540baa9f40be1
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jan 6 16:37:46 2017 +0100

    tools/kernel2minor: fix permissions of created files
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/kernel2minor/patches/120-fix_create_mode.patch | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/kernel2minor/patches/120-fix_create_mode.patch b/tools/kernel2minor/patches/120-fix_create_mode.patch
new file mode 100644
index 0000000..8fa8707
--- /dev/null
+++ b/tools/kernel2minor/patches/120-fix_create_mode.patch
@@ -0,0 +1,11 @@
+--- a/kernel2minor.c
++++ b/kernel2minor.c
+@@ -622,7 +622,7 @@ int main(int argc, char *argv[]){
+     perror("Can't open kernel file");
+     exit(-1);
+   }
+-  r = creat(res_file, 0);
++  r = open(res_file, O_CREAT | O_TRUNC | O_WRONLY, 0644);
+   if(r <= 0){
+     perror("Can't create result file");
+     close(k);



More information about the lede-commits mailing list