summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-05 20:05:27 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-05 21:07:55 -0500
commit2d26d8e07ee680995f96597a1cd713dd81491b89 (patch)
treeca66e286a3319e1edf1d473d7d519c145596ac37 /src/tty-ask-password-agent
parent52e634271fe96ec23a22705ffb87df59a09d1618 (diff)
downloadsystemd-2d26d8e07ee680995f96597a1cd713dd81491b89.tar.gz
treewide: replace homegrown memory_erase with explicit_bzero
explicit_bzero was added in glibc 2.25. Make use of it. explicit_bzero is hardcoded to zero the memory, so string erase now truncates the string, instead of overwriting it with 'x'. This causes a visible difference only in the journalctl case.
Diffstat (limited to 'src/tty-ask-password-agent')
-rw-r--r--src/tty-ask-password-agent/tty-ask-password-agent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
index b45490be1a..a17c006d57 100644
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
@@ -243,7 +243,7 @@ static int ask_password_plymouth(
r = 0;
finish:
- memory_erase(buffer, sizeof(buffer));
+ explicit_bzero(buffer, sizeof(buffer));
return r;
}
@@ -283,7 +283,7 @@ static int send_passwords(const char *socket_name, char **passwords) {
r = log_debug_errno(errno, "sendto(): %m");
finish:
- memory_erase(packet, packet_length);
+ explicit_bzero(packet, packet_length);
return r;
}