Procházet zdrojové kódy

Merge trunk revision 2974:
r2974 | sdake | 2010-06-29 11:15:20 -0700 (Tue, 29 Jun 2010) | 3 lines

Patch to fix stack protector sig abort that occurs when ipc buffer is too
short.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2975 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake před 15 roky
rodič
revize
bbd17e1c73
3 změnil soubory, kde provedl 9 přidání a 8 odebrání
  1. 1 0
      exec/coroipcs.c
  2. 4 4
      include/corosync/coroipc_ipc.h
  3. 4 4
      lib/coroipcc.c

+ 1 - 0
exec/coroipcs.c

@@ -38,6 +38,7 @@
 #define _GNU_SOURCE 1
 #endif
 #include <pthread.h>
+#include <limits.h>
 #include <assert.h>
 #include <pwd.h>
 #include <grp.h>

+ 4 - 4
include/corosync/coroipc_ipc.h

@@ -84,10 +84,10 @@ enum res_init_types {
 typedef struct {
 	int service __attribute__((aligned(8)));
 	unsigned long long semkey __attribute__((aligned(8)));
-	char control_file[64] __attribute__((aligned(8)));
-	char request_file[64] __attribute__((aligned(8)));
-	char response_file[64] __attribute__((aligned(8)));
-	char dispatch_file[64] __attribute__((aligned(8)));
+	char control_file[PATH_MAX] __attribute__((aligned(8)));
+	char request_file[PATH_MAX] __attribute__((aligned(8)));
+	char response_file[PATH_MAX] __attribute__((aligned(8)));
+	char dispatch_file[PATH_MAX] __attribute__((aligned(8)));
 	size_t control_size __attribute__((aligned(8)));
 	size_t request_size __attribute__((aligned(8)));
 	size_t response_size __attribute__((aligned(8)));

+ 4 - 4
lib/coroipcc.c

@@ -648,10 +648,10 @@ coroipcc_service_connect (
 	int sys_res;
 	mar_req_setup_t req_setup;
 	mar_res_setup_t res_setup;
-	char control_map_path[128];
-	char request_map_path[128];
-	char response_map_path[128];
-	char dispatch_map_path[128];
+	char control_map_path[PATH_MAX];
+	char request_map_path[PATH_MAX];
+	char response_map_path[PATH_MAX];
+	char dispatch_map_path[PATH_MAX];
 
 	res = hdb_error_to_cs (hdb_handle_create (&ipc_hdb,
 		sizeof (struct ipc_instance), handle));