Mercurial > dropbear
comparison gensignkey.c @ 1658:7402218141d4
bring back fsync_parent_dir
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 18 Oct 2019 23:48:16 +0800 |
parents | 4f8eb331174f |
children | d32bcb5c557d |
comparison
equal
deleted
inserted
replaced
1657:823592f244c9 | 1658:7402218141d4 |
---|---|
150 ret = DROPBEAR_FAILURE; | 150 ret = DROPBEAR_FAILURE; |
151 goto out; | 151 goto out; |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 /* ensure directory update is flushed to disk, otherwise we can end up | |
156 with zero-byte hostkey files if the power goes off */ | |
157 fsync_parent_dir(filename); | |
158 | |
155 out: | 159 out: |
156 if (buf) { | 160 if (buf) { |
157 buf_burn(buf); | 161 buf_burn(buf); |
158 buf_free(buf); | 162 buf_free(buf); |
159 } | 163 } |