aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ldd_utils.h
diff options
context:
space:
mode:
authorLibravatar startx2017 <vradu.startx@yandex.com>2018-03-12 08:41:01 -0400
committerLibravatar startx2017 <vradu.startx@yandex.com>2018-03-12 08:41:01 -0400
commit14b5746d8fba392c02733ce4c90befc32a93fb15 (patch)
tree2ac6a7de4adaafc730511a70f11b88aca1f47244 /src/include/ldd_utils.h
parentfix bash on CentOS 7 (diff)
downloadfirejail-14b5746d8fba392c02733ce4c90befc32a93fb15.tar.gz
firejail-14b5746d8fba392c02733ce4c90befc32a93fb15.tar.zst
firejail-14b5746d8fba392c02733ce4c90befc32a93fb15.zip
private-lib bug: 32 bit libraries being copied instead of 64 bit versions; splitting common code for firejail and fldd in a common static library
Diffstat (limited to 'src/include/ldd_utils.h')
-rw-r--r--src/include/ldd_utils.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/include/ldd_utils.h b/src/include/ldd_utils.h
new file mode 100644
index 000000000..28f5be7bf
--- /dev/null
+++ b/src/include/ldd_utils.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2014-2018 Firejail Authors
3 *
4 * This file is part of firejail project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#ifndef LDD_UTILS_H
22#define LDD_UTILS_H
23
24#include "../include/common.h"
25#include <elf.h>
26
27#ifdef __LP64__
28#define Elf_Ehdr Elf64_Ehdr
29#define Elf_Phdr Elf64_Phdr
30#define Elf_Shdr Elf64_Shdr
31#define Elf_Dyn Elf64_Dyn
32#else
33#define Elf_Ehdr Elf32_Ehdr
34#define Elf_Phdr Elf32_Phdr
35#define Elf_Shdr Elf32_Shdr
36#define Elf_Dyn Elf32_Dyn
37#endif
38
39extern const char * const default_lib_paths[];
40
41// return 1 if this is a 64 bit program/library
42int is_lib_64(const char *exe);
43
44
45
46#endif \ No newline at end of file