projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfc86a2
)
jail: don't ignore return value of write()
author
Daniel Golle
<daniel@makrotopia.org>
Wed, 4 Aug 2021 15:35:29 +0000
(16:35 +0100)
committer
Daniel Golle
<daniel@makrotopia.org>
Wed, 4 Aug 2021 15:35:29 +0000
(16:35 +0100)
Check return value of write() call when writing to sysctl.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
jail/jail.c
patch
|
blob
|
history
diff --git
a/jail/jail.c
b/jail/jail.c
index 2fa3b2a885d0b4478f8dcc780d26bb33cf5d5c08..92ced457dd3951388bc1141e677da68621bcc2bb 100644
(file)
--- a/
jail/jail.c
+++ b/
jail/jail.c
@@
-536,7
+536,10
@@
static int apply_sysctl(const char *jail_root)
ERROR("sysctl: can't open %s\n", fname);
return errno;
}
- write(f, (*cur)->value, strlen((*cur)->value));
+ if (write(f, (*cur)->value, strlen((*cur)->value)) < 0) {
+ ERROR("sysctl: write to %s\n", fname);
+ return errno;
+ }
free(fname);
close(f);