Index | Thread | Search

From:
pdurlej@cat4u.org
Subject:
Re: getty: prevent sending empty login names to login(1)
To:
Daniel Dickman <didickman@gmail.com>
Cc:
tech@openbsd.org
Date:
Wed, 22 Jul 2026 03:58:16 +0200

Download raw body.

Thread
On Tue, Jul 21, 2026 at 06:18:44PM -0400, Daniel Dickman wrote:
> Hi Piotr, does the below fix this issue for you?
> 
> Index: main.c
> ===================================================================
> RCS file: /cvs/src/libexec/getty/main.c,v
> diff -u -p -u -r1.56 main.c
> --- main.c	19 Jul 2024 15:28:51 -0000	1.56
> +++ main.c	21 Jul 2026 22:12:20 -0000
> @@ -314,6 +314,8 @@ main(int argc, char *argv[])
>  			oflush();
>  			alarm(0);
>  			signal(SIGALRM, SIG_DFL);
> +			if (name[0] == '\0')
> +				continue;
>  			if (name[0] == '-') {
>  				xputs("user names may not start with '-'.");
>  				continue;
> 

Seems to fix the problem for me.

Kind regards,
Piotr