From 0ba01f936fef9026f45388129aedec5d76a1ec23 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 23 2020 06:09:31 +0000 Subject: Apply patch 0004-tools-remove-errx-from-adcli_read_password_func.patch patch_name: 0004-tools-remove-errx-from-adcli_read_password_func.patch present_in_specfile: true location_in_specfile: 46 --- diff --git a/tools/tools.c b/tools/tools.c index c4e2851..bdf6d38 100644 --- a/tools/tools.c +++ b/tools/tools.c @@ -247,7 +247,9 @@ adcli_read_password_func (adcli_login_type login_type, if (res < 0) { if (errno == EAGAIN || errno == EINTR) continue; - err (EFAIL, "couldn't read password from stdin"); + warn ("couldn't read password from stdin"); + free (buffer); + return NULL; } else if (res == 0) { buffer[offset] = '\0'; @@ -261,8 +263,11 @@ adcli_read_password_func (adcli_login_type login_type, return buffer; } else { - if (memchr (buffer + offset, 0, res)) - errx (EUSAGE, "unsupported null character present in password"); + if (memchr (buffer + offset, 0, res)) { + warnx ("unsupported null character present in password"); + free (buffer); + return NULL; + } offset += res; } }