v0.1.20 - Removed @ prefix from all user-facing socket name output (startup message, list command, error messages, connection display)
This commit is contained in:
@@ -487,7 +487,7 @@ int main(int argc, char **argv) {
|
||||
} else if (socket_name) {
|
||||
transport = nsigner_transport_open_unix(socket_name, timeout_ms);
|
||||
if (!transport) {
|
||||
fprintf(stderr, "error: cannot open unix transport @%s\n", socket_name);
|
||||
fprintf(stderr, "error: cannot open unix transport %s\n", socket_name);
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
@@ -508,7 +508,7 @@ int main(int argc, char **argv) {
|
||||
socket_name = names[0];
|
||||
transport = nsigner_transport_open_unix(socket_name, timeout_ms);
|
||||
if (!transport) {
|
||||
fprintf(stderr, "error: cannot open unix transport @%s\n", socket_name);
|
||||
fprintf(stderr, "error: cannot open unix transport %s\n", socket_name);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -813,8 +813,8 @@ int socket_name_random(char *out, size_t out_len);
|
||||
/* Version information (auto-updated by build/version tooling) */
|
||||
#define NSIGNER_VERSION_MAJOR 0
|
||||
#define NSIGNER_VERSION_MINOR 1
|
||||
#define NSIGNER_VERSION_PATCH 19
|
||||
#define NSIGNER_VERSION "v0.1.19"
|
||||
#define NSIGNER_VERSION_PATCH 20
|
||||
#define NSIGNER_VERSION "v0.1.20"
|
||||
|
||||
|
||||
/* NSIGNER_HEADERLESS_DECLS_END */
|
||||
@@ -1440,9 +1440,9 @@ static int list_sockets_main(void) {
|
||||
}
|
||||
|
||||
while (fgets(line, sizeof(line), fp) != NULL) {
|
||||
char name_with_at[SERVER_SOCKET_NAME_MAX + 1];
|
||||
if (extract_nsigner_socket_from_proc_line(line, name_with_at, sizeof(name_with_at), NULL, 0) == 0) {
|
||||
printf("%s\n", name_with_at);
|
||||
char name_no_at[SERVER_SOCKET_NAME_MAX + 1];
|
||||
if (extract_nsigner_socket_from_proc_line(line, NULL, 0, name_no_at, sizeof(name_no_at)) == 0) {
|
||||
printf("%s\n", name_no_at);
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
@@ -1527,7 +1527,7 @@ static int client_main(int argc, char *argv[], const char *socket_name, int sock
|
||||
|
||||
fd = connect_abstract_socket(socket_name);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Failed to connect to @%s: %s\n", socket_name, strerror(errno));
|
||||
fprintf(stderr, "Failed to connect to %s: %s\n", socket_name, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1620,7 +1620,7 @@ static int bridge_main(int argc, char *argv[], const char *socket_name, int sock
|
||||
/* Connect to the persistent signer's abstract unix socket */
|
||||
fd = connect_abstract_socket(target_socket);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "bridge: cannot connect to @%s: %s\n", target_socket, strerror(errno));
|
||||
fprintf(stderr, "bridge: cannot connect to %s: %s\n", target_socket, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4006,7 +4006,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
if (server_start(&server) != 0) {
|
||||
if (listen_mode == NSIGNER_LISTEN_UNIX) {
|
||||
fprintf(stderr, "Failed to start server on @%s: %s\n", socket_name, server_last_error(&server));
|
||||
fprintf(stderr, "Failed to start server on %s: %s\n", socket_name, server_last_error(&server));
|
||||
} else if (listen_mode == NSIGNER_LISTEN_TCP ||
|
||||
listen_mode == NSIGNER_LISTEN_HTTP) {
|
||||
fprintf(stderr, "Failed to start server on %s: %s\n", listen_target, server_last_error(&server));
|
||||
@@ -4110,7 +4110,7 @@ int main(int argc, char *argv[]) {
|
||||
char unix_conn[128];
|
||||
char unix_example[256];
|
||||
char unix_extra[256] = "";
|
||||
snprintf(unix_conn, sizeof(unix_conn), "@%s", socket_name);
|
||||
snprintf(unix_conn, sizeof(unix_conn), "%s", socket_name);
|
||||
snprintf(unix_example, sizeof(unix_example),
|
||||
"nsigner --socket-name %s client '<json>'", socket_name);
|
||||
if (transport_mask & TRANSPORT_QREXEC_BRIDGE) {
|
||||
@@ -4121,7 +4121,7 @@ int main(int argc, char *argv[]) {
|
||||
printf("qrexec service: %s\n", NSIGNER_QREXEC_SERVICE_NAME);
|
||||
}
|
||||
connection_info_add_transport("Unix socket", unix_conn, unix_example, unix_extra);
|
||||
printf("System is ready and waiting for connections on @%s.\n", socket_name);
|
||||
printf("System is ready and waiting for connections on %s.\n", socket_name);
|
||||
}
|
||||
if (transport_mask & TRANSPORT_TCP) {
|
||||
const char *tcp_addr = servers[tcp_server_idx].socket_name;
|
||||
@@ -4161,7 +4161,7 @@ int main(int argc, char *argv[]) {
|
||||
char unix_conn[128];
|
||||
char unix_example[256];
|
||||
char unix_extra[256] = "";
|
||||
snprintf(unix_conn, sizeof(unix_conn), "@%s", socket_name);
|
||||
snprintf(unix_conn, sizeof(unix_conn), "%s", socket_name);
|
||||
snprintf(unix_example, sizeof(unix_example),
|
||||
"nsigner --socket-name %s client '<json>'", socket_name);
|
||||
if (bridge_source_trusted) {
|
||||
@@ -4172,7 +4172,7 @@ int main(int argc, char *argv[]) {
|
||||
printf("qrexec service: %s\n", NSIGNER_QREXEC_SERVICE_NAME);
|
||||
}
|
||||
connection_info_add_transport("Unix socket", unix_conn, unix_example, unix_extra);
|
||||
printf("System is ready and waiting for connections on @%s.\n", socket_name);
|
||||
printf("System is ready and waiting for connections on %s.\n", socket_name);
|
||||
} else if (listen_mode == NSIGNER_LISTEN_TCP) {
|
||||
const char *actual_addr = server.socket_name;
|
||||
char fips_conn[256] = "";
|
||||
|
||||
+3
-3
@@ -2000,7 +2000,7 @@ int server_start(server_ctx_t *ctx) {
|
||||
}
|
||||
(void)snprintf(ctx->last_error,
|
||||
sizeof(ctx->last_error),
|
||||
"bind(@%s) failed: %s (and failed to generate retry socket name)",
|
||||
"bind(%s) failed: %s (and failed to generate retry socket name)",
|
||||
ctx->socket_name,
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
@@ -2010,13 +2010,13 @@ int server_start(server_ctx_t *ctx) {
|
||||
if (errno == EADDRINUSE && ctx->socket_name_explicit) {
|
||||
(void)snprintf(ctx->last_error,
|
||||
sizeof(ctx->last_error),
|
||||
"bind(@%s) failed: %s (explicit --socket-name is already in use)",
|
||||
"bind(%s) failed: %s (explicit --socket-name is already in use)",
|
||||
ctx->socket_name,
|
||||
strerror(errno));
|
||||
} else {
|
||||
(void)snprintf(ctx->last_error,
|
||||
sizeof(ctx->last_error),
|
||||
"bind(@%s) failed: %s",
|
||||
"bind(%s) failed: %s",
|
||||
ctx->socket_name,
|
||||
strerror(errno));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user