mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Make sure hostkeys are flushed to disk to avoid empty files if the power
fails. Based on patch from Peter Korsgaard
This commit is contained in:
@@ -41,6 +41,7 @@ static int buf_writefile(buffer * buf, const char * filename) {
|
||||
|
||||
out:
|
||||
if (fd >= 0) {
|
||||
fsync(fd);
|
||||
m_close(fd);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user