Skip to content

Commit 0e91d09

Browse files
Set file permissions after writing in bootimg.c
Added chmod calls to set file permissions after writing.
1 parent cbed8a5 commit 0e91d09

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tools/bootimg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <stdint.h>
55
#include <string.h>
66
#include <zlib.h>
7-
7+
#include <sys/stat.h>
88
#include "bootimg.h"
99
#include "common.h"
1010
#include "lib/lz4/lz4.h"
@@ -74,6 +74,7 @@ int write_data_to_file(const char *path, const void *data, size_t size) {
7474
if (!fp) return -1;
7575
fwrite(data, 1, size, fp);
7676
fclose(fp);
77+
chmod(path, 0644);
7778
return 0;
7879
}
7980

@@ -129,6 +130,7 @@ int decompress_gzip(const uint8_t *in_data, size_t in_size, const char *out_path
129130
} while (ret != Z_STREAM_END);
130131

131132
fclose(out);
133+
chmod(out_path, 0644);
132134
inflateEnd(&strm);
133135
return 0;
134136
}

0 commit comments

Comments
 (0)