/[gentoo-projects]/pax-utils/scanelf.c
Gentoo

Diff of /pax-utils/scanelf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.241 Revision 1.242
1/* 1/*
2 * Copyright 2003-2007 Gentoo Foundation 2 * Copyright 2003-2007 Gentoo Foundation
3 * Distributed under the terms of the GNU General Public License v2 3 * Distributed under the terms of the GNU General Public License v2
4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.241 2012/01/25 01:58:29 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.242 2012/04/28 05:14:26 vapier Exp $
5 * 5 *
6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2007 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2007 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10static const char rcsid[] = "$Id: scanelf.c,v 1.241 2012/01/25 01:58:29 vapier Exp $"; 10static const char rcsid[] = "$Id: scanelf.c,v 1.242 2012/04/28 05:14:26 vapier Exp $";
11const char argv0[] = "scanelf"; 11const char argv0[] = "scanelf";
12 12
13#include "paxinc.h" 13#include "paxinc.h"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
297 } 297 }
298 SHOW_PAX(32) 298 SHOW_PAX(32)
299 SHOW_PAX(64) 299 SHOW_PAX(64)
300 } 300 }
301 301
302 if (fix_elf && setpax) { 302 /* Note: We do not support setting EI_PAX if not PT_PAX_FLAGS
303 /* set the chpax settings */ 303 * was found. This is known to break ELFs on glibc systems,
304 if (elf->elf_class == ELFCLASS32) { 304 * and mainline PaX has deprecated use of this for a long time.
305 if (EHDR32(elf->ehdr)->e_type == ET_DYN || EHDR32(elf->ehdr)->e_type == ET_EXEC) 305 * We could support changing PT_GNU_STACK, but that doesn't
306 ESET(EHDR32(elf->ehdr)->e_ident[EI_PAX], pax_pf2hf_flags(setpax)); 306 * seem like it's worth the effort. #411919
307 } else { 307 */
308 if (EHDR64(elf->ehdr)->e_type == ET_DYN || EHDR64(elf->ehdr)->e_type == ET_EXEC)
309 ESET(EHDR64(elf->ehdr)->e_ident[EI_PAX], pax_pf2hf_flags(setpax));
310 }
311 }
312 308
313 /* fall back to EI_PAX if no PT_PAX was found */ 309 /* fall back to EI_PAX if no PT_PAX was found */
314 if (!*ret) { 310 if (!*ret) {
315 static char *paxflags; 311 static char *paxflags;
316 paxflags = pax_short_hf_flags(EI_PAX_FLAGS(elf)); 312 paxflags = pax_short_hf_flags(EI_PAX_FLAGS(elf));

Legend:
Removed from v.1.241  
changed lines
  Added in v.1.242

  ViewVC Help
Powered by ViewVC 1.1.20