]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: Move error messages onto a single line
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Aug 2023 15:03:59 +0000 (17:03 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Sep 2023 07:35:36 +0000 (09:35 +0200)
Error messages are exempt from the 80 columns rule. Move them
onto one line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/rpc/virnetclient.c
src/rpc/virnetlibsshsession.c
src/rpc/virnetserver.c
src/rpc/virnetserverclient.c
src/rpc/virnetsshsession.c
src/rpc/virnettlscontext.c

index 18f87653f50b7b33219bb62875f3bece2cf43530..4ab8af68c508eee67d5d52886ac687f8b4a684a2 100644 (file)
@@ -1011,8 +1011,7 @@ int virNetClientSetTLSSession(virNetClient *client,
     }
     if (len != 1 || buf[0] != '\1') {
         virReportError(VIR_ERR_RPC, "%s",
-                       _("server verification (of our certificate or IP "
-                         "address) failed"));
+                       _("server verification (of our certificate or IP address) failed"));
         goto error;
     }
 
@@ -2069,15 +2068,13 @@ virNetClientCallNew(virNetMessage *msg,
         (msg->bufferLength != 0) &&
         (msg->header.status == 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 synchronous reply"));
         goto error;
     }
 
     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 synchronous reply"));
         goto error;
     }
 
index 8cb57e857fb77af4dac5bcc45968c6191dfe38bd..6632e4a9ef3107e015fff1cf6d29ba7e3ef5dcc3 100644 (file)
@@ -195,8 +195,7 @@ virLibsshServerKeyAsString(virNetLibsshSession *sess)
 
     if (ssh_get_server_publickey(sess->session, &key) != 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;
     }
 
@@ -261,8 +260,7 @@ virNetLibsshCheckHostKey(virNetLibsshSession *sess)
 
         /* host key verification failed */
         virReportError(VIR_ERR_AUTH_FAILED,
-                       _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identity 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 stored in '%4$s'."),
+                       _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identity 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 stored in '%4$s'."),
                        sess->hostname, sess->port,
                        keyhashstr, sess->knownHostsFile);
 
@@ -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: Can't verify the session host key"));
                 return -1;
             }
 
@@ -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 retrieve private key passphrase"));
         return -1;
     }
 
