Explorar o código

Unable to compile v3.1.0rc1 with new SSL checks on rh5

Fix for issue #117
John C. Frickson %!s(int64=9) %!d(string=hai) anos
pai
achega
01a9a331e0
Modificáronse 3 ficheiros con 8 adicións e 1 borrados
  1. 1 0
      Changelog
  2. 2 0
      src/nrpe.c
  3. 5 1
      src/utils.c

+ 1 - 0
Changelog

@@ -8,6 +8,7 @@ FIXES
 - The '--log-file=' or '-g' option is missing from the help (John Frickson)
 - check_nrpe = segfault when specifying a config file (John Frickson)
 - Alternate log file not being used soon enough (John Frickson)
+- Unable to compile v3.1.0rc1 with new SSL checks on rh5 (John Frickson)
 
 
 3.1.0 - 2017-04-17

+ 2 - 0
src/nrpe.c

@@ -357,7 +357,9 @@ void init_ssl(void)
 			break;
 		case TLSv1_2:
 		case TLSv1_2_plus:
+#ifdef SSL_OP_NO_TLSv1_1
 			ssl_opts |= SSL_OP_NO_TLSv1_1;
+#endif
 		case TLSv1_1:
 		case TLSv1_1_plus:
 			ssl_opts |= SSL_OP_NO_TLSv1;

+ 5 - 1
src/utils.c

@@ -469,6 +469,7 @@ char *my_strsep(char **stringp, const char *delim)
 void open_log_file()
 {
 	int fh;
+	int flags = O_RDWR|O_APPEND|O_CREAT;
 	struct stat st;
 
 	close_log_file();
@@ -476,7 +477,10 @@ void open_log_file()
 	if (!log_file)
 		return;
 
-	if ((fh = open(log_file, O_RDWR|O_APPEND|O_CREAT|O_NOFOLLOW, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) == -1) {
+#ifdef O_NOFOLLOW
+	flags |= O_NOFOLLOW;
+#endif
+	if ((fh = open(log_file, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) == -1) {
 		printf("Warning: Cannot open log file '%s' for writing\n", log_file);
 		logit(LOG_WARNING, "Warning: Cannot open log file '%s' for writing", log_file);
 		return;