Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 164656 | Differences between
and this patch

Collapse All | Expand All

(-)src/Makefile.am (-1 / +27 lines)
Lines 2-7 AUTOMAKE_OPTIONS = foreign Link Here
2
2
3
lib_LTLIBRARIES = libsandbox.la
3
lib_LTLIBRARIES = libsandbox.la
4
bin_PROGRAMS = sandbox
4
bin_PROGRAMS = sandbox
5
noinst_LTLIBRARIES = libptmalloc3.la \
6
	libmalloc.la
7
8
ptmalloc_srcdir=$(top_srcdir)/../ptmalloc3
5
9
6
AM_CPPFLAGS = \
10
AM_CPPFLAGS = \
7
	-DPIC -fPIC -D_REENTRANT  \
11
	-DPIC -fPIC -D_REENTRANT  \
Lines 11-22 AM_CPPFLAGS = \ Link Here
11
15
12
LOCAL_INCLUDES = $(top_srcdir)/localdecls.h
16
LOCAL_INCLUDES = $(top_srcdir)/localdecls.h
13
17
18
libmalloc_la_SOURCES = $(ptmalloc_srcdir)/malloc.c
19
libmalloc_la_CPPFLAGS = -D_GNU_SOURCE \
20
	-DHAVE_MORECORE=0 \
21
	-DONLY_MSPACES -DUSE_LOCKS=0
22
libptmalloc3_la_SOURCES = $(ptmalloc_srcdir)/ptmalloc3.c \
23
	$(ptmalloc_srcdir)/malloc-2.8.3.h \
24
	$(ptmalloc_srcdir)/malloc-private.h \
25
	$(ptmalloc_srcdir)/sysdeps/pthread/malloc-machine.h \
26
	$(ptmalloc_srcdir)/sysdeps/pthread/thread-st.h \
27
	$(ptmalloc_srcdir)/sysdeps/generic/malloc-machine.h \
28
	$(ptmalloc_srcdir)/sysdeps/generic/atomic.h \
29
	$(ptmalloc_srcdir)/sysdeps/generic/thread-st.h
30
libptmalloc3_la_CPPFLAGS = -D_GNU_SOURCE \
31
	-DMSPACES=1 \
32
	-DUSE_TSD_DATA_HACK -DTHREAD_STATS=1 \
33
	-I$(ptmalloc_srcdir) \
34
	-I$(ptmalloc_srcdir)/sysdeps/pthread -I$(ptmalloc_srcdir)/sysdeps/generic
35
libptmalloc3_la_LIBADD = -lpthread \
36
	libmalloc.la
37
14
# We need -fexceptions here, else we do not catch exceptions
38
# We need -fexceptions here, else we do not catch exceptions
15
# (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions).
39
# (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions).
16
libsandbox_la_CFLAGS = -fexceptions
40
libsandbox_la_CFLAGS = -fexceptions
17
# Do not add -nostdlib or -nostartfiles, as then our constructor
41
# Do not add -nostdlib or -nostartfiles, as then our constructor
18
# and destructor will not be executed ...
42
# and destructor will not be executed ...
19
libsandbox_la_LIBADD = -lc $(LIBDL)
43
libsandbox_la_LIBADD = libptmalloc3.la \
44
	-lc $(LIBDL)
20
libsandbox_la_LDFLAGS = \
45
libsandbox_la_LDFLAGS = \
21
	-nodefaultlibs \
46
	-nodefaultlibs \
22
	-Wl,--version-script,libsandbox.map
47
	-Wl,--version-script,libsandbox.map
Lines 32-37 sandbox_SOURCES = \ Link Here
32
	sandbox.h         \
57
	sandbox.h         \
33
	sandbox_utils.c   \
58
	sandbox_utils.c   \
34
	$(LOCAL_INCLUDES)
59
	$(LOCAL_INCLUDES)
60
sandbox_LDADD = libptmalloc3.la
35
61
36
libsandbox.c: libsandbox.map symbols.h
62
libsandbox.c: libsandbox.map symbols.h
37
63
(-)src/sandbox_utils.c (-1 / +1 lines)
Lines 175-181 char * gstrndup (const char *str, size_t Link Here
175
		return NULL;
175
		return NULL;
176
176
177
	/* Check lenght of str without breaching the size limit */
177
	/* Check lenght of str without breaching the size limit */
178
	for (len = 0; (len < size) && ('\0' != str[len]); len++);
178
	for (len = 0; (size == -1 || len < size) && ('\0' != str[len]); len++);
179
179
180
	new_str = malloc (len + 1);
180
	new_str = malloc (len + 1);
181
	if (NULL == new_str)
181
	if (NULL == new_str)
(-)src/sandbox.h (+4 lines)
Lines 103-108 long file_length(int fd); Link Here
103
103
104
/* Compat functions for GNU extensions */
104
/* Compat functions for GNU extensions */
105
char *gstrndup (const char *str, size_t size);
105
char *gstrndup (const char *str, size_t size);
106
#ifdef strdup
107
#undef strdup
108
#endif
109
#define strdup(s) gstrndup((s), -1)
106
/* Same as basename(3), but do not modify path */
110
/* Same as basename(3), but do not modify path */
107
char *gbasename (const char *path);
111
char *gbasename (const char *path);
108
112

Return to bug 164656