From nobody Mon Feb 9 21:37:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1692949327; cv=none; d=zohomail.com; s=zohoarc; b=HKfaRIXJh7hGNIgMdV4CCP8Q1MwdIpR+2EE8n/xgtmY963HvLmkxOLaqfQ4QcqMYffdUAGEzsdaX++BUL5u3ZhQCdDpzQyQwcpUmPvlD5OTVmw2zaQkjI9YqVMPCVnjG07sn2kuEUS0EOCgZtGv47eIPtW/OKjzUd+ff98WhX5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692949327; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cjg5U0ufXaRhAJ7do8Mz2i5DCCG7oJoKr5xvm13PCvI=; b=AIyCZOcsGeApvr0pGZw9Rsi+oFZo84lAbc37gO/OIRADzNBpsXYiRpQU5Ef/k5qpuehuG1XFoQj+Xt/3tFBXsyVB2rfK0Cdxp88RAxTPQK9OWpkR1+CMdVl32ylPilEbNWoA1xjz157YF/mC4beG8nsTX7yJYFCnWD3lw8QRKS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1692949327383244.42062051976177; Fri, 25 Aug 2023 00:42:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-137-LdKDr6icOsCNwq3oLlcC9A-1; Fri, 25 Aug 2023 03:40:51 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D6A685D073; Fri, 25 Aug 2023 07:40:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35875492C13; Fri, 25 Aug 2023 07:40:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 14EB719465A8; Fri, 25 Aug 2023 07:40:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3D8651946589 for ; Fri, 25 Aug 2023 07:40:36 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2D11D2026D68; Fri, 25 Aug 2023 07:40:36 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8A932026D2B for ; Fri, 25 Aug 2023 07:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692949326; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cjg5U0ufXaRhAJ7do8Mz2i5DCCG7oJoKr5xvm13PCvI=; b=fpVU0rxFNBUoWFqIoPQWJjjyusfx+jgzQIFpz5+9ngKvhKsfficJDOlG5wOyjfMB5VoeEp ZKZmKkBWT4RlaDhZebifsdFlla0OHqlHBq8lYtxuFaKDxx3NFhnvnduBabPQgkKsms0g/G BjAhVDBok2Rn1ClRKeEV/TtLWqFD1Ms= X-MC-Unique: LdKDr6icOsCNwq3oLlcC9A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 16/27] rpc: Move error messages onto a single line Date: Fri, 25 Aug 2023 09:40:13 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1692949327663100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Error messages are exempt from the 80 columns rule. Move them onto one line. Signed-off-by: Michal Privoznik --- src/rpc/virnetclient.c | 9 +++---- src/rpc/virnetlibsshsession.c | 28 +++++++--------------- src/rpc/virnetserver.c | 9 +++---- src/rpc/virnetserverclient.c | 3 +-- src/rpc/virnetsshsession.c | 45 ++++++++++++----------------------- src/rpc/virnettlscontext.c | 6 +---- 6 files changed, 32 insertions(+), 68 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 18f87653f5..4ab8af68c5 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -1011,8 +1011,7 @@ int virNetClientSetTLSSession(virNetClient *client, } if (len !=3D 1 || buf[0] !=3D '\1') { virReportError(VIR_ERR_RPC, "%s", - _("server verification (of our certificate or IP " - "address) failed")); + _("server verification (of our certificate or IP ad= dress) failed")); goto error; } =20 @@ -2069,15 +2068,13 @@ virNetClientCallNew(virNetMessage *msg, (msg->bufferLength !=3D 0) && (msg->header.status =3D=3D VIR_NET_CONTINUE)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Attempt to send an asynchronous message with" - " a synchronous reply")); + _("Attempt to send an asynchronous message with a s= ynchronous reply")); goto error; } =20 if (expectReply && nonBlock) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Attempt to send a non-blocking message with" - " a synchronous reply")); + _("Attempt to send a non-blocking message with a sy= nchronous reply")); goto error; } =20 diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 8cb57e857f..6632e4a9ef 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -195,8 +195,7 @@ virLibsshServerKeyAsString(virNetLibsshSession *sess) =20 if (ssh_get_server_publickey(sess->session, &key) !=3D SSH_OK) { virReportError(VIR_ERR_LIBSSH, "%s", - _("failed to get the key of the current " - "session")); + _("failed to get the key of the current session")); return NULL; } =20 @@ -261,8 +260,7 @@ virNetLibsshCheckHostKey(virNetLibsshSession *sess) =20 /* host key verification failed */ virReportError(VIR_ERR_AUTH_FAILED, - _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identi= ty of host '%1$s:%2$d' differs from stored identity. " - "Please verify the new host key '%3$s' to avoid p= ossible man in the middle attack. The key is stored in '%4$s'."), + _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identi= ty of host '%1$s:%2$d' differs from stored identity. Please verify the new = host key '%3$s' to avoid possible man in the middle attack. The key is stor= ed in '%4$s'."), sess->hostname, sess->port, keyhashstr, sess->knownHostsFile); =20 @@ -279,8 +277,7 @@ virNetLibsshCheckHostKey(virNetLibsshSession *sess) /* ask to add the key */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_LIBSSH, "%s", - _("No user interaction callback provided: " - "Can't verify the session host key")); + _("No user interaction callback provided: C= an't verify the session host key")); return -1; } =20 @@ -355,8 +352,7 @@ virNetLibsshAuthenticatePrivkeyCb(const char *prompt, /* request user's key password */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_LIBSSH, "%s", - _("No user interaction callback provided: " - "Can't retrieve private key passphrase")); + _("No user interaction callback provided: Can't ret= rieve private key passphrase")); return -1; } =20 @@ -505,8 +501,7 @@ virNetLibsshAuthenticatePassword(virNetLibsshSession *s= ess) /* password authentication with interactive password request */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_LIBSSH, "%s", - _("Can't perform authentication: " - "Authentication callback not provided")); + _("Can't perform authentication: Authentication cal= lback not provided")); return SSH_AUTH_ERROR; } =20 @@ -567,9 +562,7 @@ virNetLibsshAuthenticateKeyboardInteractive(virNetLibss= hSession *sess, /* request user's key password */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_LIBSSH, "%s", - _("No user interaction callback provided: " - "Can't get input from keyboard interactive " - "authentication")); + _("No user interaction callback provided: Can't get= input from keyboard interactive authentication")); return SSH_AUTH_ERROR; } =20 @@ -738,12 +731,10 @@ virNetLibsshAuthenticate(virNetLibsshSession *sess) errmsg); } else if (no_method && !auth_failed) { virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("None of the requested authentication methods " - "are supported by the server")); + _("None of the requested authentication methods are= supported by the server")); } else { virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("All provided authentication methods with credent= ials " - "were rejected by the server")); + _("All provided authentication methods with credent= ials were rejected by the server")); } =20 return -1; @@ -803,8 +794,7 @@ virNetLibsshValidateConfig(virNetLibsshSession *sess) } if (!has_auths) { virReportError(VIR_ERR_LIBSSH, "%s", - _("No authentication methods and credentials " - "provided")); + _("No authentication methods and credentials provid= ed")); return -1; } =20 diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 7233629f22..770476c1a6 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -372,8 +372,7 @@ virNetServerNew(const char *name, =20 if (max_clients < max_anonymous_clients) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("The overall maximum number of clients must not b= e less " - "than the number of clients waiting for authentic= ation")); + _("The overall maximum number of clients must not b= e less than the number of clients waiting for authentication")); return NULL; } =20 @@ -458,8 +457,7 @@ virNetServerNewPostExecRestart(virJSONValue *object, } if (max_clients < max_anonymous_clients) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("The overall maximum number of clients must n= ot be less " - "than the number of clients waiting for authe= ntication")); + _("The overall maximum number of clients must n= ot be less than the number of clients waiting for authentication")); return NULL; } } else { @@ -1127,8 +1125,7 @@ virNetServerSetClientLimits(virNetServer *srv, =20 if (max < max_unauth) { virReportError(VIR_ERR_INVALID_ARG, "%s", - _("The overall maximum number of clients must not b= e less " - "than the number of clients waiting for authentic= ation")); + _("The overall maximum number of clients must not b= e less than the number of clients waiting for authentication")); return -1; } =20 diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index c0c018b6be..355aab4b04 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -531,8 +531,7 @@ virNetServerClient *virNetServerClientNewPostExecRestar= t(virNetServer *srv, } else { if (virJSONValueObjectGetNumberLong(object, "conn_time", ×tam= p) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Malformed conn_time field in JSON " - "state document")); + _("Malformed conn_time field in JSON state docu= ment")); return NULL; } } diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index 16d420467e..316521d4cf 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -307,8 +307,7 @@ virNetSSHCheckHostKey(virNetSSHSession *sess) /* ask to add the key */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_SSH, "%s", - _("No user interaction callback provided: " - "Can't verify the session host key")); + _("No user interaction callback provided: C= an't verify the session host key")); return -1; } =20 @@ -320,8 +319,7 @@ virNetSSHCheckHostKey(virNetSSHSession *sess) =20 if (i =3D=3D sess->cred->ncredtype) { virReportError(VIR_ERR_SSH, "%s", - _("no suitable callback for host key " - "verification")); + _("no suitable callback for host key verifi= cation")); return -1; } =20 @@ -348,8 +346,7 @@ virNetSSHCheckHostKey(virNetSSHSession *sess) =20 if (sess->cred->cb(&askKey, 1, sess->cred->cbdata)) { virReportError(VIR_ERR_SSH, "%s", - _("failed to retrieve decision to accept " - "host key")); + _("failed to retrieve decision to accept ho= st key")); tmp =3D (char*)askKey.prompt; VIR_FREE(tmp); VIR_FREE(keyhashstr); @@ -455,8 +452,7 @@ virNetSSHCheckHostKey(virNetSSHSession *sess) case LIBSSH2_KNOWNHOST_CHECK_MISMATCH: /* host key verification failed */ virReportError(VIR_ERR_AUTH_FAILED, - _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identi= ty of host '%1$s:%2$d' differs from stored identity. " - "Please verify the new host key '%3$s' to avoid p= ossible man in the middle attack. The key is stored in '%4$s'."), + _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identi= ty of host '%1$s:%2$d' differs from stored identity. Please verify the new = host key '%3$s' to avoid possible man in the middle attack. The key is stor= ed in '%4$s'."), sess->hostname, sess->port, knownHostEntry->key, sess->knownHostsFile); return -1; @@ -532,12 +528,10 @@ virNetSSHAuthenticateAgent(virNetSSHSession *sess) if (ret =3D=3D 1) { if (no_identity) { virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("SSH Agent did not provide any " - "authentication identity")); + _("SSH Agent did not provide any authentication= identity")); } else { virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("All identities provided by the SSH Agent " - "were rejected")); + _("All identities provided by the SSH Agent wer= e rejected")); } return 1; } @@ -589,8 +583,7 @@ virNetSSHAuthenticatePrivkey(virNetSSHSession *sess, /* request user's key password */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_SSH, "%s", - _("No user interaction callback provided: " - "Can't retrieve private key passphrase")); + _("No user interaction callback provided: Can't ret= rieve private key passphrase")); return -1; } =20 @@ -615,8 +608,7 @@ virNetSSHAuthenticatePrivkey(virNetSSHSession *sess, =20 if (sess->cred->cb(&retr_passphrase, 1, sess->cred->cbdata)) { virReportError(VIR_ERR_SSH, "%s", - _("failed to retrieve private key passphrase: " - "callback has failed")); + _("failed to retrieve private key passphrase: callb= ack has failed")); tmp =3D (char *)retr_passphrase.prompt; VIR_FREE(tmp); return -1; @@ -671,8 +663,7 @@ virNetSSHAuthenticatePassword(virNetSSHSession *sess) /* password authentication with interactive password request */ if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_SSH, "%s", - _("Can't perform authentication: " - "Authentication callback not provided")); + _("Can't perform authentication: Authentication cal= lback not provided")); goto cleanup; } =20 @@ -732,8 +723,7 @@ virNetSSHAuthenticateKeyboardInteractive(virNetSSHSessi= on *sess, =20 if (!sess->cred || !sess->cred->cb) { virReportError(VIR_ERR_SSH, "%s", - _("Can't perform keyboard-interactive authenticatio= n: " - "Authentication callback not provided")); + _("Can't perform keyboard-interactive authenticatio= n: Authentication callback not provided")); return -1; } =20 @@ -748,8 +738,7 @@ virNetSSHAuthenticateKeyboardInteractive(virNetSSHSessi= on *sess, switch (sess->authCbErr) { case VIR_NET_SSH_AUTHCB_NO_METHOD: virReportError(VIR_ERR_SSH, "%s", - _("no suitable method to retrieve " - "authentication credentials")); + _("no suitable method to retrieve authenticatio= n credentials")); return -1; case VIR_NET_SSH_AUTHCB_OOM: /* OOM error already reported */ @@ -801,8 +790,7 @@ virNetSSHAuthenticate(virNetSSHSession *sess) =20 if (!sess->nauths) { virReportError(VIR_ERR_SSH, "%s", - _("No authentication methods and credentials " - "provided")); + _("No authentication methods and credentials provid= ed")); return -1; } =20 @@ -866,12 +854,10 @@ virNetSSHAuthenticate(virNetSSHSession *sess) /* pass through the error */ } else if (no_method && !auth_failed) { virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("None of the requested authentication methods " - "are supported by the server")); + _("None of the requested authentication methods are= supported by the server")); } else { virReportError(VIR_ERR_AUTH_FAILED, "%s", - _("All provided authentication methods with credent= ials " - "were rejected by the server")); + _("All provided authentication methods with credent= ials were rejected by the server")); } =20 return -1; @@ -914,8 +900,7 @@ virNetSSHValidateConfig(virNetSSHSession *sess) { if (sess->nauths =3D=3D 0) { virReportError(VIR_ERR_SSH, "%s", - _("No authentication methods and credentials " - "provided")); + _("No authentication methods and credentials provid= ed")); return -1; } =20 diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index 1939fe5d6e..dc60244927 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -366,11 +366,7 @@ virNetTLSContextCheckCertDNACL(const char *dname, =20 /* This is the most common error: make it informative. */ virReportError(VIR_ERR_SYSTEM_ERROR, "%s", - _("Client's Distinguished Name is not on the list " - "of allowed clients (tls_allowed_dn_list). Use " - "'virt-pki-query-dn clientcert.pem' to view the " - "Distinguished Name field in the client certificate, " - "or run this daemon with --verbose option.")); + _("Client's Distinguished Name is not on the list of al= lowed clients (tls_allowed_dn_list). Use 'virt-pki-query-dn clientcert.pem= ' to view the Distinguished Name field in the client certificate, or run th= is daemon with --verbose option.")); return 0; } =20 --=20 2.41.0