summaryrefslogtreecommitdiffstats
path: root/runtime/librsgt.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-03-19 15:26:21 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-03-19 15:26:21 +0100
commit785e0c3c8b00614b6f780f902442025f4558a160 (patch)
treebc9a0a9172e426ae5debcf52ef91183e551eea14 /runtime/librsgt.c
parent4ec4e12fe706387e26405e127ffa1438b79c0bc9 (diff)
downloadrsyslog-785e0c3c8b00614b6f780f902442025f4558a160.tar.gz
rsyslog-785e0c3c8b00614b6f780f902442025f4558a160.tar.bz2
rsyslog-785e0c3c8b00614b6f780f902442025f4558a160.zip
logsig: complete initial version of verifier
Diffstat (limited to 'runtime/librsgt.c')
-rw-r--r--runtime/librsgt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/librsgt.c b/runtime/librsgt.c
index 20c8fd79..e24c3769 100644
--- a/runtime/librsgt.c
+++ b/runtime/librsgt.c
@@ -325,8 +325,11 @@ writeStateFile(gtfile gf)
memcpy(sf.hdr, "GTSTAT10", 8);
sf.hashID = hashIdentifier(gf->hashAlg);
sf.lenHash = gf->x_prev->digest_length;
- write(fd, &sf, sizeof(sf));
- write(fd, gf->x_prev->digest, gf->x_prev->digest_length);
+ /* if the write fails, we cannot do anything against that. We check
+ * the condition just to keep the compiler happy.
+ */
+ if(write(fd, &sf, sizeof(sf))){};
+ if(write(fd, gf->x_prev->digest, gf->x_prev->digest_length)){};
close(fd);
done: return;
}
@@ -387,7 +390,7 @@ seedIV(gtfile gf)
* will always work...). -- TODO -- rgerhards, 2013-03-06
*/
if((fd = open("/dev/urandom", O_RDONLY)) > 0) {
- read(fd, gf->IV, hashlen);
+ if(read(fd, gf->IV, hashlen)) {}; /* keep compiler happy */
close(fd);
}
}