/[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.175 Revision 1.176
1/* 1/*
2 * Copyright 2003-2006 Gentoo Foundation 2 * Copyright 2003-2006 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/Attic/scanelf.c,v 1.175 2007/01/18 08:15:16 solar Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/Attic/scanelf.c,v 1.176 2007/04/08 19:14:31 solar Exp $
5 * 5 *
6 * Copyright 2003-2006 Ned Ludd - <solar@gentoo.org> 6 * Copyright 2003-2006 Ned Ludd - <solar@gentoo.org>
7 * Copyright 2004-2006 Mike Frysinger - <vapier@gentoo.org> 7 * Copyright 2004-2006 Mike Frysinger - <vapier@gentoo.org>
8 */ 8 */
9 9
10#include "paxinc.h" 10#include "paxinc.h"
11 11
12static const char *rcsid = "$Id: scanelf.c,v 1.175 2007/01/18 08:15:16 solar Exp $"; 12static const char *rcsid = "$Id: scanelf.c,v 1.176 2007/04/08 19:14:31 solar Exp $";
13#define argv0 "scanelf" 13#define argv0 "scanelf"
14 14
15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+') 15#define IS_MODIFIER(c) (c == '%' || c == '#' || c == '+')
16 16
17/* prototypes */ 17/* prototypes */
62static char *find_lib = NULL; 62static char *find_lib = NULL;
63static char *find_section = NULL; 63static char *find_section = NULL;
64static char *out_format = NULL; 64static char *out_format = NULL;
65static char *search_path = NULL; 65static char *search_path = NULL;
66static char fix_elf = 0; 66static char fix_elf = 0;
67static char gmatch = 0; 67static char g_match = 0;
68static char use_ldcache = 0; 68static char use_ldcache = 0;
69 69
70static char **qa_textrels = NULL; 70static char **qa_textrels = NULL;
71static char **qa_execstack = NULL; 71static char **qa_execstack = NULL;
72static char **qa_wx_load = NULL; 72static char **qa_wx_load = NULL;
511 break; 511 break;
512 case '$': 512 case '$':
513 if (fstat(elf->fd, &st) != -1) 513 if (fstat(elf->fd, &st) != -1)
514 if ((st.st_mode & S_ISUID) || (st.st_mode & S_ISGID)) 514 if ((st.st_mode & S_ISUID) || (st.st_mode & S_ISGID))
515 warnf("Security problem with %s='%s' in %s with mode set of %o", 515 warnf("Security problem with %s='%s' in %s with mode set of %o",
516 dt_type, item, elf->filename, st.st_mode & 07777); 516 dt_type, item, elf->filename, (unsigned int) st.st_mode & 07777);
517 break; 517 break;
518 default: 518 default:
519 warnf("Maybe? sec problem with %s='%s' in %s", dt_type, item, elf->filename); 519 warnf("Maybe? sec problem with %s='%s' in %s", dt_type, item, elf->filename);
520 break; 520 break;
521 } 521 }
823 needed = p; \ 823 needed = p; \
824 xstrcat(ret, needed, ret_len); \ 824 xstrcat(ret, needed, ret_len); \
825 } \ 825 } \
826 *found_needed = 1; \ 826 *found_needed = 1; \
827 } else { \ 827 } else { \
828 if (!strncmp(find_lib, needed, strlen( !gmatch ? needed : find_lib))) { \ 828 if (!strncmp(find_lib, needed, strlen( !g_match ? needed : find_lib))) { \
829 *found_lib = 1; \ 829 *found_lib = 1; \
830 return (be_wewy_wewy_quiet ? NULL : needed); \ 830 return (be_wewy_wewy_quiet ? NULL : needed); \
831 } \ 831 } \
832 } \ 832 } \
833 } \ 833 } \
983 warnf("%s: corrupt ELF symbols", elf->filename); \ 983 warnf("%s: corrupt ELF symbols", elf->filename); \
984 ++sym; \ 984 ++sym; \
985 continue; \ 985 continue; \
986 } \ 986 } \
987 /* debug display ... show all symbols and some extra info */ \ 987 /* debug display ... show all symbols and some extra info */ \
988 if (gmatch ? rematch(ret, symname, REG_EXTENDED) == 0 : *ret == '*') { \ 988 if (g_match ? rematch(ret, symname, REG_EXTENDED) == 0 : *ret == '*') { \
989 printf("%s(%s) %5lX %15s %s\n", \ 989 printf("%s(%s) %5lX %15s %s\n", \
990 ((*found_sym == 0) ? "\n\t" : "\t"), \ 990 ((*found_sym == 0) ? "\n\t" : "\t"), \
991 elf->base_filename, \ 991 elf->base_filename, \
992 (unsigned long)sym->st_size, \ 992 (unsigned long)sym->st_size, \
993 get_elfstttype(sym->st_info), \ 993 get_elfstttype(sym->st_info), \
1763 ((flags & PF_EMUTRAMP) && (flags & PF_NOEMUTRAMP)) || 1763 ((flags & PF_EMUTRAMP) && (flags & PF_NOEMUTRAMP)) ||
1764 ((flags & PF_RANDMMAP) && (flags & PF_NORANDMMAP)))) 1764 ((flags & PF_RANDMMAP) && (flags & PF_NORANDMMAP))))
1765 setpax = flags; 1765 setpax = flags;
1766 break; 1766 break;
1767 } 1767 }
1768 case 'g': gmatch = 1; break; 1768 case 'g': g_match = 1; break;
1769 case 'L': use_ldcache = 1; break; 1769 case 'L': use_ldcache = 1; break;
1770 case 'y': scan_symlink = 0; break; 1770 case 'y': scan_symlink = 0; break;
1771 case 'A': scan_archives = 1; break; 1771 case 'A': scan_archives = 1; break;
1772 case 'B': show_banner = 0; break; 1772 case 'B': show_banner = 0; break;
1773 case 'l': scan_ldpath = 1; break; 1773 case 'l': scan_ldpath = 1; break;

Legend:
Removed from v.1.175  
changed lines
  Added in v.1.176

  ViewVC Help
Powered by ViewVC 1.1.20