/[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.228 Revision 1.229
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.228 2011/09/27 19:21:56 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.229 2011/09/27 19:29:19 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.228 2011/09/27 19:21:56 vapier Exp $"; 10static const char *rcsid = "$Id: scanelf.c,v 1.229 2011/09/27 19:29:19 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 == '+')
16 16
17/* prototypes */ 17/* prototypes */
18static int file_matches_list(const char *filename, char **matchlist); 18static int file_matches_list(const char *filename, char **matchlist);
19static int scanelf_elfobj(elfobj *elf);
20static int scanelf_elf(const char *filename, int fd, size_t len);
21static int scanelf_archive(const char *filename, int fd, size_t len);
22static int scanelf_file(const char *filename, const struct stat *st_cache);
23static int scanelf_dir(const char *path);
24static void scanelf_ldpath(void);
25static void scanelf_envpath(void);
26static void usage(int status);
27static char **get_split_env(const char *envvar);
28static void parseenv(void);
29static int parseargs(int argc, char *argv[]);
30 19
31/* variables to control behavior */ 20/* variables to control behavior */
32static char *match_etypes = NULL; 21static char *match_etypes = NULL;
33static array_t _ldpaths = array_init_decl, *ldpaths = &_ldpaths; 22static array_t _ldpaths = array_init_decl, *ldpaths = &_ldpaths;
34static char scan_ldpath = 0; 23static char scan_ldpath = 0;
506 warnf("ELF %s has TEXTREL markings but doesnt appear to have any real TEXTREL's !?", elf->filename); 495 warnf("ELF %s has TEXTREL markings but doesnt appear to have any real TEXTREL's !?", elf->filename);
507 496
508 return NULL; 497 return NULL;
509} 498}
510 499
511static void rpath_security_checks(elfobj *, char *, const char *);
512static void rpath_security_checks(elfobj *elf, char *item, const char *dt_type) 500static void rpath_security_checks(elfobj *elf, char *item, const char *dt_type)
513{ 501{
514 struct stat st; 502 struct stat st;
515 switch (*item) { 503 switch (*item) {
516 case '/': break; 504 case '/': break;
694#define FLAG_S390_LIB64 0x0400 682#define FLAG_S390_LIB64 0x0400
695#define FLAG_POWERPC_LIB64 0x0500 683#define FLAG_POWERPC_LIB64 0x0500
696#define FLAG_MIPS64_LIBN32 0x0600 684#define FLAG_MIPS64_LIBN32 0x0600
697#define FLAG_MIPS64_LIBN64 0x0700 685#define FLAG_MIPS64_LIBN64 0x0700
698 686
699static char *lookup_cache_lib(elfobj *, char *);
700
701#if defined(__GLIBC__) || defined(__UCLIBC__) 687#if defined(__GLIBC__) || defined(__UCLIBC__)
702 688
703static char *lookup_cache_lib(elfobj *elf, char *fname) 689static char *lookup_cache_lib(elfobj *elf, char *fname)
704{ 690{
705 int fd; 691 int fd;

Legend:
Removed from v.1.228  
changed lines
  Added in v.1.229

  ViewVC Help
Powered by ViewVC 1.1.20