vipw: use explicit_bzero() to clear buffer after copy
This should make leaking end of /etc/shadow file more unlikely. Notice that there is now way to tell to editors they should ensure none it does not leak any buffers, drop cores, and so on, when editing sensitive data. In short this change is addressing the issue only partially. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
6766397932
commit
46df3aaae8
|
@ -100,6 +100,9 @@ static void copyfile(int from, int to)
|
|||
|
||||
if (nr < 0)
|
||||
pw_error(orig_file, 1, 1);
|
||||
#ifdef HAVE_EXPLICIT_BZERO
|
||||
explicit_bzero(buf, sizeof(buf));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void pw_init(void)
|
||||
|
|
Loading…
Reference in New Issue