[systemd-devel] [PATCH] systemctl: always null-terminate the password

Lennart Poettering lennart at poettering.net
Mon Feb 28 13:28:27 PST 2011


On Mon, 28.02.11 11:25, =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= (zbyszek at in.waw.pl) wrote:

Ah, thanks, good catch.

The perils of copy&paste. Or actually cut&paste... ;-)

> ---
>  src/ask-password-api.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ask-password-api.c b/src/ask-password-api.c
> index dd54fb6..af1b611 100644
> --- a/src/ask-password-api.c
> +++ b/src/ask-password-api.c
> @@ -179,8 +179,6 @@ int ask_password_tty(
>                  }
>          }
>  
> -        if (ttyfd >= 0)
> -
>          passphrase[p] = 0;
>  
>          if (!(*_passphrase = strdup(passphrase))) {


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list