Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15
nagios
nagios-disable_phone_home.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nagios-disable_phone_home.patch of Package nagios
Index: nagios-4.3.1/base/utils.c =================================================================== --- nagios-4.3.1.orig/base/utils.c +++ nagios-4.3.1/base/utils.c @@ -3156,122 +3156,6 @@ int check_for_nagios_updates(int force, /* 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(); - } - - 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); - - /* 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