/[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.149 Revision 1.150
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.149 2006/05/14 21:21:35 vapier Exp $ 4 * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.150 2006/05/14 21:37:55 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.149 2006/05/14 21:21:35 vapier Exp $"; 12static const char *rcsid = "$Id: scanelf.c,v 1.150 2006/05/14 21:37:55 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) \
129 xstrcat(dst, my_app, curr_len); 129 xstrcat(dst, my_app, curr_len);
130} 130}
131 131
132/* Match filename against entries in matchlist, return TRUE 132/* Match filename against entries in matchlist, return TRUE
133 * if the file is listed */ 133 * if the file is listed */
134static int file_matches_list(const char *filename, char **matchlist) { 134static int file_matches_list(const char *filename, char **matchlist)
135{
135 char **file; 136 char **file;
136 char *match; 137 char *match;
137 char buf[__PAX_UTILS_PATH_MAX]; 138 char buf[__PAX_UTILS_PATH_MAX];
138 139
139 if (matchlist == NULL) 140 if (matchlist == NULL)
140 return 0; 141 return 0;
141 142
142 for (file = matchlist; *file != NULL; file++) { 143 for (file = matchlist; *file != NULL; file++) {
143 if (search_path) { 144 if (search_path) {
144 snprintf(buf,__PAX_UTILS_PATH_MAX, "%s%s", search_path, *file); 145 snprintf(buf,__PAX_UTILS_PATH_MAX, "%s%s", search_path, *file);
145 match=buf; 146 match = buf;
146 } else { 147 } else {
147 match=*file; 148 match = *file;
148 } 149 }
149 if (fnmatch(match, filename, 0) == 0) 150 if (fnmatch(match, filename, 0) == 0)
150 return 1; /* TRUE */ 151 return 1; /* TRUE */
151 } 152 }
152 return 0; /* FALSE */ 153 return 0; /* FALSE */
1844 1845
1845 if (ldcache != 0) 1846 if (ldcache != 0)
1846 munmap(ldcache, ldcache_size); 1847 munmap(ldcache, ldcache_size);
1847} 1848}
1848 1849
1849static char **get_split_env(const char *envvar) { 1850static char **get_split_env(const char *envvar)
1851{
1850 char **envvals = NULL; 1852 char **envvals = NULL;
1851 char *saveptr = NULL; 1853 char *saveptr = NULL;
1852 char *env; 1854 char *env;
1853 char *s; 1855 char *s;
1854 int nentry; 1856 int nentry;
1869 envvals[nentry] = NULL; 1871 envvals[nentry] = NULL;
1870 1872
1871 return envvals; 1873 return envvals;
1872} 1874}
1873 1875
1874static void parseenv() { 1876static void parseenv()
1877{
1875 qa_textrels=get_split_env("QA_TEXTRELS"); 1878 qa_textrels = get_split_env("QA_TEXTRELS");
1876 qa_execstack=get_split_env("QA_EXECSTACK"); 1879 qa_execstack = get_split_env("QA_EXECSTACK");
1877 qa_wx_load=get_split_env("QA_WX_LOAD"); 1880 qa_wx_load = get_split_env("QA_WX_LOAD");
1878} 1881}
1879 1882
1880 1883
1881 1884
1882int main(int argc, char *argv[]) 1885int main(int argc, char *argv[])

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.150

  ViewVC Help
Powered by ViewVC 1.1.20