Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP6
nagios
nagios-disable_phone_home.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nagios-disable_phone_home.patch of Package nagios
diff --unified -r nagios-4.4.7-orig/base/utils.c nagios-4.4.7/base/utils.c --- nagios-4.4.7-orig/base/utils.c 2022-04-14 16:19:37.000000000 +0200 +++ nagios-4.4.7/base/utils.c 2022-05-13 19:58:24.615532600 +0200 @@ -3322,142 +3322,6 @@ /* checks for updates at api.nagios.org */ int query_update_api(void) { - const char *api_server = "api.nagios.org"; - const char *api_path = "/versioncheck/"; - char *api_query = NULL; - char *api_query_opts = NULL; - char *buf = NULL; - char recv_buf[1024]; - int report_install = FALSE; - char *ptr = NULL; - int current_line = 0; - int buf_index = 0; - int in_header = TRUE; - char *var = NULL; - char *val = NULL; - int sd = 0; - int send_len = 0; - int recv_len = 0; - int update_check_succeeded = FALSE; - - /* report a new install, upgrade, or rollback */ - /* Nagios monitors the world and we monitor Nagios taking over the world. :-) */ - if(last_update_check == (time_t)0L) - report_install = TRUE; - if(last_program_version == NULL || strcmp(PROGRAM_VERSION, last_program_version)) - report_install = TRUE; - if(report_install == TRUE) { - asprintf(&api_query_opts, "&firstcheck=1"); - if(last_program_version != NULL) { - char *qopts2 = NULL; - asprintf(&qopts2, "%s&last_version=%s", api_query_opts, last_program_version); - my_free(api_query_opts); - api_query_opts = qopts2; - } - } - - /* generate the query */ - asprintf(&api_query, "v=1&product=nagios&tinycheck=1&stableonly=1&uid=%lu", update_uid); - if(bare_update_check == FALSE) { - char *api_query2 = NULL; - asprintf(&api_query2, "%s&version=%s%s", api_query, PROGRAM_VERSION, (api_query_opts == NULL) ? "" : api_query_opts); - my_free(api_query); - api_query = api_query2; - } - - /* generate the HTTP request */ - asprintf(&buf, - "POST %s HTTP/1.0\r\nUser-Agent: Nagios/%s\r\n" - "Connection: close\r\nHost: %s\r\n" - "Content-Type: application/x-www-form-urlencoded\r\n" - "Content-Length: %lu\r\n\r\n%s", - api_path, PROGRAM_VERSION, api_server, - (unsigned long) strlen(api_query), api_query); - - if (buf == NULL) { - abort(); - } - -#ifdef HAVE_SSL - SSL *ssl; - SSL_CTX *ctx; - - int result = my_ssl_connect(api_server, 443, &sd, &ssl, &ctx, 2); - if(sd > 0 && result != ERROR) { - /* send request */ - send_len = strlen(buf); - my_ssl_sendall(sd, ssl, buf, &send_len, 2); - - /* get response */ - recv_len = sizeof(recv_buf); - my_ssl_recvall(sd, ssl, recv_buf, &recv_len, 2); - recv_buf[sizeof(recv_buf) - 1] = '\x0'; - - /* close connection */ - SSL_free(ssl); - SSL_CTX_free(ctx); - close(sd); -#else - my_tcp_connect(api_server, 80, &sd, 2); - if(sd > 0) { - /* send request */ - send_len = strlen(buf); - my_sendall(sd, buf, &send_len, 2); - - /* get response */ - recv_len = sizeof(recv_buf); - my_recvall(sd, recv_buf, &recv_len, 2); - recv_buf[sizeof(recv_buf) - 1] = '\x0'; - - /* close connection */ - close(sd); -#endif - /* parse the result */ - in_header = TRUE; - while((ptr = get_next_string_from_buf(recv_buf, &buf_index, sizeof(recv_buf)))) { - - strip(ptr); - current_line++; - - if(!strcmp(ptr, "")) { - in_header = FALSE; - continue; - } - if(in_header == TRUE) - continue; - - var = strtok(ptr, "="); - val = strtok(NULL, "\n"); - - if(!strcmp(var, "UPDATE_AVAILABLE")) { - update_available = atoi(val); - /* we were successful */ - update_check_succeeded = TRUE; - } - else if(!strcmp(var, "UPDATE_VERSION")) { - if(new_program_version) - my_free(new_program_version); - new_program_version = strdup(val); - } - else if(!strcmp(var, "UPDATE_RELEASEDATE")) { - } - } - } - - /* cleanup */ - my_free(buf); - my_free(api_query); - my_free(api_query_opts); - - /* we were successful! */ - if(update_check_succeeded == TRUE) { - - time(&last_update_check); - if(last_program_version) - free(last_program_version); - last_program_version = (char *)strdup(PROGRAM_VERSION); - } - return OK; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor