From ef669fe6f4f449b0356bf33d820a9b7690683b4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 17:44:09 +0000 Subject: [PATCH 1/3] Update dependency curl/curl to v8_15_0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 145f5ec..4b35769 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ BINSYMDIR=$(PREFIX)/local/bin/ CRITERION_VERSION=2.4.2 SHUNIT_VERSION=2.1.8 -CURL_VERSION_TAG=8_12_1 +CURL_VERSION_TAG=8_15_0 CURL_VERSION=$(shell echo $(CURL_VERSION_TAG) | sed -e 's/_/./g') OPENSSL_VERSION=3.5.2 ZLIB_VERSION=1.3.1 From abeea84b7556f32398c28fcd41b475e9443c3361 Mon Sep 17 00:00:00 2001 From: pyama Date: Fri, 24 Oct 2025 13:05:59 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3(stns.c,=20stns.h):=20cur?= =?UTF-8?q?l=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AE?= =?UTF-8?q?=E5=9E=8B=E3=82=92int=E3=81=8B=E3=82=89long=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 理由: curl_easy_setoptの引数としてlong型が必要なため、型を修正して 警告を防止し、コードの安定性を向上させるため。 --- stns.c | 10 +++++----- stns.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stns.c b/stns.c index b3f0e19..b77ed14 100644 --- a/stns.c +++ b/stns.c @@ -314,8 +314,8 @@ static CURLcode inner_http_request(stns_conf_t *c, char *path, stns_response_t * } } curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, c->ssl_verify); - curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, c->ssl_verify); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)c->ssl_verify); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long)c->ssl_verify); curl_easy_setopt(curl, CURLOPT_USERAGENT, STNS_VERSION_WITH_NAME); if (c->http_location == 1) { curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); @@ -347,13 +347,13 @@ static CURLcode inner_http_request(stns_conf_t *c, char *path, stns_response_t * "http://unix", path); } curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); - curl_easy_setopt(curl, CURLOPT_TIMEOUT, c->request_timeout); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)c->request_timeout); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, response_callback); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, res); curl_easy_setopt(curl, CURLOPT_HEADERDATA, c); - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); #ifdef DEBUG syslog(LOG_ERR, "%s(stns)[L%d] before request http request: %s", __func__, __LINE__, url); diff --git a/stns.h b/stns.h index bdc7a33..4a5f83f 100644 --- a/stns.h +++ b/stns.h @@ -58,7 +58,7 @@ struct stns_conf_t { char *query_wrapper; char *chain_ssh_wrapper; char *http_proxy; - int http_location; + long http_location; char *cache_dir; char *tls_cert; char *tls_key; @@ -68,9 +68,9 @@ struct stns_conf_t { stns_user_httpheaders_t *http_headers; int uid_shift; int gid_shift; - int ssl_verify; + long ssl_verify; int use_cached; - int request_timeout; + long request_timeout; int request_retry; int request_locktime; int cache; From 478550eb919762d5abf80cea00d4a3a133322502 Mon Sep 17 00:00:00 2001 From: pyama Date: Fri, 24 Oct 2025 13:58:26 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3(stns.c):=20long=E5=9E=8B?= =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=BC=E3=83=AB=E3=83=89=E3=81=AE=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=81=BF=E3=82=92=E4=B8=80=E6=99=82=E7=9A=84?= =?UTF-8?q?=E3=81=AAint=E5=A4=89=E6=95=B0=E3=82=92=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stns.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/stns.c b/stns.c index b77ed14..cff60cd 100644 --- a/stns.c +++ b/stns.c @@ -99,12 +99,36 @@ int stns_load_config(char *filename, stns_conf_t *c) GET_TOML_BYKEY(gid_shift, toml_rtoi, 0, TOML_NULL_OR_INT); GET_TOML_BYKEY(cache_ttl, toml_rtoi, 600, TOML_NULL_OR_INT); GET_TOML_BYKEY(negative_cache_ttl, toml_rtoi, 10, TOML_NULL_OR_INT); - GET_TOML_BYKEY(ssl_verify, toml_rtob, 1, TOML_NULL_OR_INT); + + // Load long type fields via temporary int variables + int tmp_ssl_verify = 1; + int tmp_request_timeout = 10; + int tmp_http_location = 0; + + if (0 != (raw = toml_raw_in(tab, "ssl_verify"))) { + if (0 != toml_rtob(raw, &tmp_ssl_verify)) { + syslog(LOG_ERR, "%s(stns)[L%d] cannot parse toml file:%s key:ssl_verify", __func__, __LINE__, filename); + } + } + c->ssl_verify = (long)tmp_ssl_verify; + + if (0 != (raw = toml_raw_in(tab, "request_timeout"))) { + if (0 != toml_rtoi(raw, &tmp_request_timeout)) { + syslog(LOG_ERR, "%s(stns)[L%d] cannot parse toml file:%s key:request_timeout", __func__, __LINE__, filename); + } + } + c->request_timeout = (long)tmp_request_timeout; + + if (0 != (raw = toml_raw_in(tab, "http_location"))) { + if (0 != toml_rtob(raw, &tmp_http_location)) { + syslog(LOG_ERR, "%s(stns)[L%d] cannot parse toml file:%s key:http_location", __func__, __LINE__, filename); + } + } + c->http_location = (long)tmp_http_location; + GET_TOML_BYKEY(cache, toml_rtob, 1, TOML_NULL_OR_INT); - GET_TOML_BYKEY(request_timeout, toml_rtoi, 10, TOML_NULL_OR_INT); GET_TOML_BYKEY(request_retry, toml_rtoi, 3, TOML_NULL_OR_INT); GET_TOML_BYKEY(request_locktime, toml_rtoi, 60, TOML_NULL_OR_INT); - GET_TOML_BYKEY(http_location, toml_rtob, 0, TOML_NULL_OR_INT); TRIM_SLASH(api_endpoint) TRIM_SLASH(cache_dir)