diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-05 14:57:13 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-11-05 14:57:13 +0100 |
| commit | 14f1f19dab3f41b5bcaeb40f63964c57eb1e25f2 (patch) | |
| tree | 0bc8c1973d6d58bc8e14676cca108d50254aa6e1 /src | |
| parent | 6b4703f21deb0f140dbbeca682823f2b644a4e78 (diff) | |
Step 2 of the WANT_RESTRICT_FULLSCRAPE feature (fixing a bug along the way)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ot_config.c | 2 | ||||
| -rw-r--r-- | src/ot_http.c | 7 | ||||
| -rw-r--r-- | src/ot_stats.c | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/ot_config.c b/src/ot_config.c index dfaef0d..9c5e8f0 100644 --- a/src/ot_config.c +++ b/src/ot_config.c | |||
| @@ -276,7 +276,7 @@ static int parse_configfile(char *config_filename) { | |||
| 276 | FILE *config_file_handle; | 276 | FILE *config_file_handle; |
| 277 | char inbuf[512]; | 277 | char inbuf[512]; |
| 278 | ot_ip6 tmpip; | 278 | ot_ip6 tmpip; |
| 279 | #if defined(WANT_RESTRICT_STATS) || defined(WANT_IP_FROM_PROXY) || defined(WANT_SYNC_LIVE) | 279 | #if defined(WANT_RESTRICT_STATS) || defined(WANT_RESTRICT_FULLSCRAPE) || defined(WANT_IP_FROM_PROXY) || defined(WANT_SYNC_LIVE) |
| 280 | ot_net tmpnet; | 280 | ot_net tmpnet; |
| 281 | #endif | 281 | #endif |
| 282 | int bound = 0; | 282 | int bound = 0; |
diff --git a/src/ot_http.c b/src/ot_http.c index d2dad67..cc11366 100644 --- a/src/ot_http.c +++ b/src/ot_http.c | |||
| @@ -342,6 +342,10 @@ static ssize_t http_handle_stats(const int64_t sock, struct ot_workstruct *ws, c | |||
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | if (mode == TASK_STATS_TPB) { | 344 | if (mode == TASK_STATS_TPB) { |
| 345 | #ifdef WANT_RESTRICT_FULLSCRAPE | ||
| 346 | if (!accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_FULLSCRAPE)) | ||
| 347 | HTTPERROR_403_IP; | ||
| 348 | #endif | ||
| 345 | #ifdef WANT_COMPRESSION_GZIP | 349 | #ifdef WANT_COMPRESSION_GZIP |
| 346 | ws->request[ws->request_size - 1] = 0; | 350 | ws->request[ws->request_size - 1] = 0; |
| 347 | #ifndef WANT_COMPRESSION_GZIP_ALWAYS | 351 | #ifndef WANT_COMPRESSION_GZIP_ALWAYS |
| @@ -402,6 +406,9 @@ static ssize_t http_handle_fullscrape(const int64_t sock, struct ot_workstruct * | |||
| 402 | struct http_data *cookie = fdstate_cookie(sock); | 406 | struct http_data *cookie = fdstate_cookie(sock); |
| 403 | int format = 0; | 407 | int format = 0; |
| 404 | 408 | ||
| 409 | if (!cookie) | ||
| 410 | HTTPERROR_500; | ||
| 411 | |||
| 405 | #ifdef WANT_RESTRICT_FULLSCRAPE | 412 | #ifdef WANT_RESTRICT_FULLSCRAPE |
| 406 | if (!accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_FULLSCRAPE)) | 413 | if (!accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_FULLSCRAPE)) |
| 407 | HTTPERROR_403_IP; | 414 | HTTPERROR_403_IP; |
diff --git a/src/ot_stats.c b/src/ot_stats.c index 7b5b1b9..d395275 100644 --- a/src/ot_stats.c +++ b/src/ot_stats.c | |||
| @@ -588,6 +588,9 @@ static const char *const build_features[] = { | |||
| 588 | #ifdef WANT_RESTRICT_STATS | 588 | #ifdef WANT_RESTRICT_STATS |
| 589 | "WANT_RESTRICT_STATS", | 589 | "WANT_RESTRICT_STATS", |
| 590 | #endif | 590 | #endif |
| 591 | #ifdef WANT_RESTRICT_FULLSCRAPE | ||
| 592 | "WANT_RESTRICT_FULLSCRAPE", | ||
| 593 | #endif | ||
| 591 | #ifdef WANT_LOG_NUMWANT | 594 | #ifdef WANT_LOG_NUMWANT |
| 592 | "WANT_LOG_NUMWANT", | 595 | "WANT_LOG_NUMWANT", |
| 593 | #endif | 596 | #endif |