@@ -505,8 +501,7 @@ virNetLibsshAuthenticatePassword(virNetLibsshSession *sess)
     /* 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 callback not provided"));
         return SSH_AUTH_ERROR;
     }
 
@@ -567,9 +562,7 @@ virNetLibsshAuthenticateKeyboardInteractive(virNetLibsshSession *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;
     }
 
@@ -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 credentials "
-                         "were rejected by the server"));
+                       _("All provided authentication methods with credentials were rejected by the server"));
     }
 
     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 provided"));
         return -1;
     }
 
index 7233629f22b4eeae766c89211e4fb52457b1ccba..770476c1a6ee7c88733624f28bc843e19bdf8d65 100644 (file)
@@ -372,8 +372,7 @@ virNetServerNew(const char *name,
 
     if (max_clients < max_anonymous_clients) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("The overall maximum number of clients must not be less "
-                         "than the number of clients waiting for authentication"));
+                       _("The overall maximum number of clients must not be less than the number of clients waiting for authentication"));
         return NULL;
     }
 
@@ -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 not be less "
-                             "than the number of clients waiting for authentication"));
+                           _("The overall maximum number of clients must not be less than the number of clients waiting for authentication"));
             return NULL;
         }
     } else {
@@ -1127,8 +1125,7 @@ virNetServerSetClientLimits(virNetServer *srv,
 
     if (max < max_unauth) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("The overall maximum number of clients must not be less "
-                         "than the number of clients waiting for authentication"));
+                       _("The overall maximum number of clients must not be less than the number of clients waiting for authentication"));
         return -1;
     }
 
index c0c018b6be117edf196ca899939e9060ae4588f0..355aab4b04de9646b3dc094eba9efba9c3ee0413 100644 (file)
@@ -531,8 +531,7 @@ virNetServerClient *virNetServerClientNewPostExecRestart(virNetServer *srv,
     } else {
         if (virJSONValueObjectGetNumberLong(object, "conn_time", &timestamp) < 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("Malformed conn_time field in JSON "
-                             "state document"));
+                           _("Malformed conn_time field in JSON state document"));
             return NULL;
         }
     }
index 16d420467e6af8ed0f7f62166eb7bf84d7ff8372..316521d4cf2beba4bab6a938ac3fa8ef0e6c51f4 100644 (file)
@@ -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: Can't verify the session host key"));
                 return -1;
             }
 
@@ -320,8 +319,7 @@ virNetSSHCheckHostKey(virNetSSHSession *sess)
 
             if (i == sess->cred->ncredtype) {
                 virReportError(VIR_ERR_SSH, "%s",
-                               _("no suitable callback for host key "
-                                 "verification"));
+                               _("no suitable callback for host key verification"));
                 return -1;
             }
 
@@ -348,8 +346,7 @@ virNetSSHCheckHostKey(virNetSSHSession *sess)
 
             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 host key"));
                 tmp = (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 !!!: Identity 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 stored in '%4$s'."),
+                       _("!!! SSH HOST KEY VERIFICATION FAILED !!!: Identity 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 stored in '%4$s'."),
                        sess->hostname, sess->port,
                        knownHostEntry->key, sess->knownHostsFile);
         return -1;
@@ -532,12 +528,10 @@ virNetSSHAuthenticateAgent(virNetSSHSession *sess)
     if (ret == 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 were 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 retrieve private key passphrase"));
         return -1;
     }
 
@@ -615,8 +608,7 @@ virNetSSHAuthenticatePrivkey(virNetSSHSession *sess,
 
     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: callback has failed"));
         tmp = (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 callback not provided"));
         goto cleanup;
     }
 
@@ -732,8 +723,7 @@ virNetSSHAuthenticateKeyboardInteractive(virNetSSHSession *sess,
 
     if (!sess->cred || !sess->cred->cb) {
         virReportError(VIR_ERR_SSH, "%s",
-                       _("Can't perform keyboard-interactive authentication: "
-                         "Authentication callback not provided"));
+                       _("Can't perform keyboard-interactive authentication: Authentication callback not provided"));
         return -1;
     }
 
@@ -748,8 +738,7 @@ virNetSSHAuthenticateKeyboardInteractive(virNetSSHSession *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 authentication credentials"));
             return -1;
         case VIR_NET_SSH_AUTHCB_OOM:
             /* OOM error already reported */
@@ -801,8 +790,7 @@ virNetSSHAuthenticate(virNetSSHSession *sess)
 
     if (!sess->nauths) {
         virReportError(VIR_ERR_SSH, "%s",
-                       _("No authentication methods and credentials "
-                         "provided"));
+                       _("No authentication methods and credentials provided"));
         return -1;
     }
 
@@ -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 credentials "
-                         "were rejected by the server"));
+                       _("All provided authentication methods with credentials were rejected by the server"));
     }
 
     return -1;
@@ -914,8 +900,7 @@ virNetSSHValidateConfig(virNetSSHSession *sess)
 {
     if (sess->nauths == 0) {
         virReportError(VIR_ERR_SSH, "%s",
-                       _("No authentication methods and credentials "
-                         "provided"));
+                       _("No authentication methods and credentials provided"));
         return -1;
     }
 
index 1939fe5d6e677fcf7e9c067ad7cd693540b9750c..dc60244927edad0de3f683dc51d5d62642fd1f29 100644 (file)
@@ -366,11 +366,7 @@ virNetTLSContextCheckCertDNACL(const char *dname,
 
     /* 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 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."));
     return 0;
 }