Skip to content

Commit c719f22

Browse files
mujacicaclaude
andcommitted
style: apply clang-format and add changelog entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 055db69 commit c719f22

3 files changed

Lines changed: 19 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Fixes**:
6+
7+
- Propagate transport options (`ca_certs`, `proxy`, `user_agent`) and `handler_path` to the native backend crash daemon. Previously, the daemon did not receive SSL certificate or proxy settings from the parent process, causing SSL errors (curl code 60) when uploading crash reports. The daemon also ignored the user-configured handler path, requiring the `sentry-crash` binary to be placed next to the application executable. ([#1573](https://github.com/getsentry/sentry-native/pull/1573))
8+
39
## 0.13.2
410

511
**Features**:

src/backends/sentry_backend_native.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ native_backend_startup(
209209
strncpy_s(
210210
ctx->ca_certs, sizeof(ctx->ca_certs), options->ca_certs, _TRUNCATE);
211211
#else
212-
strncpy(
213-
ctx->ca_certs, options->ca_certs, sizeof(ctx->ca_certs) - 1);
212+
strncpy(ctx->ca_certs, options->ca_certs, sizeof(ctx->ca_certs) - 1);
214213
ctx->ca_certs[sizeof(ctx->ca_certs) - 1] = '\0';
215214
#endif
216215
}
@@ -226,11 +225,11 @@ native_backend_startup(
226225

227226
if (options->user_agent) {
228227
#ifdef _WIN32
229-
strncpy_s(ctx->user_agent, sizeof(ctx->user_agent),
230-
options->user_agent, _TRUNCATE);
228+
strncpy_s(ctx->user_agent, sizeof(ctx->user_agent), options->user_agent,
229+
_TRUNCATE);
231230
#else
232-
strncpy(ctx->user_agent, options->user_agent,
233-
sizeof(ctx->user_agent) - 1);
231+
strncpy(
232+
ctx->user_agent, options->user_agent, sizeof(ctx->user_agent) - 1);
234233
ctx->user_agent[sizeof(ctx->user_agent) - 1] = '\0';
235234
#endif
236235
}
@@ -340,9 +339,9 @@ native_backend_startup(
340339
state->ipc->notify_fd, state->ipc->ready_fd, daemon_handler_path);
341340
# elif defined(SENTRY_PLATFORM_MACOS)
342341
uint64_t tid = (uint64_t)pthread_self();
343-
state->daemon_pid = sentry__crash_daemon_start(getpid(), tid,
344-
state->ipc->notify_pipe[0], state->ipc->ready_pipe[1],
345-
daemon_handler_path);
342+
state->daemon_pid
343+
= sentry__crash_daemon_start(getpid(), tid, state->ipc->notify_pipe[0],
344+
state->ipc->ready_pipe[1], daemon_handler_path);
346345
# elif defined(SENTRY_PLATFORM_WINDOWS)
347346
uint64_t tid = (uint64_t)GetCurrentThreadId();
348347
state->daemon_pid = sentry__crash_daemon_start(GetCurrentProcessId(), tid,

tests/unit/test_native_backend.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* and low-level crash handling functionality.
66
*/
77

8-
#include "sentry_testsupport.h"
98
#include "sentry_options.h"
9+
#include "sentry_testsupport.h"
1010
#include <string.h>
1111

1212
#ifdef SENTRY_BACKEND_NATIVE
@@ -400,17 +400,16 @@ SENTRY_TEST(crash_context_options_propagation)
400400
memset(&ctx, 0, sizeof(ctx));
401401

402402
if (options->ca_certs) {
403-
strncpy(
404-
ctx.ca_certs, options->ca_certs, sizeof(ctx.ca_certs) - 1);
403+
strncpy(ctx.ca_certs, options->ca_certs, sizeof(ctx.ca_certs) - 1);
405404
ctx.ca_certs[sizeof(ctx.ca_certs) - 1] = '\0';
406405
}
407406
if (options->proxy) {
408407
strncpy(ctx.proxy, options->proxy, sizeof(ctx.proxy) - 1);
409408
ctx.proxy[sizeof(ctx.proxy) - 1] = '\0';
410409
}
411410
if (options->user_agent) {
412-
strncpy(ctx.user_agent, options->user_agent,
413-
sizeof(ctx.user_agent) - 1);
411+
strncpy(
412+
ctx.user_agent, options->user_agent, sizeof(ctx.user_agent) - 1);
414413
ctx.user_agent[sizeof(ctx.user_agent) - 1] = '\0';
415414
}
416415

@@ -480,8 +479,7 @@ SENTRY_TEST(crash_context_null_options)
480479

481480
// Copy like native_backend_startup does (with NULL checks)
482481
if (options->ca_certs) {
483-
strncpy(
484-
ctx.ca_certs, options->ca_certs, sizeof(ctx.ca_certs) - 1);
482+
strncpy(ctx.ca_certs, options->ca_certs, sizeof(ctx.ca_certs) - 1);
485483
}
486484
if (options->proxy) {
487485
strncpy(ctx.proxy, options->proxy, sizeof(ctx.proxy) - 1);

0 commit comments

Comments
 (0)