File nagios-disable_phone_home.patch of Package nagios

Index: nagios-4.5.1/base/utils.c
===================================================================
--- nagios-4.5.1.orig/base/utils.c
+++ nagios-4.5.1/base/utils.c
@@ -3330,142 +3330,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 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 = NULL;
-	SSL_CTX *ctx = NULL;
-
-	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);
-#if OPENSSL_VERSION_NUMBER < 0x10100000
-		SSL_CTX_free(ctx);
-#endif
-		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);
-
-			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;
 	}
 
Index: nagios-4.5.1/sample-config/cgi.cfg.in
===================================================================
--- nagios-4.5.1.orig/sample-config/cgi.cfg.in
+++ nagios-4.5.1/sample-config/cgi.cfg.in
@@ -285,7 +285,7 @@ refresh_rate=90
 # PAGE TOUR
 # Enable page tour for helpful tips and tricks on various pages
 
-#enable_page_tour=1
+enable_page_tour=0
 
 
 
openSUSE Build Service is sponsored by