/[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.156 Revision 1.157
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/scanelf.c,v 1.156 2006/06/11 00:23:11 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.157 2006/08/25 06:31:22 vapier 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.156 2006/06/11 00:23:11 vapier Exp $"; 12static const char *rcsid = "$Id: scanelf.c,v 1.157 2006/08/25 06:31:22 vapier 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#define do_state(option, flag) \ 17#define do_state(option, flag) \
442 warnf("Security problem NULL %s in %s", dt_type, elf->filename); 442 warnf("Security problem NULL %s in %s", dt_type, elf->filename);
443 break; 443 break;
444 case '$': 444 case '$':
445 if (fstat(elf->fd, &st) != -1) 445 if (fstat(elf->fd, &st) != -1)
446 if ((st.st_mode & S_ISUID) || (st.st_mode & S_ISGID)) 446 if ((st.st_mode & S_ISUID) || (st.st_mode & S_ISGID))
447 warnf("Security problem with %s='%s' in %s with mode set of %o", 447 warnf("Security problem with %s='%s' in %s with mode set of %o",
448 dt_type, item, elf->filename, st.st_mode & 07777); 448 dt_type, item, elf->filename, st.st_mode & 07777);
449 break; 449 break;
450 default: 450 default:
451 warnf("Maybe? sec problem with %s='%s' in %s", dt_type, item, elf->filename); 451 warnf("Maybe? sec problem with %s='%s' in %s", dt_type, item, elf->filename);
452 break; 452 break;
1431 1431
1432 if (i + 1 == ARRAY_SIZE(ldpaths)) 1432 if (i + 1 == ARRAY_SIZE(ldpaths))
1433 break; 1433 break;
1434 } 1434 }
1435 ldpaths[i] = NULL; 1435 ldpaths[i] = NULL;
1436 1436
1437 free(b); 1437 free(b);
1438 fclose(fp); 1438 fclose(fp);
1439 return i; 1439 return i;
1440} 1440}
1441 1441
1575 printf("* Scan ELF binaries for stuff\n\n" 1575 printf("* Scan ELF binaries for stuff\n\n"
1576 "Usage: %s [options] <dir1/file1> [dir2 dirN file2 fileN ...]\n\n", argv0); 1576 "Usage: %s [options] <dir1/file1> [dir2 dirN file2 fileN ...]\n\n", argv0);
1577 printf("Options: -[%s]\n", PARSE_FLAGS); 1577 printf("Options: -[%s]\n", PARSE_FLAGS);
1578 for (i = 0; long_opts[i].name; ++i) 1578 for (i = 0; long_opts[i].name; ++i)
1579 if (long_opts[i].has_arg == no_argument) 1579 if (long_opts[i].has_arg == no_argument)
1580 printf(" -%c, --%-14s* %s\n", long_opts[i].val, 1580 printf(" -%c, --%-14s* %s\n", long_opts[i].val,
1581 long_opts[i].name, opts_help[i]); 1581 long_opts[i].name, opts_help[i]);
1582 else 1582 else
1583 printf(" -%c, --%-7s <arg> * %s\n", long_opts[i].val, 1583 printf(" -%c, --%-7s <arg> * %s\n", long_opts[i].val,
1584 long_opts[i].name, opts_help[i]); 1584 long_opts[i].name, opts_help[i]);
1585 1585
1586 if (status != EXIT_SUCCESS) 1586 if (status != EXIT_SUCCESS)
1587 exit(status); 1587 exit(status);
1588 1588
1589 puts("\nThe format modifiers for the -F option are:"); 1589 puts("\nThe format modifiers for the -F option are:");
1590 puts(" F Filename \tx PaX Flags \te STACK/RELRO"); 1590 puts(" F Filename \tx PaX Flags \te STACK/RELRO");
1591 puts(" t TEXTREL \tr RPATH \tn NEEDED"); 1591 puts(" t TEXTREL \tr RPATH \tn NEEDED");
1592 puts(" i INTERP \tb BIND \ts symbol"); 1592 puts(" i INTERP \tb BIND \ts symbol");
1593 puts(" N library \to Type \tT TEXTRELs"); 1593 puts(" N library \to Type \tT TEXTRELs");

Legend:
Removed from v.1.156  
changed lines
  Added in v.1.157

  ViewVC Help
Powered by ViewVC 1.1.20