if ($modern_ret_as_list) {
print " if (nresults > $single_ret_list_max_define) {\n";
print " virReportError(VIR_ERR_INTERNAL_ERROR,\n";
- print " _(\"Too many ${single_ret_list_error_msg_type}s '%d' for limit '%d'\"),\n";
+ print " _(\"Too many ${single_ret_list_error_msg_type}s '%1\$d' for limit '%2\$d'\"),\n";
print " nresults, $single_ret_list_max_define);\n";
print " goto cleanup;\n";
print " }\n";
print "\n";
print " if ($args_check->{arg} > $args_check->{limit}) {\n";
print " virReportError(VIR_ERR_RPC,\n";
- print " _(\"%s length greater than maximum: %d > %d\"),\n";
+ print " _(\"%1\$s length greater than maximum: %2\$d > %3\$d\"),\n";
print " $args_check->{name}, (int)$args_check->{arg}, $args_check->{limit});\n";
print " goto done;\n";
print " }\n";
print "\n";
print " if ($single_ret_list_max_var > $single_ret_list_max_define) {\n";
print " virReportError(VIR_ERR_RPC,\n";
- print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d,\"\n";
+ print " _(\"too many remote ${single_ret_list_error_msg_type}s: %1\$d > %2\$d,\"\n";
print " \"in parameter '$single_ret_list_name' for 'vir$call->{ProcName}'\"),\n";
print " $single_ret_list_max_var, $single_ret_list_max_define);\n";
print " goto done;\n";
$modern_ret_as_list) {
print " if (ret.$single_ret_list_name.${single_ret_list_name}_len > $single_ret_list_max_var) {\n";
print " virReportError(VIR_ERR_RPC,\n";
- print " _(\"too many remote ${single_ret_list_error_msg_type}s: %d > %d,\"\n";
+ print " _(\"too many remote ${single_ret_list_error_msg_type}s: %1\$d > %2\$d,\"\n";
print " \"in parameter '$single_ret_list_name' for 'vir$call->{ProcName}'\"),\n";
print " ret.$single_ret_list_name.${single_ret_list_name}_len, $single_ret_list_max_var);\n";
print " goto cleanup;\n";
if ($action eq "Ensure") {
print " if (rv == 0)\n";
print " virReportError(VIR_ERR_ACCESS_DENIED,\n";
- print" _(\"'%s' denied access\"), conn->driver->name);\n";
+ print" _(\"'%1\$s' denied access\"), conn->driver->name);\n";
print " return $fail;\n";
} else {
print " virResetLastError();\n";
/* Guard against overflow */
if (interval > INT_MAX / 1000) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("keepalive interval %d too large"), interval);
+ _("keepalive interval %1$d too large"), interval);
goto cleanup;
}
ka->interval = interval;
if (!thecall) {
virReportError(VIR_ERR_RPC,
- _("no call waiting for reply with prog %d vers %d serial %d"),
+ _("no call waiting for reply with prog %1$d vers %2$d serial %3$d"),
client->msg.header.prog, client->msg.header.vers, client->msg.header.serial);
return -1;
}
case VIR_NET_CALL_WITH_FDS:
default:
virReportError(VIR_ERR_RPC,
- _("got unexpected RPC call prog %d vers %d proc %d type %d"),
+ _("got unexpected RPC call prog %1$d vers %2$d proc %3$d type %4$d"),
client->msg.header.prog, client->msg.header.vers,
client->msg.header.proc, client->msg.header.type);
return -1;
/* Check version, etc. */
if (msg->header.prog != prog->program) {
- VIR_ERROR(_("program mismatch in event (actual 0x%x, expected 0x%x)"),
+ VIR_ERROR(_("program mismatch in event (actual 0x%1$x, expected 0x%2$x)"),
msg->header.prog, prog->program);
return -1;
}
if (msg->header.vers != prog->version) {
- VIR_ERROR(_("version mismatch in event (actual 0x%x, expected 0x%x)"),
+ VIR_ERROR(_("version mismatch in event (actual 0x%1$x, expected 0x%2$x)"),
msg->header.vers, prog->version);
return -1;
}
if (msg->header.status != VIR_NET_OK) {
- VIR_ERROR(_("status mismatch in event (actual 0x%x, expected 0x%x)"),
+ VIR_ERROR(_("status mismatch in event (actual 0x%1$x, expected 0x%2$x)"),
msg->header.status, VIR_NET_OK);
return -1;
}
if (msg->header.type != VIR_NET_MESSAGE) {
- VIR_ERROR(_("type mismatch in event (actual 0x%x, expected 0x%x)"),
+ VIR_ERROR(_("type mismatch in event (actual 0x%1$x, expected 0x%2$x)"),
msg->header.type, VIR_NET_MESSAGE);
return -1;
}
event = virNetClientProgramGetEvent(prog, msg->header.proc);
if (!event) {
- VIR_ERROR(_("No event expected with procedure 0x%x"),
+ VIR_ERROR(_("No event expected with procedure 0x%1$x"),
msg->header.proc);
return -1;
}
for (i = 0; i < msg->nfds; i++) {
if ((msg->fds[i] = dup(outfds[i])) < 0) {
virReportSystemError(errno,
- _("Cannot duplicate FD %d"),
+ _("Cannot duplicate FD %1$d"),
outfds[i]);
goto error;
}
if (virSetInherit(msg->fds[i], false) < 0) {
virReportSystemError(errno,
- _("Cannot set close-on-exec %d"),
+ _("Cannot set close-on-exec %1$d"),
msg->fds[i]);
goto error;
}
if (msg->header.type != VIR_NET_REPLY &&
msg->header.type != VIR_NET_REPLY_WITH_FDS) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected message type %d"), msg->header.type);
+ _("Unexpected message type %1$d"), msg->header.type);
goto error;
}
if (msg->header.proc != proc) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected message proc %d != %d"),
+ _("Unexpected message proc %1$d != %2$d"),
msg->header.proc, proc);
goto error;
}
if (msg->header.serial != serial) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected message serial %d != %d"),
+ _("Unexpected message serial %1$d != %2$d"),
msg->header.serial, serial);
goto error;
}
for (i = 0; i < *ninfds; i++) {
if (((*infds)[i] = dup(msg->fds[i])) < 0) {
virReportSystemError(errno,
- _("Cannot duplicate FD %d"),
+ _("Cannot duplicate FD %1$d"),
msg->fds[i]);
goto error;
}
if (virSetInherit((*infds)[i], false) < 0) {
virReportSystemError(errno,
- _("Cannot set close-on-exec %d"),
+ _("Cannot set close-on-exec %1$d"),
(*infds)[i]);
goto error;
}
case VIR_NET_CONTINUE:
default:
virReportError(VIR_ERR_RPC,
- _("Unexpected message status %d"), msg->header.status);
+ _("Unexpected message status %1$d"), msg->header.status);
goto error;
}
/* Shouldn't happen, But it's better to safe than sorry. */
if (st->holeLength) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unprocessed hole of size %lld already in the queue"),
+ _("unprocessed hole of size %1$lld already in the queue"),
st->holeLength);
return -1;
}
if (msg->header.type != VIR_NET_STREAM_HOLE) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid message prog=%d type=%d serial=%u proc=%d"),
+ _("Invalid message prog=%1$d type=%2$d serial=%3$u proc=%4$d"),
msg->header.prog,
msg->header.type,
msg->header.serial,
st->holeLength = 0;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Invalid message prog=%d type=%d serial=%u proc=%d"),
+ _("Invalid message prog=%1$d type=%2$d serial=%3$u proc=%4$d"),
msg->header.prog,
msg->header.type,
msg->header.serial,
if (!srv) {
virReportError(VIR_ERR_NO_SERVER,
- _("No server named '%s'"), serverName);
+ _("No server named '%1$s'"), serverName);
}
return srv;
size_t n = virJSONValueArraySize(servers);
if (n > nDefServerNames) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Server count %zd greater than default name count %zu"),
+ _("Server count %1$zd greater than default name count %2$zu"),
n, nDefServerNames);
goto error;
}
}
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected signal received: %d"), siginfo.si_signo);
+ _("Unexpected signal received: %1$d"), siginfo.si_signo);
cleanup:
virObjectUnlock(dmn);
/* host key verification failed */
virReportError(VIR_ERR_AUTH_FAILED,
- _("!!! SSH HOST KEY VERIFICATION FAILED !!!: "
- "Identity of host '%s:%d' differs from stored identity. "
- "Please verify the new host key '%s' to avoid possible "
- "man in the middle attack. The key is stored in '%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);
if (!keyhashstr)
return -1;
- prompt = g_strdup_printf(_("Accept SSH host key with hash '%s' for " "host '%s:%d' (%s/%s)?"),
+ prompt = g_strdup_printf(_("Accept SSH host key with hash '%1$s' for host '%2$s:%3$d' (%4$s/%5$s)?"),
keyhashstr, sess->hostname, sess->port, "y", "n");
if (!(cred = virAuthAskCredential(sess->cred, prompt, true))) {
if (!cred->result ||
STRCASENEQ(cred->result, "y")) {
virReportError(VIR_ERR_LIBSSH,
- _("SSH host key for '%s' (%s) was not accepted"),
+ _("SSH host key for '%1$s' (%2$s) was not accepted"),
sess->hostname, keyhashstr);
ssh_string_free_char(keyhashstr);
return -1;
if (ssh_session_update_known_hosts(sess->session) < 0) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to write known_host file '%s': %s"),
+ _("failed to write known_host file '%1$s': %2$s"),
sess->knownHostsFile,
errmsg);
return -1;
case SSH_SERVER_ERROR:
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to validate SSH host key: %s"),
+ _("failed to validate SSH host key: %1$s"),
errmsg);
return -1;
sess, &key);
if (ret == SSH_EOF) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("error while reading private key '%s'"),
+ _("error while reading private key '%1$s'"),
priv->filename);
return SSH_AUTH_ERROR;
} else if (ret == SSH_ERROR) {
if (virGetLastErrorCode() == VIR_ERR_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("error while opening private key '%s', wrong "
- "passphrase?"),
+ _("error while opening private key '%1$s', wrong passphrase?"),
priv->filename);
}
return SSH_AUTH_ERROR;
ret = ssh_pki_import_pubkey_file(tmp, &public_key);
if (ret == SSH_ERROR) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("error while reading public key '%s'"),
+ _("error while reading public key '%1$s'"),
tmp);
err = SSH_AUTH_ERROR;
goto error;
ret = ssh_pki_export_privkey_to_pubkey(private_key, &public_key);
if (ret == SSH_ERROR) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("cannot export the public key from the "
- "private key '%s'"),
+ _("cannot export the public key from the private key '%1$s'"),
priv->filename);
err = SSH_AUTH_ERROR;
goto error;
g_autoptr(virConnectCredential) cred = NULL;
g_autofree char *prompt = NULL;
- prompt = g_strdup_printf(_("Enter %s's password for %s"),
+ prompt = g_strdup_printf(_("Enter %1$s's password for %2$s"),
sess->username, sess->hostname);
if (!(cred = virAuthAskCredential(sess->cred, prompt, false)))
error:
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_AUTH_FAILED,
- _("authentication failed: %s"), errmsg);
+ _("authentication failed: %1$s"), errmsg);
return rc;
}
cred->result) < 0) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_AUTH_FAILED,
- _("authentication failed: %s"), errmsg);
+ _("authentication failed: %1$s"), errmsg);
return SSH_AUTH_ERROR;
}
/* error path */
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_AUTH_FAILED,
- _("authentication failed: %s"), errmsg);
+ _("authentication failed: %1$s"), errmsg);
}
return ret;
if (ret == SSH_AUTH_ERROR) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("Failed to authenticate as 'none': %s"),
+ _("Failed to authenticate as 'none': %1$s"),
errmsg);
return -1;
}
if (ret == SSH_AUTH_ERROR) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to authenticate using agent: %s"),
+ _("failed to authenticate using agent: %1$s"),
errmsg);
}
break;
if (sess->nauths == 1) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to authenticate: %s"),
+ _("failed to authenticate: %1$s"),
errmsg);
} else if (no_method && !auth_failed) {
virReportError(VIR_ERR_AUTH_FAILED, "%s",
if (!sess->channel) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to create libssh channel: %s"),
+ _("failed to create libssh channel: %1$s"),
errmsg);
return -1;
}
if (ssh_channel_open_session(sess->channel) != SSH_OK) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to open ssh channel: %s"),
+ _("failed to open ssh channel: %1$s"),
errmsg);
return -1;
}
if (ssh_channel_request_exec(sess->channel, sess->channelCommand) != SSH_OK) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("failed to execute command '%s': %s"),
+ _("failed to execute command '%1$s': %2$s"),
sess->channelCommand,
errmsg);
return -1;
if (ret < 0) {
errmsg = ssh_get_error(sess->session);
virReportError(VIR_ERR_NO_CONNECT,
- _("SSH session handshake failed: %s"),
+ _("SSH session handshake failed: %1$s"),
errmsg);
goto error;
}
if (sess->state != VIR_NET_LIBSSH_STATE_HANDSHAKE_COMPLETE) {
if (sess->state == VIR_NET_LIBSSH_STATE_ERROR_REMOTE)
virReportError(VIR_ERR_LIBSSH,
- _("Remote program terminated "
- "with non-zero code: %d"),
+ _("Remote program terminated with non-zero code: %1$d"),
sess->channelCommandReturnValue);
else
virReportError(VIR_ERR_LIBSSH, "%s",
eof:
if (ssh_channel_get_exit_status(sess->channel)) {
virReportError(VIR_ERR_LIBSSH,
- _("Remote command terminated with non-zero code: %d"),
+ _("Remote command terminated with non-zero code: %1$d"),
ssh_channel_get_exit_status(sess->channel));
sess->channelCommandReturnValue = ssh_channel_get_exit_status(sess->channel);
sess->state = VIR_NET_LIBSSH_STATE_ERROR_REMOTE;
if (sess->state != VIR_NET_LIBSSH_STATE_HANDSHAKE_COMPLETE) {
if (sess->state == VIR_NET_LIBSSH_STATE_ERROR_REMOTE)
virReportError(VIR_ERR_LIBSSH,
- _("Remote program terminated with non-zero code: %d"),
+ _("Remote program terminated with non-zero code: %1$d"),
sess->channelCommandReturnValue);
else
virReportError(VIR_ERR_LIBSSH, "%s",
if (ssh_channel_is_eof(sess->channel)) {
if (ssh_channel_get_exit_status(sess->channel)) {
virReportError(VIR_ERR_LIBSSH,
- _("Remote program terminated with non-zero code: %d"),
+ _("Remote program terminated with non-zero code: %1$d"),
ssh_channel_get_exit_status(sess->channel));
sess->state = VIR_NET_LIBSSH_STATE_ERROR_REMOTE;
sess->channelCommandReturnValue = ssh_channel_get_exit_status(sess->channel);
sess->state = VIR_NET_LIBSSH_STATE_ERROR;
msg = ssh_get_error(sess->session);
virReportError(VIR_ERR_LIBSSH,
- _("write failed: %s"), msg);
+ _("write failed: %1$s"), msg);
}
cleanup:
if (len < VIR_NET_MESSAGE_LEN_MAX) {
virReportError(VIR_ERR_RPC,
- _("packet %d bytes received from server too small, want %d"),
+ _("packet %1$d bytes received from server too small, want %2$d"),
len, VIR_NET_MESSAGE_LEN_MAX);
goto cleanup;
}
if (len > VIR_NET_MESSAGE_MAX) {
virReportError(VIR_ERR_RPC,
- _("packet %d bytes received from server too large, want %d"),
+ _("packet %1$d bytes received from server too large, want %2$d"),
len, VIR_NET_MESSAGE_MAX);
goto cleanup;
}
if (numFDs > VIR_NET_MESSAGE_NUM_FDS_MAX) {
virReportError(VIR_ERR_RPC,
- _("Too many FDs to send %d, expected %d maximum"),
+ _("Too many FDs to send %1$d, expected %2$d maximum"),
numFDs, VIR_NET_MESSAGE_NUM_FDS_MAX);
goto cleanup;
}
if (numFDs > VIR_NET_MESSAGE_NUM_FDS_MAX) {
virReportError(VIR_ERR_RPC,
- _("Received too many FDs %d, expected %d maximum"),
+ _("Received too many FDs %1$d, expected %2$d maximum"),
numFDs, VIR_NET_MESSAGE_NUM_FDS_MAX);
goto cleanup;
}
if ((msg->bufferOffset + len) >
(VIR_NET_MESSAGE_MAX + VIR_NET_MESSAGE_LEN_MAX)) {
virReportError(VIR_ERR_RPC,
- _("Stream data too long to send "
- "(%zu bytes needed, %zu bytes available)"),
+ _("Stream data too long to send (%1$zu bytes needed, %2$zu bytes available)"),
len,
VIR_NET_MESSAGE_MAX +
VIR_NET_MESSAGE_LEN_MAX -
if (slot >= msg->nfds) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("No FD available at slot %zu"), slot);
+ _("No FD available at slot %1$zu"), slot);
return -1;
}
if ((fd = dup(msg->fds[slot])) < 0) {
virReportSystemError(errno,
- _("Unable to duplicate FD %d"),
+ _("Unable to duplicate FD %1$d"),
msg->fds[slot]);
return -1;
}
if (virSetInherit(fd, false) < 0) {
VIR_FORCE_CLOSE(fd);
virReportSystemError(errno,
- _("Cannot set close-on-exec %d"),
+ _("Cannot set close-on-exec %1$d"),
fd);
return -1;
}
if ((newfd = dup(fd)) < 0) {
virReportSystemError(errno,
- _("Unable to duplicate FD %d"),
+ _("Unable to duplicate FD %1$d"),
fd);
goto error;
}
if (virSetInherit(newfd, false) < 0) {
virReportSystemError(errno,
- _("Cannot set close-on-exec %d"),
+ _("Cannot set close-on-exec %1$d"),
newfd);
goto error;
}
int err = sasl_client_init(NULL);
if (err != SASL_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("failed to initialize SASL library: %d (%s)"),
+ _("failed to initialize SASL library: %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
return -1;
}
int err = sasl_server_init(NULL, "libvirt");
if (err != SASL_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("failed to initialize SASL library: %d (%s)"),
+ _("failed to initialize SASL library: %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
return -1;
}
}
/* Denied */
- VIR_ERROR(_("SASL client identity '%s' not allowed by ACL"), identity);
+ VIR_ERROR(_("SASL client identity '%1$s' not allowed by ACL"), identity);
/* This is the most common error: make it informative. */
virReportError(VIR_ERR_SYSTEM_ERROR, "%s",
&sasl->conn);
if (err != SASL_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("Failed to create SASL client context: %d (%s)"),
+ _("Failed to create SASL client context: %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
&sasl->conn);
if (err != SASL_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("Failed to create SASL client context: %d (%s)"),
+ _("Failed to create SASL client context: %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
err = sasl_setprop(sasl->conn, SASL_SSF_EXTERNAL, &ssf);
if (err != SASL_OK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot set external SSF %d (%s)"),
+ _("cannot set external SSF %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
err = sasl_getprop(sasl->conn, SASL_USERNAME, &val);
if (err != SASL_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("cannot query SASL username on connection %d (%s)"),
+ _("cannot query SASL username on connection %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
val = NULL;
goto cleanup;
err = sasl_getprop(sasl->conn, SASL_SSF, &val);
if (err != SASL_OK) {
virReportError(VIR_ERR_AUTH_FAILED,
- _("cannot query SASL ssf on connection %d (%s)"),
+ _("cannot query SASL ssf on connection %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
ssf = -1;
goto cleanup;
err = sasl_setprop(sasl->conn, SASL_SEC_PROPS, &secprops);
if (err != SASL_OK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot set security props %d (%s)"),
+ _("cannot set security props %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
err = sasl_getprop(sasl->conn, SASL_MAXOUTBUF, &u.ptr);
if (err != SASL_OK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot get security props %d (%s)"),
+ _("cannot get security props %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
return -1;
}
NULL);
if (err != SASL_OK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot list SASL mechanisms %d (%s)"),
+ _("cannot list SASL mechanisms %1$d (%2$s)"),
err, sasl_errdetail(sasl->conn));
goto cleanup;
}
break;
default:
virReportError(VIR_ERR_AUTH_FAILED,
- _("Failed to start SASL negotiation: %d (%s)"),
+ _("Failed to start SASL negotiation: %1$d (%2$s)"),
err, sasl_errdetail(sasl->conn));
break;
}
break;
default:
virReportError(VIR_ERR_AUTH_FAILED,
- _("Failed to step SASL negotiation: %d (%s)"),
+ _("Failed to step SASL negotiation: %1$d (%2$s)"),
err, sasl_errdetail(sasl->conn));
break;
}
break;
default:
virReportError(VIR_ERR_AUTH_FAILED,
- _("Failed to start SASL negotiation: %d (%s)"),
+ _("Failed to start SASL negotiation: %1$d (%2$s)"),
err, sasl_errdetail(sasl->conn));
break;
}
break;
default:
virReportError(VIR_ERR_AUTH_FAILED,
- _("Failed to start SASL negotiation: %d (%s)"),
+ _("Failed to start SASL negotiation: %1$d (%2$s)"),
err, sasl_errdetail(sasl->conn));
break;
}
virObjectLock(sasl);
if (inputLen > sasl->maxbufsize) {
virReportSystemError(EINVAL,
- _("SASL data length %zu too long, max %zu"),
+ _("SASL data length %1$zu too long, max %2$zu"),
inputLen, sasl->maxbufsize);
goto cleanup;
}
if (err != SASL_OK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to encode SASL data: %d (%s)"),
+ _("failed to encode SASL data: %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
virObjectLock(sasl);
if (inputLen > sasl->maxbufsize) {
virReportSystemError(EINVAL,
- _("SASL data length %zu too long, max %zu"),
+ _("SASL data length %1$zu too long, max %2$zu"),
inputLen, sasl->maxbufsize);
goto cleanup;
}
*outputlen = outlen;
if (err != SASL_OK) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to decode SASL data: %d (%s)"),
+ _("failed to decode SASL data: %1$d (%2$s)"),
err, sasl_errstring(err, NULL, NULL));
goto cleanup;
}
return virObjectRef(client);
}
- virReportError(VIR_ERR_NO_CLIENT, _("No client with matching ID '%llu'"), id);
+ virReportError(VIR_ERR_NO_CLIENT, _("No client with matching ID '%1$llu'"), id);
return NULL;
}
if (client->rx->bufferLength <= client->rx->bufferOffset) {
virReportError(VIR_ERR_RPC,
- _("unexpected zero/negative length request %lld"),
+ _("unexpected zero/negative length request %1$lld"),
(long long int)(client->rx->bufferLength - client->rx->bufferOffset));
client->wantClose = true;
return -1;
if (client->tx->bufferLength < client->tx->bufferOffset) {
virReportError(VIR_ERR_RPC,
- _("unexpected zero/negative length request %lld"),
+ _("unexpected zero/negative length request %1$lld"),
(long long int)(client->tx->bufferLength - client->tx->bufferOffset));
client->wantClose = true;
return -1;
virNetMessageError rerr;
virReportError(VIR_ERR_RPC,
- _("Cannot find program %d version %d"), req->prog, req->vers);
+ _("Cannot find program %1$d version %2$d"), req->prog, req->vers);
memset(&rerr, 0, sizeof(rerr));
return virNetServerProgramSendError(req->prog,
/* Check version, etc. */
if (msg->header.prog != prog->program) {
virReportError(VIR_ERR_RPC,
- _("program mismatch (actual %x, expected %x)"),
+ _("program mismatch (actual %1$x, expected %2$x)"),
msg->header.prog, prog->program);
goto error;
}
if (msg->header.vers != prog->version) {
virReportError(VIR_ERR_RPC,
- _("version mismatch (actual %x, expected %x)"),
+ _("version mismatch (actual %1$x, expected %2$x)"),
msg->header.vers, prog->version);
goto error;
}
case VIR_NET_STREAM_HOLE:
default:
virReportError(VIR_ERR_RPC,
- _("Unexpected message type %u"),
+ _("Unexpected message type %1$u"),
msg->header.type);
goto error;
}
if (msg->header.status != VIR_NET_OK) {
virReportError(VIR_ERR_RPC,
- _("Unexpected message status %u"),
+ _("Unexpected message status %1$u"),
msg->header.status);
goto error;
}
if (!dispatcher) {
virReportError(VIR_ERR_RPC,
- _("unknown procedure: %d"),
+ _("unknown procedure: %1$d"),
msg->header.proc);
goto error;
}
gaierr == EAI_NONAME) {
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot resolve %s address: %s"),
+ _("Cannot resolve %1$s address: %2$s"),
address,
gai_strerror(gaierr));
return -1;
e = getaddrinfo(nodename, service, &hints, &ai);
if (e != 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to resolve address '%s' service '%s': %s"),
+ _("Unable to resolve address '%1$s' service '%2$s': %3$s"),
nodename, service, gai_strerror(e));
return -1;
}
addr.data.un.sun_family = AF_UNIX;
if (virStrcpyStatic(addr.data.un.sun_path, path) < 0) {
virReportSystemError(ENAMETOOLONG,
- _("Path %s too long for unix socket"), path);
+ _("Path %1$s too long for unix socket"), path);
goto error;
}
if (addr.data.un.sun_path[0] == '@')
if (bind(fd, &addr.data.sa, addr.len) < 0) {
umask(oldmask);
virReportSystemError(errno,
- _("Failed to bind socket to '%s'"),
+ _("Failed to bind socket to '%1$s'"),
path);
goto error;
}
*/
if (grp != 0 && chown(path, user, grp)) {
virReportSystemError(errno,
- _("Failed to change ownership of '%s' to %d:%d"),
+ _("Failed to change ownership of '%1$s' to %2$d:%3$d"),
path, (int)user, (int)grp);
goto error;
}
e = getaddrinfo(nodename, service, &hints, &ai);
if (e != 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to resolve address '%s' service '%s': %s"),
+ _("Unable to resolve address '%1$s' service '%2$s': %3$s"),
nodename, service, gai_strerror(e));
return -1;
}
if (fd == -1) {
virReportSystemError(savedErrno,
- _("unable to connect to server at '%s:%s'"),
+ _("unable to connect to server at '%1$s:%2$s'"),
nodename, service);
goto error;
}
if (g_mkdir_with_parents(rundir, 0700) < 0) {
virReportSystemError(errno,
- _("Cannot create user runtime directory '%s'"),
+ _("Cannot create user runtime directory '%1$s'"),
rundir);
goto cleanup;
}
if ((lockfd = open(lockpath, O_RDWR | O_CREAT, 0600)) < 0 ||
virSetCloseExec(lockfd) < 0) {
- virReportSystemError(errno, _("Unable to create lock '%s'"), lockpath);
+ virReportSystemError(errno, _("Unable to create lock '%1$s'"), lockpath);
goto cleanup;
}
if (virFileLock(lockfd, false, 0, 1, true) < 0) {
- virReportSystemError(errno, _("Unable to lock '%s'"), lockpath);
+ virReportSystemError(errno, _("Unable to lock '%1$s'"), lockpath);
goto cleanup;
}
}
remoteAddr.data.un.sun_family = AF_UNIX;
if (virStrcpyStatic(remoteAddr.data.un.sun_path, path) < 0) {
- virReportSystemError(ENOMEM, _("Path %s too long for unix socket"), path);
+ virReportSystemError(ENOMEM, _("Path %1$s too long for unix socket"), path);
goto cleanup;
}
if (remoteAddr.data.un.sun_path[0] == '@')
if (!spawnDaemonPath ||
retries == 0 ||
(errno != ENOENT && errno != ECONNREFUSED)) {
- virReportSystemError(errno, _("Failed to connect socket to '%s'"),
+ virReportSystemError(errno, _("Failed to connect socket to '%1$s'"),
path);
goto cleanup;
}
verify = VIR_NET_SSH_HOSTKEY_VERIFY_NORMAL;
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid host key verification method: '%s'"),
+ _("Invalid host key verification method: '%1$s'"),
knownHostsVerify);
goto error;
}
ret = virNetSSHSessionAuthAddAgentAuth(sess);
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid authentication method: '%s'"),
+ _("Invalid authentication method: '%1$s'"),
authMethod);
ret = -1;
goto error;
verify = VIR_NET_LIBSSH_HOSTKEY_VERIFY_NORMAL;
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid host key verification method: '%s'"),
+ _("Invalid host key verification method: '%1$s'"),
knownHostsVerify);
goto error;
}
ret = virNetLibsshSessionAuthAddAgentAuth(sess);
} else {
virReportError(VIR_ERR_INVALID_ARG,
- _("Invalid authentication method: '%s'"),
+ _("Invalid authentication method: '%1$s'"),
authMethod);
ret = -1;
goto error;
if (virSetInherit(sock->fd, true) < 0) {
virReportSystemError(errno,
- _("Cannot disable close-on-exec flag on socket %d"),
+ _("Cannot disable close-on-exec flag on socket %1$d"),
sock->fd);
goto error;
}
if (sock->errfd != -1 &&
virSetInherit(sock->errfd, true) < 0) {
virReportSystemError(errno,
- _("Cannot disable close-on-exec flag on pipe %d"),
+ _("Cannot disable close-on-exec flag on pipe %1$d"),
sock->errfd);
goto error;
}
if (ret < 0) {
if (errout)
virReportSystemError(errno,
- _("Cannot recv data: %s"), errout);
+ _("Cannot recv data: %1$s"), errout);
else
virReportSystemError(errno, "%s",
_("Cannot recv data"));
} else {
if (errout)
virReportSystemError(EIO,
- _("End of file while reading data: %s"),
+ _("End of file while reading data: %1$s"),
errout);
else
virReportSystemError(EIO, "%s",
ret = 0;
else
virReportSystemError(errno,
- _("Failed to send file descriptor %d"),
+ _("Failed to send file descriptor %1$d"),
fd);
goto cleanup;
}
if (!key) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("Failed to retrieve ssh host key: %s"),
+ _("Failed to retrieve ssh host key: %1$s"),
errmsg);
return -1;
}
keyhashstr = virBufferContentAndReset(&buff);
askKey.type = VIR_CRED_ECHOPROMPT;
- askKey.prompt = g_strdup_printf(_("Accept SSH host key with hash '%s' for " "host '%s:%d' (%s/%s)?"),
+ askKey.prompt = g_strdup_printf(_("Accept SSH host key with hash '%1$s' for host '%2$s:%3$d' (%4$s/%5$s)?"),
keyhashstr, sess->hostname, sess->port, "y", "n");
if (sess->cred->cb(&askKey, 1, sess->cred->cbdata)) {
if (!askKey.result ||
STRCASENEQ(askKey.result, "y")) {
virReportError(VIR_ERR_SSH,
- _("SSH host key for '%s' (%s) was not accepted"),
+ _("SSH host key for '%1$s' (%2$s) was not accepted"),
sess->hostname, keyhashstr);
VIR_FREE(keyhashstr);
VIR_FREE(askKey.result);
NULL) < 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("unable to add SSH host key for host '%s': %s"),
+ _("unable to add SSH host key for host '%1$s': %2$s"),
hostnameStr, errmsg);
VIR_FREE(hostnameStr);
return -1;
LIBSSH2_KNOWNHOST_FILE_OPENSSH) < 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("failed to write known_host file '%s': %s"),
+ _("failed to write known_host file '%1$s': %2$s"),
sess->knownHostsFile,
errmsg);
return -1;
case LIBSSH2_KNOWNHOST_CHECK_MISMATCH:
/* host key verification failed */
virReportError(VIR_ERR_AUTH_FAILED,
- _("!!! SSH HOST KEY VERIFICATION FAILED !!!: "
- "Identity of host '%s:%d' differs from stored identity. "
- "Please verify the new host key '%s' to avoid possible "
- "man in the middle attack. The key is stored in '%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;
case LIBSSH2_KNOWNHOST_CHECK_FAILURE:
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("failed to validate SSH host key: %s"),
+ _("failed to validate SSH host key: %1$s"),
errmsg);
return -1;
VIR_WARNINGS_RESET
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("failed to authenticate using SSH agent: %s"),
+ _("failed to authenticate using SSH agent: %1$s"),
errmsg);
return -1;
}
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("failed to authenticate using SSH agent: %s"),
+ _("failed to authenticate using SSH agent: %1$s"),
errmsg);
return -1;
}
VIR_WARNINGS_RESET
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("authentication with private key '%s' "
- "has failed: %s"),
+ _("authentication with private key '%1$s' has failed: %2$s"),
priv->filename, errmsg);
return 1; /* auth failed */
}
return -1;
}
- retr_passphrase.prompt = g_strdup_printf(_("Passphrase for key '%s'"),
+ retr_passphrase.prompt = g_strdup_printf(_("Passphrase for key '%1$s'"),
priv->filename);
if (sess->cred->cb(&retr_passphrase, 1, sess->cred->cbdata)) {
if (ret < 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("authentication with private key '%s' "
- "has failed: %s"),
+ _("authentication with private key '%1$s' has failed: %2$s"),
priv->filename, errmsg);
VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR
/* error path */
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("authentication failed: %s"), errmsg);
+ _("authentication failed: %1$s"), errmsg);
/* determine exist status */
if (rc == LIBSSH2_ERROR_AUTHENTICATION_FAILED)
if (ret < 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("keyboard interactive authentication failed: %s"),
+ _("keyboard interactive authentication failed: %1$s"),
errmsg);
return -1;
}
}
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_AUTH_FAILED,
- _("keyboard interactive authentication failed: %s"),
+ _("keyboard interactive authentication failed: %1$s"),
errmsg);
return 1;
}
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("couldn't retrieve authentication methods list: %s"),
+ _("couldn't retrieve authentication methods list: %1$s"),
errmsg);
return -1;
}
if (!sess->channel) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("failed to open ssh channel: %s"),
+ _("failed to open ssh channel: %1$s"),
errmsg);
return -1;
}
if (libssh2_channel_exec(sess->channel, sess->channelCommand) != 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("failed to execute command '%s': %s"),
+ _("failed to execute command '%1$s': %2$s"),
sess->channelCommand,
errmsg);
return -1;
LIBSSH2_KNOWNHOST_FILE_OPENSSH) < 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("unable to load knownhosts file '%s': %s"),
+ _("unable to load knownhosts file '%1$s': %2$s"),
hostsfile, errmsg);
goto error;
}
} else if (!(flags & VIR_NET_SSH_HOSTKEY_FILE_CREATE)) {
virReportError(VIR_ERR_SSH,
- _("known hosts file '%s' does not exist"),
+ _("known hosts file '%1$s' does not exist"),
hostsfile);
goto error;
}
if (ret < 0) {
libssh2_session_last_error(sess->session, &errmsg, NULL, 0);
virReportError(VIR_ERR_NO_CONNECT,
- _("SSH session handshake failed: %s"),
+ _("SSH session handshake failed: %1$s"),
errmsg);
goto error;
}
if (sess->state != VIR_NET_SSH_STATE_HANDSHAKE_COMPLETE) {
if (sess->state == VIR_NET_SSH_STATE_ERROR_REMOTE)
virReportError(VIR_ERR_SSH,
- _("Remote program terminated "
- "with non-zero code: %d"),
+ _("Remote program terminated with non-zero code: %1$d"),
sess->channelCommandReturnValue);
else
virReportError(VIR_ERR_SSH, "%s",
if (libssh2_channel_eof(sess->channel)) {
if (libssh2_channel_get_exit_status(sess->channel)) {
virReportError(VIR_ERR_SSH,
- _("Remote command terminated with non-zero code: %d"),
+ _("Remote command terminated with non-zero code: %1$d"),
libssh2_channel_get_exit_status(sess->channel));
sess->channelCommandReturnValue = libssh2_channel_get_exit_status(sess->channel);
sess->state = VIR_NET_SSH_STATE_ERROR_REMOTE;
if (sess->state != VIR_NET_SSH_STATE_HANDSHAKE_COMPLETE) {
if (sess->state == VIR_NET_SSH_STATE_ERROR_REMOTE)
virReportError(VIR_ERR_SSH,
- _("Remote program terminated with non-zero code: %d"),
+ _("Remote program terminated with non-zero code: %1$d"),
sess->channelCommandReturnValue);
else
virReportError(VIR_ERR_SSH, "%s",
if (libssh2_channel_eof(sess->channel)) {
if (libssh2_channel_get_exit_status(sess->channel)) {
virReportError(VIR_ERR_SSH,
- _("Remote program terminated with non-zero code: %d"),
+ _("Remote program terminated with non-zero code: %1$d"),
libssh2_channel_get_exit_status(sess->channel));
sess->state = VIR_NET_SSH_STATE_ERROR_REMOTE;
sess->channelCommandReturnValue = libssh2_channel_get_exit_status(sess->channel);
sess->state = VIR_NET_SSH_STATE_ERROR;
libssh2_session_last_error(sess->session, &msg, NULL, 0);
virReportError(VIR_ERR_SSH,
- _("write failed: %s"), msg);
+ _("write failed: %1$s"), msg);
}
cleanup:
return 1;
virReportSystemError(errno,
- _("Cannot read %s '%s'"),
+ _("Cannot read %1$s '%2$s'"),
type, file);
return -1;
}
if (gnutls_x509_crt_get_expiration_time(cert) < now) {
virReportError(VIR_ERR_SYSTEM_ERROR,
(isCA ?
- _("The CA certificate %s has expired") :
+ _("The CA certificate %1$s has expired") :
(isServer ?
- _("The server certificate %s has expired") :
- _("The client certificate %s has expired"))),
+ _("The server certificate %1$s has expired") :
+ _("The client certificate %1$s has expired"))),
certFile);
return -1;
}
if (gnutls_x509_crt_get_activation_time(cert) > now) {
virReportError(VIR_ERR_SYSTEM_ERROR,
(isCA ?
- _("The CA certificate %s is not yet active") :
+ _("The CA certificate %1$s is not yet active") :
(isServer ?
- _("The server certificate %s is not yet active") :
- _("The client certificate %s is not yet active"))),
+ _("The server certificate %1$s is not yet active") :
+ _("The client certificate %1$s is not yet active"))),
certFile);
return -1;
}
if (status > 0) { /* It is a CA cert */
if (!isCA) {
virReportError(VIR_ERR_SYSTEM_ERROR, isServer ?
- _("The certificate %s basic constraints show a CA, but we need one for a server") :
- _("The certificate %s basic constraints show a CA, but we need one for a client"),
+ _("The certificate %1$s basic constraints show a CA, but we need one for a server") :
+ _("The certificate %1$s basic constraints show a CA, but we need one for a client"),
certFile);
return -1;
}
} else if (status == 0) { /* It is not a CA cert */
if (isCA) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("The certificate %s basic constraints do not show a CA"),
+ _("The certificate %1$s basic constraints do not show a CA"),
certFile);
return -1;
}
} else if (status == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { /* Missing basicConstraints */
if (isCA) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("The certificate %s is missing basic constraints for a CA"),
+ _("The certificate %1$s is missing basic constraints for a CA"),
certFile);
return -1;
}
} else { /* General error */
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to query certificate %s basic constraints %s"),
+ _("Unable to query certificate %1$s basic constraints %2$s"),
certFile, gnutls_strerror(status));
return -1;
}
GNUTLS_KEY_DIGITAL_SIGNATURE|GNUTLS_KEY_KEY_ENCIPHERMENT;
} else {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to query certificate %s key usage %s"),
+ _("Unable to query certificate %1$s key usage %2$s"),
certFile, gnutls_strerror(status));
return -1;
}
if (!(usage & GNUTLS_KEY_KEY_CERT_SIGN)) {
if (critical) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Certificate %s usage does not permit certificate signing"),
+ _("Certificate %1$s usage does not permit certificate signing"),
certFile);
return -1;
} else {
if (!(usage & GNUTLS_KEY_DIGITAL_SIGNATURE)) {
if (critical) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Certificate %s usage does not permit digital signature"),
+ _("Certificate %1$s usage does not permit digital signature"),
certFile);
return -1;
} else {
if (!(usage & GNUTLS_KEY_KEY_ENCIPHERMENT)) {
if (critical) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Certificate %s usage does not permit key encipherment"),
+ _("Certificate %1$s usage does not permit key encipherment"),
certFile);
return -1;
} else {
}
if (status != GNUTLS_E_SHORT_MEMORY_BUFFER) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to query certificate %s key purpose %s"),
+ _("Unable to query certificate %1$s key purpose %2$s"),
certFile, gnutls_strerror(status));
return -1;
}
if (status < 0) {
VIR_FREE(buffer);
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to query certificate %s key purpose %s"),
+ _("Unable to query certificate %1$s key purpose %2$s"),
certFile, gnutls_strerror(status));
return -1;
}
if (!allowServer) {
if (critical) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Certificate %s purpose does not allow use for with a TLS server"),
+ _("Certificate %1$s purpose does not allow use for with a TLS server"),
certFile);
return -1;
} else {
if (!allowClient) {
if (critical) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Certificate %s purpose does not allow use for with a TLS client"),
+ _("Certificate %1$s purpose does not allow use for with a TLS client"),
certFile);
return -1;
} else {
if (hostname &&
!gnutls_x509_crt_check_hostname(cert, hostname)) {
virReportError(VIR_ERR_RPC,
- _("Certificate %s owner does not match the hostname %s"),
+ _("Certificate %1$s owner does not match the hostname %2$s"),
certFile, hostname);
return -1;
}
NULL, 0,
0, &status) < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR, isServer ?
- _("Unable to verify server certificate %s against CA certificate %s") :
- _("Unable to verify client certificate %s against CA certificate %s"),
+ _("Unable to verify server certificate %1$s against CA certificate %2$s") :
+ _("Unable to verify client certificate %1$s against CA certificate %2$s"),
certFile, cacertFile);
return -1;
}
reason = _("The certificate uses an insecure algorithm");
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Our own certificate %s failed validation against %s: %s"),
+ _("Our own certificate %1$s failed validation against %2$s: %3$s"),
certFile, cacertFile, reason);
return -1;
}
if (gnutls_x509_crt_import(cert, &data, GNUTLS_X509_FMT_PEM) < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR, isServer ?
- _("Unable to import server certificate %s") :
- _("Unable to import client certificate %s"),
+ _("Unable to import server certificate %1$s") :
+ _("Unable to import client certificate %1$s"),
certFile);
goto cleanup;
}
if (gnutls_x509_crt_list_import(certs, &certMax, &data, GNUTLS_X509_FMT_PEM, 0) < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to import CA certificate list %s"),
+ _("Unable to import CA certificate list %1$s"),
certFile);
return -1;
}
GNUTLS_X509_FMT_PEM);
if (err < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to set x509 CA certificate: %s: %s"),
+ _("Unable to set x509 CA certificate: %1$s: %2$s"),
cacert, gnutls_strerror(err));
return -1;
}
GNUTLS_X509_FMT_PEM);
if (err < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to set x509 certificate revocation list: %s: %s"),
+ _("Unable to set x509 certificate revocation list: %1$s: %2$s"),
cacrl, gnutls_strerror(err));
return -1;
}
GNUTLS_X509_FMT_PEM);
if (err < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to set x509 key and certificate: %s, %s: %s"),
+ _("Unable to set x509 key and certificate: %1$s, %2$s: %3$s"),
key, cert, gnutls_strerror(err));
return -1;
}
ctxt->x509cred = NULL;
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to allocate x509 credentials: %s"),
+ _("Unable to allocate x509 credentials: %1$s"),
gnutls_strerror(err));
goto error;
}
err = gnutls_certificate_allocate_credentials(&ctxt->x509cred);
if (err) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to allocate x509 credentials: %s"),
+ _("Unable to allocate x509 credentials: %1$s"),
gnutls_strerror(err));
goto error;
}
if ((ret = gnutls_certificate_verify_peers2(sess->session, &status)) < 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Unable to verify TLS peer: %s"),
+ _("Unable to verify TLS peer: %1$s"),
gnutls_strerror(ret));
goto authdeny;
}
reason = _("The certificate uses an insecure algorithm");
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Certificate failed validation: %s"),
+ _("Certificate failed validation: %1$s"),
reason);
goto authdeny;
}
}
if (ret != 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Failed to get certificate %s distinguished name: %s"),
+ _("Failed to get certificate %1$s distinguished name: %2$s"),
"[session]", gnutls_strerror(ret));
goto authfail;
}
if ((err = gnutls_init(&sess->session,
ctxt->isServer ? GNUTLS_SERVER : GNUTLS_CLIENT)) != 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Failed to initialize TLS session: %s"),
+ _("Failed to initialize TLS session: %1$s"),
gnutls_strerror(err));
goto error;
}
priority,
NULL)) != 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Failed to set TLS session priority to %s: %s"),
+ _("Failed to set TLS session priority to %1$s: %2$s"),
priority, gnutls_strerror(err));
goto error;
}
GNUTLS_CRD_CERTIFICATE,
ctxt->x509cred)) != 0) {
virReportError(VIR_ERR_SYSTEM_ERROR,
- _("Failed set TLS x509 credentials: %s"),
+ _("Failed set TLS x509 credentials: %1$s"),
gnutls_strerror(err));
goto error;
}
#endif
virReportError(VIR_ERR_AUTH_FAILED,
- _("TLS handshake failed %s"),
+ _("TLS handshake failed %1$s"),
gnutls_strerror(ret));
ret = -1;