tools/kernel2minor: fix permissions of created files
authorFelix Fietkau <nbd@nbd.name>
Fri, 6 Jan 2017 15:37:46 +0000 (16:37 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 6 Jan 2017 15:38:33 +0000 (16:38 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
tools/kernel2minor/patches/120-fix_create_mode.patch [new file with mode: 0644]

diff --git a/tools/kernel2minor/patches/120-fix_create_mode.patch b/tools/kernel2minor/patches/120-fix_create_mode.patch
new file mode 100644 (file)
index 0000000..8fa8707
--- /dev/null
@@ -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);