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 / +24 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
5
7
6
AM_CPPFLAGS = \
8
AM_CPPFLAGS = \
7
	-DPIC -fPIC -D_REENTRANT  \
9
	-DPIC -fPIC -D_REENTRANT  \
Lines 11-22 AM_CPPFLAGS = \ Link Here
11
13
12
LOCAL_INCLUDES = $(top_srcdir)/localdecls.h
14
LOCAL_INCLUDES = $(top_srcdir)/localdecls.h
13
15
16
libmalloc_la_SOURCES = malloc.c
17
libmalloc_la_CPPFLAGS = -D_GNU_SOURCE \
18
	-DHAVE_MORECORE=0 \
19
	-DONLY_MSPACES -DUSE_LOCKS=0
20
libptmalloc3_la_SOURCES = ptmalloc3.c \
21
	malloc-2.8.3.h \
22
	malloc-private.h \
23
	sysdeps/pthread/malloc-machine.h \
24
	sysdeps/pthread/thread-st.h \
25
	sysdeps/generic/malloc-machine.h \
26
	sysdeps/generic/atomic.h \
27
	sysdeps/generic/thread-st.h
28
libptmalloc3_la_CPPFLAGS = -D_GNU_SOURCE \
29
	-DMSPACES=1 \
30
	-DUSE_TSD_DATA_HACK -DTHREAD_STATS=1 \
31
	-Isysdeps/pthread -Isysdeps/generic
32
libptmalloc3_la_LIBADD = -lpthread \
33
	libmalloc.la
34
14
# We need -fexceptions here, else we do not catch exceptions
35
# We need -fexceptions here, else we do not catch exceptions
15
# (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions).
36
# (nptl/tst-cancelx4.c in glibc among others fails for wrapped functions).
16
libsandbox_la_CFLAGS = -fexceptions
37
libsandbox_la_CFLAGS = -fexceptions
17
# Do not add -nostdlib or -nostartfiles, as then our constructor
38
# Do not add -nostdlib or -nostartfiles, as then our constructor
18
# and destructor will not be executed ...
39
# and destructor will not be executed ...
19
libsandbox_la_LIBADD = -lc $(LIBDL)
40
libsandbox_la_LIBADD = libptmalloc3.la \
41
	-lc $(LIBDL)
20
libsandbox_la_LDFLAGS = \
42
libsandbox_la_LDFLAGS = \
21
	-nodefaultlibs \
43
	-nodefaultlibs \
22
	-Wl,--version-script,libsandbox.map
44
	-Wl,--version-script,libsandbox.map
Lines 32-37 sandbox_SOURCES = \ Link Here
32
	sandbox.h         \
54
	sandbox.h         \
33
	sandbox_utils.c   \
55
	sandbox_utils.c   \
34
	$(LOCAL_INCLUDES)
56
	$(LOCAL_INCLUDES)
57
sandbox_LDADD = libptmalloc3.la
35
58
36
libsandbox.c: libsandbox.map symbols.h
59
libsandbox.c: libsandbox.map symbols.h
37
60
(-)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