Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 457194 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/closures.c (-3 / +20 lines)
Lines 176-190 selinux_enabled_check (void) Link Here
176
#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX
176
#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX
177
#include <stdlib.h>
177
#include <stdlib.h>
178
178
179
#define LINE_BUFFER 1024
179
static int emutramp_enabled = -1;
180
static int emutramp_enabled = -1;
180
181
181
static int
182
static int
182
emutramp_enabled_check (void)
183
emutramp_enabled_check (void)
183
{
184
{
184
  if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL)
185
  FILE *f;
185
    return 1;
186
  char first[LINE_BUFFER], second[LINE_BUFFER];
186
  else
187
  char conf_line[LINE_BUFFER];
188
  f  = fopen("/proc/self/status", "r");
189
  if (f == NULL)
187
    return 0;
190
    return 0;
191
  else
192
    while( fgets(conf_line, LINE_BUFFER, f) )
193
      {
194
 	sscanf(conf_line, "%s %s", first, second );
195
	if( !strcmp( first, "PaX:" ) )
196
	    if( second[1] == 'E' )
197
		if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL)
198
		  {
199
	            fclose (f);
200
	            return 1;
201
		  }
202
      }
203
  fclose (f);
204
  return 0;
188
}
205
}
189
206
190
#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
207
#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \

Return to bug 457194