aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAhelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>2024-03-21 19:31:54 +0100
committerTom Rini <trini@konsulko.com>2024-04-10 09:34:53 -0600
commit32bc256ced33678d63147acb796aa1cbcc942baf (patch)
tree4ada605f85bf1eb9abb18b456f46f88a282b3555 /tools
parent84a78872c4d359cedc7dcb90a3cc2ef61f7098cf (diff)
downloadu-boot-32bc256ced33678d63147acb796aa1cbcc942baf.zip
u-boot-32bc256ced33678d63147acb796aa1cbcc942baf.tar.gz
u-boot-32bc256ced33678d63147acb796aa1cbcc942baf.tar.bz2
tools: open FIT image read-only
Open for reading as O_RDONLY instead of O_RDWR: the only usage of the fd is for the single read() below; this prevented mkimage -f auto -A arm64 \ -T kernel -C lz4 -d Image-6.6.15.lz4 \ -b mt8173-elm-hana-6.6.15.dtb outf when the inputs were unwritable. Link: https://bugs.debian.org/1063097 Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/fit_image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/fit_image.c b/tools/fit_image.c
index beef1fa..0fccfbb 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -137,7 +137,7 @@ static int fdt_property_file(struct image_tool_params *params,
int ret;
int fd;
- fd = open(fname, O_RDWR | O_BINARY);
+ fd = open(fname, O_RDONLY | O_BINARY);
if (fd < 0) {
fprintf(stderr, "%s: Can't open %s: %s\n",
params->cmdname, fname, strerror(errno));