浏览代码

Merge remote-tracking branch 'openwrt/master' into gstreamer1

W. Michael Petullo 10 年前
父节点
当前提交
6c9015eb5d
共有 36 个文件被更改,包括 1829 次插入620 次删除
  1. 2
    2
      devel/patch/Makefile
  2. 2
    2
      libs/gnutls/Makefile
  3. 0
    28
      libs/gnutls/patches/0001-nn-hash.patch
  4. 0
    98
      libs/gsm/Makefile
  5. 0
    428
      libs/gsm/patches/001-debian-libsgm-1.0.10-13.patch
  6. 1
    1
      libs/tiff/Makefile
  7. 31
    0
      libs/tiff/patches/010-CVE-2012-4564.patch
  8. 146
    0
      libs/tiff/patches/011-CVE-2013-1960.patch
  9. 768
    0
      libs/tiff/patches/012-CVE-2013-1961.patch
  10. 17
    0
      libs/tiff/patches/013-CVE-2013-4231.patch
  11. 18
    0
      libs/tiff/patches/014-CVE-2013-4232.patch
  12. 18
    0
      libs/tiff/patches/015-CVE-2013-4244.patch
  13. 37
    0
      libs/tiff/patches/016-CVE-2013-4243.patch
  14. 4
    0
      multimedia/minidlna/Makefile
  15. 12
    0
      multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch
  16. 1
    1
      multimedia/mjpg-streamer/Makefile
  17. 63
    0
      net/dhcpcd/Makefile
  18. 24
    0
      net/dhcpcd/files/dhcpcd.init
  19. 45
    0
      net/horst/Makefile
  20. 1
    1
      net/nginx/Makefile
  21. 0
    11
      net/nginx/patches/400-nginx-1.4.x_proxy_protocol_patch_v2.patch
  22. 0
    26
      net/ocserv/files/ocserv.init
  23. 59
    0
      net/p910nd/Makefile
  24. 5
    0
      net/p910nd/files/p910nd.config
  25. 51
    0
      net/p910nd/files/p910nd.init
  26. 57
    0
      net/radsecproxy/Makefile
  27. 16
    0
      net/radsecproxy/files/radsecproxy.init
  28. 58
    0
      net/radsecproxy/patches/100-missing-return.patch
  29. 31
    0
      net/radsecproxy/patches/200-logdest-on-foreground.patch
  30. 60
    0
      net/tinc/Makefile
  31. 56
    0
      net/tinc/files/tinc.config
  32. 241
    0
      net/tinc/files/tinc.init
  33. 1
    0
      net/tinc/files/tinc.upgrade
  34. 4
    5
      sound/mpd/Makefile
  35. 0
    9
      utils/acl/Makefile
  36. 0
    8
      utils/attr/Makefile

+ 2
- 2
devel/patch/Makefile 查看文件

@@ -11,9 +11,9 @@ PKG_NAME:=patch
11 11
 PKG_VERSION:=2.7.1
12 12
 PKG_RELEASE:=1
13 13
 
14
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=@GNU/patch
16
-PKG_MD5SUM:=95dd8d7e41dcbcecdd5cd88ef915378d
16
+PKG_MD5SUM:=e9ae5393426d3ad783a300a338c09b72
17 17
 
18 18
 include $(INCLUDE_DIR)/package.mk
19 19
 

+ 2
- 2
libs/gnutls/Makefile 查看文件

@@ -8,12 +8,12 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=gnutls
11
-PKG_VERSION:=3.2.15
11
+PKG_VERSION:=3.2.16
12 12
 PKG_RELEASE:=1
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2
16
-PKG_MD5SUM:=ec3b06f80e312137386c5d322183ca5a
16
+PKG_MD5SUM:=d9a3fb49121b49bc332bfe9c3f49b005
17 17
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
18 18
 
19 19
 PKG_INSTALL:=1

+ 0
- 28
libs/gnutls/patches/0001-nn-hash.patch 查看文件

@@ -1,28 +0,0 @@
1
-diff --git a/lib/accelerated/x86/x86-common.h b/lib/accelerated/x86/x86-common.h
2
-index 03fc8de..647c7d6 100644
3
---- a/lib/accelerated/x86/x86-common.h
4
-+++ b/lib/accelerated/x86/x86-common.h
5
-@@ -29,11 +29,13 @@ extern unsigned int _gnutls_x86_cpuid_s[4];
6
- void gnutls_cpuid(unsigned int func, unsigned int *ax, unsigned int *bx,
7
- 		  unsigned int *cx, unsigned int *dx);
8
- 
9
--#ifdef ASM_X86_32
10
-+# ifdef ASM_X86_32
11
- unsigned int gnutls_have_cpuid(void);
12
--#else
13
--#define gnutls_have_cpuid() 1
14
--#endif				/* ASM_X86_32 */
15
-+# else
16
-+#  define gnutls_have_cpuid() 1
17
-+# endif				/* ASM_X86_32 */
18
-+
19
-+#endif
20
- 
21
- #define NN_HASH(name, update_func, digest_func, NAME) {	\
22
-  #name,						\
23
-@@ -44,5 +46,3 @@ unsigned int gnutls_have_cpuid(void);
24
-  (nettle_hash_update_func *) update_func,	\
25
-  (nettle_hash_digest_func *) digest_func	\
26
- } 
27
--
28
--#endif

+ 0
- 98
libs/gsm/Makefile 查看文件

@@ -1,98 +0,0 @@
1
-#
2
-# Copyright (C) 2006-2014 OpenWrt.org
3
-#
4
-# This is free software, licensed under the GNU General Public License v2.
5
-# See /LICENSE for more information.
6
-#
7
-
8
-include $(TOPDIR)/rules.mk
9
-
10
-PKG_NAME:=gsm
11
-PKG_VERSION:=1.0.13
12
-PKG_RELEASE:=1
13
-
14
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
-PKG_SOURCE_URL:=http://user.cs.tu-berlin.de/~jutta/gsm/
16
-PKG_MD5SUM:=c1ba392ce61dc4aff1c29ea4e92f6df4
17
-
18
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
19
-
20
-PKG_LICENSE:=FREE
21
-PKG_LICENSE_FILES:=COPYRIGHT
22
-
23
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-1.0-pl13
24
-
25
-include $(INCLUDE_DIR)/package.mk
26
-
27
-define Package/gsm/Default
28
-  TITLE:=GSM transcoding
29
-  URL:=http://user.cs.tu-berlin.de/~jutta/toast.html
30
-endef
31
-
32
-define Package/gsm/description/Default
33
- An implementation of the European GSM 06.10 provisional standard
34
- for full-rate speech transcoding, prI-ETS 300 036, which uses
35
- RPE/LTP (residual pulse excitation/long term prediction) coding
36
- at 13 kbit/s.
37
-endef
38
-
39
-define Package/libgsm
40
-$(call Package/gsm/Default)
41
-  SECTION:=libs
42
-  CATEGORY:=Libraries
43
-  TITLE+= library
44
-endef
45
-
46
-define Package/libgsm/description
47
-$(call Package/gsm/description/Default)
48
- This package contains a shared GSM transcoding library, used by other
49
- programs.
50
-endef
51
-
52
-define Package/gsm-utils
53
-$(call Package/gsm/Default)
54
-  SECTION:=utils
55
-  CATEGORY:=Utilities
56
-  DEPENDS:=+libgsm
57
-  TITLE+= utilities
58
-endef
59
-
60
-define Package/gsm-utils/description
61
-$(call Package/gsm/description/Default)
62
- This package contains GSM transcoding utilities.
63
-endef
64
-
65
-define Build/Configure
66
-endef
67
-
68
-TARGET_CFLAGS += $(FPIC)
69
-
70
-define Build/Compile
71
-	$(MAKE) -C $(PKG_BUILD_DIR) \
72
-		$(TARGET_CONFIGURE_OPTS) \
73
-		LD="$(TARGET_CC)" \
74
-		COPTS="$(TARGET_CFLAGS)" \
75
-		INSTALL_ROOT="$(PKG_INSTALL_DIR)" \
76
-		all install
77
-endef
78
-
79
-define Package/libgsm/install
80
-	$(INSTALL_DIR) $(1)/usr/lib
81
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgsm.so.* $(1)/usr/lib/
82
-endef
83
-
84
-define Package/gsm-utils/install
85
-	$(INSTALL_DIR) $(1)/usr/bin
86
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/toast $(1)/usr/bin/
87
-	(cd $(1)/usr/bin; ln -sf toast untoast; ln -sf toast tcat)
88
-endef
89
-
90
-define Build/InstallDev
91
-	$(INSTALL_DIR) $(1)/usr/include/gsm
92
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/gsm.h $(1)/usr/include/gsm/
93
-	$(INSTALL_DIR) $(1)/usr/lib
94
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgsm.{a,so*} $(1)/usr/lib/
95
-endef
96
-
97
-$(eval $(call BuildPackage,libgsm))
98
-$(eval $(call BuildPackage,gsm-utils))

+ 0
- 428
libs/gsm/patches/001-debian-libsgm-1.0.10-13.patch 查看文件

@@ -1,428 +0,0 @@
1
---- a/Makefile
2
-+++ b/Makefile
3
-@@ -8,10 +8,12 @@ SASR	= -DSASR
4
- ######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1)
5
- 
6
- # MULHACK = -DUSE_FLOAT_MUL
7
-+MULHACK =
8
- ######### Define this if your host multiplies floats faster than integers,
9
- ######### e.g. on a SPARCstation.
10
- 
11
- # FAST	= -DFAST
12
-+FAST	=
13
- ######### Define together with USE_FLOAT_MUL to enable the GSM library's
14
- ######### approximation option for incorrect, but good-enough results.
15
- 
16
-@@ -22,8 +24,8 @@ LTP_CUT	=
17
- ######### both integer and floating point multiplications.
18
- ######### This flag is still in the experimental stage.
19
- 
20
--WAV49	= -DWAV49
21
--# WAV49	=
22
-+# WAV49	= -DWAV49
23
-+WAV49	=
24
- ######### Define to enable the GSM library's option to pack GSM frames 
25
- ######### in the style used by the WAV #49 format.  If you want to write
26
- ######### a tool that produces .WAV files which contain GSM-encoded data,
27
-@@ -44,7 +46,8 @@ WAV49	= -DWAV49
28
- # CCFLAGS 	= -c -O
29
- 
30
- CC		= gcc -ansi -pedantic
31
--CCFLAGS 	= -c -O2 -DNeedFunctionPrototypes=1
32
-+COPTS		= -O2
33
-+CCFLAGS 	= -c $(COPTS) -DNeedFunctionPrototypes=1
34
- 
35
- LD 		= $(CC)
36
- 
37
-@@ -78,10 +81,10 @@ INSTALL_ROOT	=
38
- # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
39
- # this directory.
40
- 
41
--GSM_INSTALL_ROOT = $(INSTALL_ROOT)
42
-+GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
43
- GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
44
--GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
45
--GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
46
-+GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
47
-+GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
48
- 
49
- 
50
- # Where do you want to install the toast binaries and their manpage?
51
-@@ -89,14 +92,14 @@ GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/ma
52
- # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
53
- # of this directory.
54
- 
55
--TOAST_INSTALL_ROOT	  = $(INSTALL_ROOT)
56
-+TOAST_INSTALL_ROOT	  = $(INSTALL_ROOT)/usr
57
- TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
58
--TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
59
-+TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
60
- 
61
- #  Other tools
62
- 
63
- SHELL		= /bin/sh
64
--LN		= ln
65
-+LN		= ln -s
66
- BASENAME 	= basename
67
- AR		= ar
68
- ARFLAGS		= cr
69
-@@ -126,7 +129,7 @@ INC	= $(ROOT)/inc
70
- 
71
- # Flags
72
- 
73
--# DEBUG	= -DNDEBUG
74
-+DEBUG	= -DNDEBUG
75
- ######### Remove -DNDEBUG to enable assertions.
76
- 
77
- CFLAGS	= $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
78
-@@ -140,6 +143,7 @@ LFLAGS	= $(LDFLAGS) $(LDINC)
79
- # Targets
80
- 
81
- LIBGSM	= $(LIB)/libgsm.a
82
-+LIBGSMSO= $(LIB)/libgsm.so
83
- 
84
- TOAST	= $(BIN)/toast
85
- UNTOAST	= $(BIN)/untoast
86
-@@ -258,6 +262,9 @@ STUFF = 	ChangeLog			\
87
- 
88
- GSM_INSTALL_TARGETS =	\
89
- 		$(GSM_INSTALL_LIB)/libgsm.a		\
90
-+		$(GSM_INSTALL_LIB)/libgsm.so		\
91
-+		$(GSM_INSTALL_LIB)/libgsm.so.1		\
92
-+		$(GSM_INSTALL_LIB)/libgsm.so.1.0.10	\
93
- 		$(GSM_INSTALL_INC)/gsm.h		\
94
- 		$(GSM_INSTALL_MAN)/gsm.3		\
95
- 		$(GSM_INSTALL_MAN)/gsm_explode.3	\
96
-@@ -279,7 +286,7 @@ TOAST_INSTALL_TARGETS =	\
97
- 
98
- # Target rules
99
- 
100
--all:		$(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
101
-+all:		$(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
102
- 		@-echo $(ROOT): Done.
103
- 
104
- tst:		$(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
105
-@@ -299,6 +306,11 @@ install:	toastinstall gsminstall
106
- 
107
- # The basic API: libgsm
108
- 
109
-+$(LIBGSMSO):	$(LIB) $(GSM_OBJECTS)
110
-+		$(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
111
-+		ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
112
-+		ln -fs libgsm.so.1.0.10 lib/libgsm.so
113
-+
114
- $(LIBGSM):	$(LIB) $(GSM_OBJECTS)
115
- 		-rm $(RMFLAGS) $(LIBGSM)
116
- 		$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
117
-@@ -308,15 +320,15 @@ $(LIBGSM):	$(LIB) $(GSM_OBJECTS)
118
- # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
119
- 
120
- $(TOAST):	$(BIN) $(TOAST_OBJECTS) $(LIBGSM)
121
--		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
122
-+		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
123
- 
124
- $(UNTOAST):	$(BIN) $(TOAST)
125
- 		-rm $(RMFLAGS) $(UNTOAST)
126
--		$(LN) $(TOAST) $(UNTOAST)
127
-+		$(LN) toast $(UNTOAST)
128
- 
129
- $(TCAT):	$(BIN) $(TOAST)
130
- 		-rm $(RMFLAGS) $(TCAT)
131
--		$(LN) $(TOAST) $(TCAT)
132
-+		$(LN) toast $(TCAT)
133
- 
134
- 
135
- # The local bin and lib directories
136
-@@ -351,53 +363,66 @@ toastuninstall:
137
- 		fi
138
- 
139
- $(TOAST_INSTALL_BIN)/toast:	$(TOAST)
140
--		-rm $@
141
--		cp $(TOAST) $@
142
-+		mkdir -p $(TOAST_INSTALL_BIN)
143
-+		cp -f $(TOAST) $@
144
- 		chmod 755 $@
145
- 
146
- $(TOAST_INSTALL_BIN)/untoast:	$(TOAST_INSTALL_BIN)/toast
147
--		-rm $@
148
--		ln $? $@
149
-+		mkdir -p $(TOAST_INSTALL_BIN)
150
-+		ln -sf $? $@
151
- 
152
- $(TOAST_INSTALL_BIN)/tcat:	$(TOAST_INSTALL_BIN)/toast
153
--		-rm $@
154
--		ln $? $@
155
-+		mkdir -p $(TOAST_INSTALL_BIN)
156
-+		ln -sf $? $@
157
- 
158
- $(TOAST_INSTALL_MAN)/toast.1:	$(MAN)/toast.1
159
--		-rm $@
160
--		cp $? $@
161
-+		mkdir -p $(TOAST_INSTALL_MAN)
162
-+		cp -f $? $@
163
- 		chmod 444 $@
164
- 
165
- $(GSM_INSTALL_MAN)/gsm.3:	$(MAN)/gsm.3
166
--		-rm $@
167
--		cp $? $@
168
-+		mkdir -p $(GSM_INSTALL_MAN)
169
-+		cp -f $? $@
170
- 		chmod 444 $@
171
- 
172
- $(GSM_INSTALL_MAN)/gsm_option.3:	$(MAN)/gsm_option.3
173
--		-rm $@
174
--		cp $? $@
175
-+		mkdir -p $(GSM_INSTALL_MAN)
176
-+		cp -f $? $@
177
- 		chmod 444 $@
178
- 
179
- $(GSM_INSTALL_MAN)/gsm_explode.3:	$(MAN)/gsm_explode.3
180
--		-rm $@
181
--		cp $? $@
182
-+		mkdir -p $(GSM_INSTALL_MAN)
183
-+		cp -f $? $@
184
- 		chmod 444 $@
185
- 
186
- $(GSM_INSTALL_MAN)/gsm_print.3:	$(MAN)/gsm_print.3
187
--		-rm $@
188
--		cp $? $@
189
-+		mkdir -p $(GSM_INSTALL_MAN)
190
-+		cp -f $? $@
191
- 		chmod 444 $@
192
- 
193
- $(GSM_INSTALL_INC)/gsm.h:	$(INC)/gsm.h
194
--		-rm $@
195
--		cp $? $@
196
-+		mkdir -p $(GSM_INSTALL_INC)
197
-+		cp -f $? $@
198
- 		chmod 444 $@
199
- 
200
- $(GSM_INSTALL_LIB)/libgsm.a:	$(LIBGSM)
201
--		-rm $@
202
--		cp $? $@
203
-+		mkdir -p $(GSM_INSTALL_LIB)
204
-+		cp -f $? $@
205
- 		chmod 444 $@
206
- 
207
-+$(GSM_INSTALL_LIB)/libgsm.so:	$(LIBGSMSO)
208
-+		mkdir -p $(GSM_INSTALL_LIB)
209
-+		cp -f $? $@
210
-+
211
-+$(GSM_INSTALL_LIB)/libgsm.so.1:	$(LIBGSMSO)
212
-+		mkdir -p $(GSM_INSTALL_LIB)
213
-+		cp -f $? $@
214
-+
215
-+$(GSM_INSTALL_LIB)/libgsm.so.1.0.10:	$(LIBGSMSO)
216
-+		mkdir -p $(GSM_INSTALL_LIB)
217
-+		cp -f $? $@
218
-+		chmod 755 $@
219
-+
220
- 
221
- # Distribution
222
- 
223
-@@ -426,7 +451,9 @@ semi-clean:
224
- 
225
- clean:	semi-clean
226
- 		-rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add		\
227
--			$(TOAST) $(TCAT) $(UNTOAST)	\
228
-+			$(LIBGSMSO) $(LIB)/libgsm.so.1.0.10	\
229
-+			$(LIB)libgsm.so.1			\
230
-+			$(TOAST) $(TCAT) $(UNTOAST)		\
231
- 			$(ROOT)/gsm-1.0.tar.Z
232
- 
233
- 
234
---- a/inc/config.h
235
-+++ b/inc/config.h
236
-@@ -9,8 +9,8 @@
237
- #ifndef	CONFIG_H
238
- #define	CONFIG_H
239
- 
240
--/*efine	SIGHANDLER_T	int 		/* signal handlers are void	*/
241
--/*efine HAS_SYSV_SIGNAL	1		/* sigs not blocked/reset?	*/
242
-+/*efine	SIGHANDLER_T	int 		*//* signal handlers are void	*/
243
-+/*efine HAS_SYSV_SIGNAL	1		*//* sigs not blocked/reset?	*/
244
- 
245
- #define	HAS_STDLIB_H	1		/* /usr/include/stdlib.h	*/
246
- #define	HAS_LIMITS_H	1		/* /usr/include/limits.h	*/
247
-@@ -22,16 +22,16 @@
248
- #define	HAS_CHMOD 	1		/* chmod syscall		*/
249
- #define	HAS_FCHOWN 	1		/* fchown syscall		*/
250
- #define	HAS_CHOWN 	1		/* chown syscall		*/
251
--/*efine	HAS__FSETMODE 	1		/* _fsetmode -- set file mode	*/
252
-+/*efine	HAS__FSETMODE 	1		*//* _fsetmode -- set file mode	*/
253
- 
254
- #define	HAS_STRING_H 	1		/* /usr/include/string.h 	*/
255
--/*efine	HAS_STRINGS_H	1		/* /usr/include/strings.h 	*/
256
-+/*efine	HAS_STRINGS_H	1		*//* /usr/include/strings.h 	*/
257
- 
258
- #define	HAS_UNISTD_H	1		/* /usr/include/unistd.h	*/
259
- #define	HAS_UTIME	1		/* POSIX utime(path, times)	*/
260
--/*efine	HAS_UTIMES	1		/* use utimes()	syscall instead	*/
261
-+/*efine	HAS_UTIMES	1		*//* use utimes()	syscall instead	*/
262
- #define	HAS_UTIME_H	1		/* UTIME header file		*/
263
- #define	HAS_UTIMBUF	1		/* struct utimbuf		*/
264
--/*efine	HAS_UTIMEUSEC   1		/* microseconds in utimbuf?	*/
265
-+/*efine	HAS_UTIMEUSEC   1		*//* microseconds in utimbuf?	*/
266
- 
267
- #endif	/* CONFIG_H */
268
---- a/inc/gsm.h
269
-+++ b/inc/gsm.h
270
-@@ -54,6 +54,10 @@ typedef gsm_byte 		gsm_frame[33];		/* 33
271
- #define	GSM_OPT_FRAME_INDEX	5
272
- #define	GSM_OPT_FRAME_CHAIN	6
273
- 
274
-+#ifdef __cplusplus
275
-+extern "C" {
276
-+#endif
277
-+
278
- extern gsm  gsm_create 	GSM_P((void));
279
- extern void gsm_destroy GSM_P((gsm));	
280
- 
281
-@@ -66,6 +70,10 @@ extern int  gsm_decode  GSM_P((gsm, gsm_
282
- extern int  gsm_explode GSM_P((gsm, gsm_byte   *, gsm_signal *));
283
- extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte   *));
284
- 
285
-+#ifdef __cplusplus
286
-+}
287
-+#endif
288
-+
289
- #undef	GSM_P
290
- 
291
- #endif	/* GSM_H */
292
---- a/inc/toast.h
293
-+++ b/inc/toast.h
294
-@@ -16,11 +16,12 @@
295
- 
296
- #include <stdio.h>
297
- #include <ctype.h>
298
-+#include <pthread.h>
299
- #include <signal.h>
300
- 
301
- #include <errno.h>
302
--#ifndef	HAS_ERRNO_DECL
303
--	 extern int	errno;
304
-+#ifndef errno
305
-+ extern int	errno;
306
- #endif
307
- 
308
- #ifdef	HAS_LIMITS_H
309
-@@ -37,6 +38,10 @@
310
- # endif
311
- #endif
312
- 
313
-+#ifdef  HAS_STDIO_H
314
-+# include <stdio.h>
315
-+#endif
316
-+
317
- #include "gsm.h"
318
- 
319
- #ifndef	S_ISREG
320
---- a/src/code.c
321
-+++ b/src/code.c
322
-@@ -9,8 +9,8 @@
323
- #include	"config.h"
324
- 
325
- 
326
--#ifdef	HAS_STDLIB_H
327
--#include	<stdlib.h>
328
-+#ifdef	HAS_STRING_H
329
-+#include	<string.h>
330
- #else
331
- #	include "proto.h"
332
- 	extern char	* memcpy P((char *, char *, int));
333
---- a/src/debug.c
334
-+++ b/src/debug.c
335
-@@ -49,7 +49,7 @@ void gsm_debug_longwords P4( (name, from
336
- 	fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
337
- 	while (from <= to) {
338
- 
339
--		fprintf(stderr, "%d ", ptr[ from ] );
340
-+		fprintf(stderr, "%ld ", ptr[ from ] );
341
- 		from++;
342
- 		if (nprinted++ >= 7) {
343
- 			nprinted = 0;
344
-@@ -63,14 +63,14 @@ void gsm_debug_longword P2(  (name, valu
345
- 	char		* name,
346
- 	longword	  value	)
347
- {
348
--	fprintf(stderr, "%s: %d\n", name, (long)value );
349
-+	fprintf(stderr, "%s: %ld\n", name, (long)value );
350
- }
351
- 
352
- void gsm_debug_word P2(  (name, value),
353
- 	char	* name,
354
- 	word	  value	)
355
- {
356
--	fprintf(stderr, "%s: %d\n", name, (long)value);
357
-+	fprintf(stderr, "%s: %ld\n", name, (long)value);
358
- }
359
- 
360
- #endif
361
---- a/src/toast.c
362
-+++ b/src/toast.c
363
-@@ -251,8 +251,8 @@ static char * emalloc P1((len), size_t l
364
- {
365
- 	char * s;
366
- 	if (!(s = malloc(len))) {
367
--		fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n",
368
--			progname, len);
369
-+		fprintf(stderr, "%s: failed to malloc %ld bytes -- abort\n",
370
-+			progname, (long) len);
371
- 		onintr();
372
- 		exit(1);
373
- 	}
374
-@@ -270,7 +270,7 @@ static char* normalname P3((name, want, 
375
- 	maxlen = strlen(name) + 1 + strlen(want) + strlen(cut);
376
- 	p = strcpy(emalloc(maxlen), name);
377
- 
378
--	if (s = suffix(p, cut)) strcpy(s, want);
379
-+	if ((s = suffix(p, cut))) strcpy(s, want);
380
- 	else if (*want && !suffix(p, want)) strcat(p, want);
381
- 
382
- 	return p;
383
-@@ -386,7 +386,7 @@ static void update_times P0()
384
- 		ut[0] = instat.st_atime;
385
- 		ut[1] = instat.st_mtime;
386
- 
387
--		(void) utime(outname, ut);
388
-+		(void) utime(outname, (struct utimbuf *)ut);
389
- 
390
- #endif	/* UTIMBUF */
391
- 	}
392
-@@ -416,7 +416,7 @@ static int okay_as_input P3((name,f,st),
393
- 	}
394
- 	if (st->st_nlink > 1 && !f_cat && !f_precious) {
395
- 		fprintf(stderr, 
396
--		      "%s: \"%s\" has %s other link%s -- unchanged.\n",
397
-+		      "%s: \"%s\" has %d other link%s -- unchanged.\n",
398
- 			progname,name,st->st_nlink - 1,"s" + (st->st_nlink<=2));
399
- 		return 0;
400
- 	}
401
-@@ -585,8 +585,8 @@ static int process_decode P0()
402
- 
403
- 		if (cc != sizeof(s)) {
404
- 			if (cc >= 0) fprintf(stderr,
405
--			"%s: incomplete frame (%d byte%s missing) from %s\n",
406
--					progname, sizeof(s) - cc,
407
-+			"%s: incomplete frame (%ld byte%s missing) from %s\n",
408
-+					progname, (long) sizeof(s) - cc,
409
- 					"s" + (sizeof(s) - cc == 1),
410
- 					inname ? inname : "stdin" );
411
- 			gsm_destroy(r);
412
-@@ -624,8 +624,6 @@ static int process_decode P0()
413
- 
414
- static int process P1((name), char * name)
415
- {
416
--	int step = 0;
417
--
418
- 	out     = (FILE *)0;
419
- 	in      = (FILE *)0;
420
- 
421
-@@ -779,7 +777,6 @@ int main P2((ac, av), int ac, char **av)
422
- 	case 'h': help();    exit(0);
423
- 
424
- 	default: 
425
--	usage:
426
- 		fprintf(stderr,
427
- 	"Usage: %s [-fcpdhvuaslFC] [files...] (-h for help)\n",
428
- 			progname);

+ 1
- 1
libs/tiff/Makefile 查看文件

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=tiff
11 11
 PKG_VERSION:=4.0.3
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://download.osgeo.org/libtiff

+ 31
- 0
libs/tiff/patches/010-CVE-2012-4564.patch 查看文件

@@ -0,0 +1,31 @@
1
+Index: tiff-4.0.3/tools/ppm2tiff.c
2
+===================================================================
3
+--- tiff-4.0.3.orig/tools/ppm2tiff.c	2013-06-23 10:36:50.779629492 -0400
4
++++ tiff-4.0.3/tools/ppm2tiff.c	2013-06-23 10:36:50.775629494 -0400
5
+@@ -89,6 +89,7 @@
6
+ 	int c;
7
+ 	extern int optind;
8
+ 	extern char* optarg;
9
++	tmsize_t scanline_size;
10
+ 
11
+ 	if (argc < 2) {
12
+ 	    fprintf(stderr, "%s: Too few arguments\n", argv[0]);
13
+@@ -237,8 +238,16 @@
14
+ 	}
15
+ 	if (TIFFScanlineSize(out) > linebytes)
16
+ 		buf = (unsigned char *)_TIFFmalloc(linebytes);
17
+-	else
18
+-		buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
19
++	else {
20
++		scanline_size = TIFFScanlineSize(out);
21
++		if (scanline_size != 0)
22
++			buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
23
++		else {
24
++			fprintf(stderr, "%s: scanline size overflow\n",infile);
25
++			(void) TIFFClose(out);
26
++			exit(-2);
27
++			}
28
++		}
29
+ 	if (resolution > 0) {
30
+ 		TIFFSetField(out, TIFFTAG_XRESOLUTION, resolution);
31
+ 		TIFFSetField(out, TIFFTAG_YRESOLUTION, resolution);

+ 146
- 0
libs/tiff/patches/011-CVE-2013-1960.patch 查看文件

@@ -0,0 +1,146 @@
1
+Index: tiff-4.0.3/tools/tiff2pdf.c
2
+===================================================================
3
+--- tiff-4.0.3.orig/tools/tiff2pdf.c	2013-06-23 10:36:50.979629486 -0400
4
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-06-23 10:36:50.975629486 -0400
5
+@@ -3341,33 +3341,56 @@
6
+ 	uint32 height){
7
+ 
8
+ 	tsize_t i=0;
9
+-	uint16 ri =0;
10
+-	uint16 v_samp=1;
11
+-	uint16 h_samp=1;
12
+-	int j=0;
13
+-	
14
+-	i++;
15
+-	
16
+-	while(i<(*striplength)){
17
++
18
++	while (i < *striplength) {
19
++		tsize_t datalen;
20
++		uint16 ri;
21
++		uint16 v_samp;
22
++		uint16 h_samp;
23
++		int j;
24
++		int ncomp;
25
++
26
++		/* marker header: one or more FFs */
27
++		if (strip[i] != 0xff)
28
++			return(0);
29
++		i++;
30
++		while (i < *striplength && strip[i] == 0xff)
31
++			i++;
32
++		if (i >= *striplength)
33
++			return(0);
34
++		/* SOI is the only pre-SOS marker without a length word */
35
++		if (strip[i] == 0xd8)
36
++			datalen = 0;
37
++		else {
38
++			if ((*striplength - i) <= 2)
39
++				return(0);
40
++			datalen = (strip[i+1] << 8) | strip[i+2];
41
++			if (datalen < 2 || datalen >= (*striplength - i))
42
++				return(0);
43
++		}
44
+ 		switch( strip[i] ){
45
+-			case 0xd8:
46
+-				/* SOI - start of image */
47
++			case 0xd8:	/* SOI - start of image */
48
+ 				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), 2);
49
+ 				*bufferoffset+=2;
50
+-				i+=2;
51
+ 				break;
52
+-			case 0xc0:
53
+-			case 0xc1:
54
+-			case 0xc3:
55
+-			case 0xc9:
56
+-			case 0xca:
57
++			case 0xc0:	/* SOF0 */
58
++			case 0xc1:	/* SOF1 */
59
++			case 0xc3:	/* SOF3 */
60
++			case 0xc9:	/* SOF9 */
61
++			case 0xca:	/* SOF10 */
62
+ 				if(no==0){
63
+-					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
64
+-					for(j=0;j<buffer[*bufferoffset+9];j++){
65
+-						if( (buffer[*bufferoffset+11+(2*j)]>>4) > h_samp) 
66
+-							h_samp = (buffer[*bufferoffset+11+(2*j)]>>4);
67
+-						if( (buffer[*bufferoffset+11+(2*j)] & 0x0f) > v_samp) 
68
+-							v_samp = (buffer[*bufferoffset+11+(2*j)] & 0x0f);
69
++					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
70
++					ncomp = buffer[*bufferoffset+9];
71
++					if (ncomp < 1 || ncomp > 4)
72
++						return(0);
73
++					v_samp=1;
74
++					h_samp=1;
75
++					for(j=0;j<ncomp;j++){
76
++						uint16 samp = buffer[*bufferoffset+11+(3*j)];
77
++						if( (samp>>4) > h_samp) 
78
++							h_samp = (samp>>4);
79
++						if( (samp & 0x0f) > v_samp) 
80
++							v_samp = (samp & 0x0f);
81
+ 					}
82
+ 					v_samp*=8;
83
+ 					h_samp*=8;
84
+@@ -3381,45 +3404,43 @@
85
+                                           (unsigned char) ((height>>8) & 0xff);
86
+ 					buffer[*bufferoffset+6]=
87
+                                             (unsigned char) (height & 0xff);
88
+-					*bufferoffset+=strip[i+2]+2;
89
+-					i+=strip[i+2]+2;
90
+-
91
++					*bufferoffset+=datalen+2;
92
++					/* insert a DRI marker */
93
+ 					buffer[(*bufferoffset)++]=0xff;
94
+ 					buffer[(*bufferoffset)++]=0xdd;
95
+ 					buffer[(*bufferoffset)++]=0x00;
96
+ 					buffer[(*bufferoffset)++]=0x04;
97
+ 					buffer[(*bufferoffset)++]=(ri >> 8) & 0xff;
98
+ 					buffer[(*bufferoffset)++]= ri & 0xff;
99
+-				} else {
100
+-					i+=strip[i+2]+2;
101
+ 				}
102
+ 				break;
103
+-			case 0xc4:
104
+-			case 0xdb:
105
+-				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
106
+-				*bufferoffset+=strip[i+2]+2;
107
+-				i+=strip[i+2]+2;
108
++			case 0xc4: /* DHT */
109
++			case 0xdb: /* DQT */
110
++				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
111
++				*bufferoffset+=datalen+2;
112
+ 				break;
113
+-			case 0xda:
114
++			case 0xda: /* SOS */
115
+ 				if(no==0){
116
+-					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
117
+-					*bufferoffset+=strip[i+2]+2;
118
+-					i+=strip[i+2]+2;
119
++					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
120
++					*bufferoffset+=datalen+2;
121
+ 				} else {
122
+ 					buffer[(*bufferoffset)++]=0xff;
123
+ 					buffer[(*bufferoffset)++]=
124
+                                             (unsigned char)(0xd0 | ((no-1)%8));
125
+-					i+=strip[i+2]+2;
126
+ 				}
127
+-				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), (*striplength)-i-1);
128
+-				*bufferoffset+=(*striplength)-i-1;
129
++				i += datalen + 1;
130
++				/* copy remainder of strip */
131
++				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i]), *striplength - i);
132
++				*bufferoffset+= *striplength - i;
133
+ 				return(1);
134
+ 			default:
135
+-				i+=strip[i+2]+2;
136
++				/* ignore any other marker */
137
++				break;
138
+ 		}
139
++		i += datalen + 1;
140
+ 	}
141
+-	
142
+ 
143
++	/* failed to find SOS marker */
144
+ 	return(0);
145
+ }
146
+ #endif

+ 768
- 0
libs/tiff/patches/012-CVE-2013-1961.patch 查看文件

@@ -0,0 +1,768 @@
1
+Index: tiff-4.0.3/contrib/dbs/xtiff/xtiff.c
2
+===================================================================
3
+--- tiff-4.0.3.orig/contrib/dbs/xtiff/xtiff.c	2013-06-23 10:36:51.163629483 -0400
4
++++ tiff-4.0.3/contrib/dbs/xtiff/xtiff.c	2013-06-23 10:36:51.147629484 -0400
5
+@@ -512,9 +512,9 @@
6
+     Arg args[1];
7
+ 
8
+     if (tfMultiPage)
9
+-        sprintf(buffer, "%s - page %d", fileName, tfDirectory);
10
++        snprintf(buffer, sizeof(buffer), "%s - page %d", fileName, tfDirectory);
11
+     else
12
+-        strcpy(buffer, fileName);
13
++        snprintf(buffer, sizeof(buffer), "%s", fileName);
14
+     XtSetArg(args[0], XtNlabel, buffer);
15
+     XtSetValues(labelWidget, args, 1);
16
+ }
17
+Index: tiff-4.0.3/libtiff/tif_dirinfo.c
18
+===================================================================
19
+--- tiff-4.0.3.orig/libtiff/tif_dirinfo.c	2013-06-23 10:36:51.163629483 -0400
20
++++ tiff-4.0.3/libtiff/tif_dirinfo.c	2013-06-23 10:36:51.147629484 -0400
21
+@@ -711,7 +711,7 @@
22
+ 	 * note that this name is a special sign to TIFFClose() and
23
+ 	 * _TIFFSetupFields() to free the field
24
+ 	 */
25
+-	sprintf(fld->field_name, "Tag %d", (int) tag);
26
++	snprintf(fld->field_name, 32, "Tag %d", (int) tag);
27
+ 
28
+ 	return fld;    
29
+ }
30
+Index: tiff-4.0.3/libtiff/tif_codec.c
31
+===================================================================
32
+--- tiff-4.0.3.orig/libtiff/tif_codec.c	2013-06-23 10:36:51.163629483 -0400
33
++++ tiff-4.0.3/libtiff/tif_codec.c	2013-06-23 10:36:51.151629482 -0400
34
+@@ -108,7 +108,8 @@
35
+ 	const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
36
+         char compression_code[20];
37
+         
38
+-        sprintf( compression_code, "%d", tif->tif_dir.td_compression );
39
++        snprintf(compression_code, sizeof(compression_code), "%d",
40
++		 tif->tif_dir.td_compression );
41
+ 	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
42
+                      "%s compression support is not configured", 
43
+                      c ? c->name : compression_code );
44
+Index: tiff-4.0.3/tools/tiffdither.c
45
+===================================================================
46
+--- tiff-4.0.3.orig/tools/tiffdither.c	2013-06-23 10:36:51.163629483 -0400
47
++++ tiff-4.0.3/tools/tiffdither.c	2013-06-23 10:36:51.151629482 -0400
48
+@@ -260,7 +260,7 @@
49
+ 		TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
50
+ 	else
51
+ 		CopyField(TIFFTAG_FILLORDER, shortv);
52
+-	sprintf(thing, "Dithered B&W version of %s", argv[optind]);
53
++	snprintf(thing, sizeof(thing), "Dithered B&W version of %s", argv[optind]);
54
+ 	TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
55
+ 	CopyField(TIFFTAG_PHOTOMETRIC, shortv);
56
+ 	CopyField(TIFFTAG_ORIENTATION, shortv);
57
+Index: tiff-4.0.3/tools/rgb2ycbcr.c
58
+===================================================================
59
+--- tiff-4.0.3.orig/tools/rgb2ycbcr.c	2013-06-23 10:36:51.163629483 -0400
60
++++ tiff-4.0.3/tools/rgb2ycbcr.c	2013-06-23 10:36:51.151629482 -0400
61
+@@ -332,7 +332,8 @@
62
+ 	TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
63
+ 	{ char buf[2048];
64
+ 	  char *cp = strrchr(TIFFFileName(in), '/');
65
+-	  sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in));
66
++	  snprintf(buf, sizeof(buf), "YCbCr conversion of %s",
67
++		   cp ? cp+1 : TIFFFileName(in));
68
+ 	  TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf);
69
+ 	}
70
+ 	TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
71
+Index: tiff-4.0.3/tools/tiff2pdf.c
72
+===================================================================
73
+--- tiff-4.0.3.orig/tools/tiff2pdf.c	2013-06-23 10:36:51.163629483 -0400
74
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-06-23 10:36:51.151629482 -0400
75
+@@ -3630,7 +3630,9 @@
76
+ 	char buffer[16];
77
+ 	int buflen=0;
78
+ 	
79
+-	buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
80
++	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",
81
++			  t2p->pdf_majorversion&0xff,
82
++			  t2p->pdf_minorversion&0xff);
83
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
84
+ 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
85
+ 
86
+@@ -3644,10 +3646,10 @@
87
+ tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
88
+ 
89
+ 	tsize_t written=0;
90
+-	char buffer[16];
91
++	char buffer[32];
92
+ 	int buflen=0;
93
+ 
94
+-	buflen=sprintf(buffer, "%lu", (unsigned long)number);
95
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
96
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
97
+ 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
98
+ 
99
+@@ -3686,13 +3688,13 @@
100
+ 	written += t2pWriteFile(output, (tdata_t) "/", 1);
101
+ 	for (i=0;i<namelen;i++){
102
+ 		if ( ((unsigned char)name[i]) < 0x21){
103
+-			sprintf(buffer, "#%.2X", name[i]);
104
++			snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
105
+ 			buffer[sizeof(buffer) - 1] = '\0';
106
+ 			written += t2pWriteFile(output, (tdata_t) buffer, 3);
107
+ 			nextchar=1;
108
+ 		}
109
+ 		if ( ((unsigned char)name[i]) > 0x7E){
110
+-			sprintf(buffer, "#%.2X", name[i]);
111
++			snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
112
+ 			buffer[sizeof(buffer) - 1] = '\0';
113
+ 			written += t2pWriteFile(output, (tdata_t) buffer, 3);
114
+ 			nextchar=1;
115
+@@ -3700,57 +3702,57 @@
116
+ 		if (nextchar==0){
117
+ 			switch (name[i]){
118
+ 				case 0x23:
119
+-					sprintf(buffer, "#%.2X", name[i]);
120
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
121
+ 					buffer[sizeof(buffer) - 1] = '\0';
122
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
123
+ 					break;
124
+ 				case 0x25:
125
+-					sprintf(buffer, "#%.2X", name[i]);
126
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
127
+ 					buffer[sizeof(buffer) - 1] = '\0';
128
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
129
+ 					break;
130
+ 				case 0x28:
131
+-					sprintf(buffer, "#%.2X", name[i]);
132
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
133
+ 					buffer[sizeof(buffer) - 1] = '\0';
134
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
135
+ 					break;
136
+ 				case 0x29:
137
+-					sprintf(buffer, "#%.2X", name[i]); 
138
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
139
+ 					buffer[sizeof(buffer) - 1] = '\0';
140
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
141
+ 					break;
142
+ 				case 0x2F:
143
+-					sprintf(buffer, "#%.2X", name[i]); 
144
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
145
+ 					buffer[sizeof(buffer) - 1] = '\0';
146
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
147
+ 					break;
148
+ 				case 0x3C:
149
+-					sprintf(buffer, "#%.2X", name[i]); 
150
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
151
+ 					buffer[sizeof(buffer) - 1] = '\0';
152
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
153
+ 					break;
154
+ 				case 0x3E:
155
+-					sprintf(buffer, "#%.2X", name[i]);
156
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
157
+ 					buffer[sizeof(buffer) - 1] = '\0';
158
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
159
+ 					break;
160
+ 				case 0x5B:
161
+-					sprintf(buffer, "#%.2X", name[i]); 
162
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
163
+ 					buffer[sizeof(buffer) - 1] = '\0';
164
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
165
+ 					break;
166
+ 				case 0x5D:
167
+-					sprintf(buffer, "#%.2X", name[i]);
168
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
169
+ 					buffer[sizeof(buffer) - 1] = '\0';
170
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
171
+ 					break;
172
+ 				case 0x7B:
173
+-					sprintf(buffer, "#%.2X", name[i]); 
174
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
175
+ 					buffer[sizeof(buffer) - 1] = '\0';
176
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
177
+ 					break;
178
+ 				case 0x7D:
179
+-					sprintf(buffer, "#%.2X", name[i]); 
180
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
181
+ 					buffer[sizeof(buffer) - 1] = '\0';
182
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
183
+ 					break;
184
+@@ -3865,14 +3867,14 @@
185
+ tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){
186
+ 	
187
+ 	tsize_t written=0;
188
+-	char buffer[16];
189
++	char buffer[32];
190
+ 	int buflen=0;
191
+ 	
192
+ 	written += t2pWriteFile(output, (tdata_t) "/Length ", 8);
193
+ 	if(len!=0){
194
+ 		written += t2p_write_pdf_stream_length(len, output);
195
+ 	} else {
196
+-		buflen=sprintf(buffer, "%lu", (unsigned long)number);
197
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
198
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
199
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
200
+ 	}
201
+@@ -3913,10 +3915,10 @@
202
+ tsize_t t2p_write_pdf_stream_length(tsize_t len, TIFF* output){
203
+ 
204
+ 	tsize_t written=0;
205
+-	char buffer[16];
206
++	char buffer[32];
207
+ 	int buflen=0;
208
+ 
209
+-	buflen=sprintf(buffer, "%lu", (unsigned long)len);
210
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)len);
211
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
212
+ 	written += t2pWriteFile(output, (tdata_t) "\n", 1);
213
+ 
214
+@@ -3930,7 +3932,7 @@
215
+ tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
216
+ {
217
+ 	tsize_t written = 0;
218
+-	char buffer[16];
219
++	char buffer[32];
220
+ 	int buflen = 0;
221
+ 
222
+ 	written += t2pWriteFile(output, 
223
+@@ -3969,7 +3971,6 @@
224
+ 		written += t2p_write_pdf_string(t2p->pdf_datetime, output);
225
+ 	}
226
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Producer ", 11);
227
+-	_TIFFmemset((tdata_t)buffer, 0x00, sizeof(buffer));
228
+ 	snprintf(buffer, sizeof(buffer), "libtiff / tiff2pdf - %d", TIFFLIB_VERSION);
229
+ 	written += t2p_write_pdf_string(buffer, output);
230
+ 	written += t2pWriteFile(output, (tdata_t) "\n", 1);
231
+@@ -4110,7 +4111,7 @@
232
+ {
233
+ 	tsize_t written=0;
234
+ 	tdir_t i=0;
235
+-	char buffer[16];
236
++	char buffer[32];
237
+ 	int buflen=0;
238
+ 
239
+ 	int page=0;
240
+@@ -4118,7 +4119,7 @@
241
+ 		(tdata_t) "<< \n/Type /Pages \n/Kids [ ", 26);
242
+ 	page = t2p->pdf_pages+1;
243
+ 	for (i=0;i<t2p->tiff_pagecount;i++){
244
+-		buflen=sprintf(buffer, "%d", page);
245
++		buflen=snprintf(buffer, sizeof(buffer), "%d", page);
246
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
247
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
248
+ 		if ( ((i+1)%8)==0 ) {
249
+@@ -4133,8 +4134,7 @@
250
+ 		}
251
+ 	}
252
+ 	written += t2pWriteFile(output, (tdata_t) "] \n/Count ", 10);
253
+-	_TIFFmemset(buffer, 0x00, 16);
254
+-	buflen=sprintf(buffer, "%d", t2p->tiff_pagecount);
255
++	buflen=snprintf(buffer, sizeof(buffer), "%d", t2p->tiff_pagecount);
256
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
257
+ 	written += t2pWriteFile(output, (tdata_t) " \n>> \n", 6);
258
+ 
259
+@@ -4149,28 +4149,28 @@
260
+ 
261
+ 	unsigned int i=0;
262
+ 	tsize_t written=0;
263
+-	char buffer[16];
264
++	char buffer[256];
265
+ 	int buflen=0;
266
+ 
267
+ 	written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24);
268
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_pages);
269
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
270
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
271
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
272
+ 	written += t2pWriteFile(output, (tdata_t) "/MediaBox [", 11); 
273
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x1);
274
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x1);
275
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
276
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
277
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y1);
278
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y1);
279
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
280
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
281
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x2);
282
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x2);
283
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
284
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
285
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y2);
286
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y2);
287
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
288
+ 	written += t2pWriteFile(output, (tdata_t) "] \n", 3); 
289
+ 	written += t2pWriteFile(output, (tdata_t) "/Contents ", 10);
290
+-	buflen=sprintf(buffer, "%lu", (unsigned long)(object + 1));
291
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(object + 1));
292
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
293
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
294
+ 	written += t2pWriteFile(output, (tdata_t) "/Resources << \n", 15);
295
+@@ -4178,15 +4178,13 @@
296
+ 		written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
297
+ 		for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i++){
298
+ 			written += t2pWriteFile(output, (tdata_t) "/Im", 3);
299
+-			buflen = sprintf(buffer, "%u", t2p->pdf_page+1);
300
++			buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
301
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
302
+ 			written += t2pWriteFile(output, (tdata_t) "_", 1);
303
+-			buflen = sprintf(buffer, "%u", i+1);
304
++			buflen = snprintf(buffer, sizeof(buffer), "%u", i+1);
305
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
306
+ 			written += t2pWriteFile(output, (tdata_t) " ", 1);
307
+-			buflen = sprintf(
308
+-				buffer, 
309
+-				"%lu", 
310
++			buflen = snprintf(buffer, sizeof(buffer), "%lu",
311
+ 				(unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); 
312
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
313
+ 			written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
314
+@@ -4198,12 +4196,10 @@
315
+ 	} else {
316
+ 			written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
317
+ 			written += t2pWriteFile(output, (tdata_t) "/Im", 3);
318
+-			buflen = sprintf(buffer, "%u", t2p->pdf_page+1);
319
++			buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
320
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
321
+ 			written += t2pWriteFile(output, (tdata_t) " ", 1);
322
+-			buflen = sprintf(
323
+-				buffer, 
324
+-				"%lu", 
325
++			buflen = snprintf(buffer, sizeof(buffer), "%lu",
326
+ 				(unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); 
327
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
328
+ 			written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
329
+@@ -4212,9 +4208,7 @@
330
+ 	if(t2p->tiff_transferfunctioncount != 0) {
331
+ 		written += t2pWriteFile(output, (tdata_t) "/ExtGState <<", 13);
332
+ 		t2pWriteFile(output, (tdata_t) "/GS1 ", 5);
333
+-		buflen = sprintf(
334
+-			buffer, 
335
+-			"%lu", 
336
++		buflen = snprintf(buffer, sizeof(buffer), "%lu",
337
+ 			(unsigned long)(object + 3)); 
338
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
339
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
340
+@@ -4587,7 +4581,7 @@
341
+ 	if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount>0){ 
342
+ 		for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount; i++){
343
+ 			box=t2p->tiff_tiles[t2p->pdf_page].tiles_tiles[i].tile_box;
344
+-			buflen=sprintf(buffer, 
345
++			buflen=snprintf(buffer, sizeof(buffer), 
346
+ 				"q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d_%ld Do Q\n", 
347
+ 				t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
348
+ 				box.mat[0],
349
+@@ -4602,7 +4596,7 @@
350
+ 		}
351
+ 	} else {
352
+ 		box=t2p->pdf_imagebox;
353
+-		buflen=sprintf(buffer, 
354
++		buflen=snprintf(buffer, sizeof(buffer), 
355
+ 			"q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n", 
356
+ 			t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
357
+ 			box.mat[0],
358
+@@ -4627,59 +4621,48 @@
359
+ 												TIFF* output){
360
+ 
361
+ 	tsize_t written=0;
362
+-	char buffer[16];
363
++	char buffer[32];
364
+ 	int buflen=0;
365
+ 
366
+ 	written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); 
367
+ 	written += t2pWriteFile(output, 
368
+ 		(tdata_t) "/Type /XObject \n/Subtype /Image \n/Name /Im", 
369
+ 		42);
370
+-	buflen=sprintf(buffer, "%u", t2p->pdf_page+1);
371
++	buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
372
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
373
+ 	if(tile != 0){
374
+ 		written += t2pWriteFile(output, (tdata_t) "_", 1);
375
+-		buflen=sprintf(buffer, "%lu", (unsigned long)tile);
376
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)tile);
377
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
378
+ 	}
379
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Width ", 8);
380
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
381
+ 	if(tile==0){
382
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_width);
383
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_width);
384
+ 	} else {
385
+ 		if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
386
+-			buflen=sprintf(
387
+-				buffer, 
388
+-				"%lu", 
389
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
390
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
391
+ 		} else {
392
+-			buflen=sprintf(
393
+-				buffer, 
394
+-				"%lu", 
395
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
396
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
397
+ 		}
398
+ 	}
399
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
400
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Height ", 9);
401
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
402
+ 	if(tile==0){
403
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_length);
404
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_length);
405
+ 	} else {
406
+ 		if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
407
+-			buflen=sprintf(
408
+-				buffer, 
409
+-				"%lu", 
410
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
411
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
412
+ 		} else {
413
+-			buflen=sprintf(
414
+-				buffer, 
415
+-				"%lu", 
416
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
417
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
418
+ 		}
419
+ 	}
420
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
421
+ 	written += t2pWriteFile(output, (tdata_t) "\n/BitsPerComponent ", 19);
422
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
423
+-	buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample);
424
++	buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
425
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
426
+ 	written += t2pWriteFile(output, (tdata_t) "\n/ColorSpace ", 13);
427
+ 	written += t2p_write_pdf_xobject_cs(t2p, output);
428
+@@ -4723,11 +4706,10 @@
429
+ 		t2p->pdf_colorspace ^= T2P_CS_PALETTE;
430
+ 		written += t2p_write_pdf_xobject_cs(t2p, output);
431
+ 		t2p->pdf_colorspace |= T2P_CS_PALETTE;
432
+-		buflen=sprintf(buffer, "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
433
++		buflen=snprintf(buffer, sizeof(buffer), "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
434
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
435
+ 		written += t2pWriteFile(output, (tdata_t) " ", 1);
436
+-		_TIFFmemset(buffer, 0x00, 16);
437
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_palettecs ); 
438
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_palettecs ); 
439
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
440
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ]\n", 7);
441
+ 		return(written);
442
+@@ -4761,10 +4743,10 @@
443
+ 			X_W /= Y_W;
444
+ 			Z_W /= Y_W;
445
+ 			Y_W = 1.0F;
446
+-			buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
447
++			buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
448
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
449
+ 			written += t2pWriteFile(output, (tdata_t) "/Range ", 7);
450
+-			buflen=sprintf(buffer, "[%d %d %d %d] \n", 
451
++			buflen=snprintf(buffer, sizeof(buffer), "[%d %d %d %d] \n", 
452
+ 				t2p->pdf_labrange[0], 
453
+ 				t2p->pdf_labrange[1], 
454
+ 				t2p->pdf_labrange[2], 
455
+@@ -4780,26 +4762,26 @@
456
+ tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){
457
+ 
458
+ 	tsize_t written=0;
459
+-	char buffer[16];
460
++	char buffer[32];
461
+ 	int buflen=0;
462
+ 
463
+ 	written += t2pWriteFile(output, (tdata_t) "<< /Type /ExtGState \n/TR ", 25);
464
+ 	if(t2p->tiff_transferfunctioncount == 1){
465
+-		buflen=sprintf(buffer, "%lu",
466
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
467
+ 			       (unsigned long)(t2p->pdf_xrefcount + 1));
468
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
469
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
470
+ 	} else {
471
+ 		written += t2pWriteFile(output, (tdata_t) "[ ", 2);
472
+-		buflen=sprintf(buffer, "%lu",
473
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
474
+ 			       (unsigned long)(t2p->pdf_xrefcount + 1));
475
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
476
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
477
+-		buflen=sprintf(buffer, "%lu",
478
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
479
+ 			       (unsigned long)(t2p->pdf_xrefcount + 2));
480
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
481
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
482
+-		buflen=sprintf(buffer, "%lu",
483
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
484
+ 			       (unsigned long)(t2p->pdf_xrefcount + 3));
485
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
486
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
487
+@@ -4821,7 +4803,7 @@
488
+ 	written += t2pWriteFile(output, (tdata_t) "/FunctionType 0 \n", 17);
489
+ 	written += t2pWriteFile(output, (tdata_t) "/Domain [0.0 1.0] \n", 19);
490
+ 	written += t2pWriteFile(output, (tdata_t) "/Range [0.0 1.0] \n", 18);
491
+-	buflen=sprintf(buffer, "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
492
++	buflen=snprintf(buffer, sizeof(buffer), "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
493
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
494
+ 	written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19);
495
+ 	written += t2p_write_pdf_stream_dict(((tsize_t)1)<<(t2p->tiff_bitspersample+1), 0, output);
496
+@@ -4848,7 +4830,7 @@
497
+ tsize_t t2p_write_pdf_xobject_calcs(T2P* t2p, TIFF* output){
498
+ 
499
+ 	tsize_t written=0;
500
+-	char buffer[128];
501
++	char buffer[256];
502
+ 	int buflen=0;
503
+ 	
504
+ 	float X_W=0.0;
505
+@@ -4916,16 +4898,16 @@
506
+ 	written += t2pWriteFile(output, (tdata_t) "<< \n", 4);
507
+ 	if(t2p->pdf_colorspace & T2P_CS_CALGRAY){
508
+ 		written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12);
509
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
510
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
511
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
512
+ 		written += t2pWriteFile(output, (tdata_t) "/Gamma 2.2 \n", 12);
513
+ 	}
514
+ 	if(t2p->pdf_colorspace & T2P_CS_CALRGB){
515
+ 		written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12);
516
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
517
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
518
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
519
+ 		written += t2pWriteFile(output, (tdata_t) "/Matrix ", 8);
520
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", 
521
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", 
522
+ 			X_R, Y_R, Z_R, 
523
+ 			X_G, Y_G, Z_G, 
524
+ 			X_B, Y_B, Z_B); 
525
+@@ -4944,11 +4926,11 @@
526
+ tsize_t t2p_write_pdf_xobject_icccs(T2P* t2p, TIFF* output){
527
+ 
528
+ 	tsize_t written=0;
529
+-	char buffer[16];
530
++	char buffer[32];
531
+ 	int buflen=0;
532
+ 	
533
+ 	written += t2pWriteFile(output, (tdata_t) "[/ICCBased ", 11);
534
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_icccs);
535
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_icccs);
536
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
537
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R] \n", 7);
538
+ 
539
+@@ -4958,11 +4940,11 @@
540
+ tsize_t t2p_write_pdf_xobject_icccs_dict(T2P* t2p, TIFF* output){
541
+ 
542
+ 	tsize_t written=0;
543
+-	char buffer[16];
544
++	char buffer[32];
545
+ 	int buflen=0;
546
+ 	
547
+ 	written += t2pWriteFile(output, (tdata_t) "/N ", 3);
548
+-	buflen=sprintf(buffer, "%u \n", t2p->tiff_samplesperpixel);
549
++	buflen=snprintf(buffer, sizeof(buffer), "%u \n", t2p->tiff_samplesperpixel);
550
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
551
+ 	written += t2pWriteFile(output, (tdata_t) "/Alternate ", 11);
552
+ 	t2p->pdf_colorspace ^= T2P_CS_ICCBASED;
553
+@@ -5027,7 +5009,7 @@
554
+ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output){
555
+ 
556
+ 	tsize_t written=0;
557
+-	char buffer[16];
558
++	char buffer[32];
559
+ 	int buflen=0;
560
+ 
561
+ 	if(t2p->pdf_compression==T2P_COMPRESS_NONE){
562
+@@ -5042,41 +5024,33 @@
563
+ 			written += t2pWriteFile(output, (tdata_t) "<< /K -1 ", 9);
564
+ 			if(tile==0){
565
+ 				written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
566
+-				buflen=sprintf(buffer, "%lu",
567
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
568
+ 					       (unsigned long)t2p->tiff_width);
569
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
570
+ 				written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
571
+-				buflen=sprintf(buffer, "%lu",
572
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
573
+ 					       (unsigned long)t2p->tiff_length);
574
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
575
+ 			} else {
576
+ 				if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
577
+ 					written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
578
+-					buflen=sprintf(
579
+-						buffer, 
580
+-						"%lu", 
581
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
582
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
583
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
584
+ 				} else {
585
+ 					written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
586
+-					buflen=sprintf(
587
+-						buffer, 
588
+-						"%lu", 
589
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
590
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
591
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
592
+ 				}
593
+ 				if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
594
+ 					written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
595
+-					buflen=sprintf(
596
+-						buffer, 
597
+-						"%lu", 
598
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
599
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
600
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
601
+ 				} else {
602
+ 					written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
603
+-					buflen=sprintf(
604
+-						buffer, 
605
+-						"%lu", 
606
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
607
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
608
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
609
+ 				}
610
+@@ -5103,21 +5077,17 @@
611
+ 			if(t2p->pdf_compressionquality%100){
612
+ 				written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13);
613
+ 				written += t2pWriteFile(output, (tdata_t) "<< /Predictor ", 14);
614
+-				_TIFFmemset(buffer, 0x00, 16);
615
+-				buflen=sprintf(buffer, "%u", t2p->pdf_compressionquality%100);
616
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_compressionquality%100);
617
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
618
+ 				written += t2pWriteFile(output, (tdata_t) " /Columns ", 10);
619
+-				_TIFFmemset(buffer, 0x00, 16);
620
+-				buflen = sprintf(buffer, "%lu",
621
++				buflen = snprintf(buffer, sizeof(buffer), "%lu",
622
+ 						 (unsigned long)t2p->tiff_width);
623
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
624
+ 				written += t2pWriteFile(output, (tdata_t) " /Colors ", 9);
625
+-				_TIFFmemset(buffer, 0x00, 16);
626
+-				buflen=sprintf(buffer, "%u", t2p->tiff_samplesperpixel);
627
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_samplesperpixel);
628
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
629
+ 				written += t2pWriteFile(output, (tdata_t) " /BitsPerComponent ", 19);
630
+-				_TIFFmemset(buffer, 0x00, 16);
631
+-				buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample);
632
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
633
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
634
+ 				written += t2pWriteFile(output, (tdata_t) ">>\n", 3);
635
+ 			}
636
+@@ -5137,16 +5107,16 @@
637
+ tsize_t t2p_write_pdf_xreftable(T2P* t2p, TIFF* output){
638
+ 
639
+ 	tsize_t written=0;
640
+-	char buffer[21];
641
++	char buffer[64];
642
+ 	int buflen=0;
643
+ 	uint32 i=0;
644
+ 
645
+ 	written += t2pWriteFile(output, (tdata_t) "xref\n0 ", 7);
646
+-	buflen=sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
647
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
648
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
649
+ 	written += t2pWriteFile(output, (tdata_t) " \n0000000000 65535 f \n", 22);
650
+ 	for (i=0;i<t2p->pdf_xrefcount;i++){
651
+-		sprintf(buffer, "%.10lu 00000 n \n",
652
++		snprintf(buffer, sizeof(buffer), "%.10lu 00000 n \n",
653
+ 			(unsigned long)t2p->pdf_xrefoffsets[i]);
654
+ 		written += t2pWriteFile(output, (tdata_t) buffer, 20);
655
+ 	}
656
+@@ -5170,17 +5140,14 @@
657
+ 		snprintf(t2p->pdf_fileid + i, 9, "%.8X", rand());
658
+ 
659
+ 	written += t2pWriteFile(output, (tdata_t) "trailer\n<<\n/Size ", 17);
660
+-	buflen = sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
661
++	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
662
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
663
+-	_TIFFmemset(buffer, 0x00, 32);	
664
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Root ", 7);
665
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_catalog);
666
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_catalog);
667
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
668
+-	_TIFFmemset(buffer, 0x00, 32);	
669
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n/Info ", 12);
670
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_info);
671
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_info);
672
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
673
+-	_TIFFmemset(buffer, 0x00, 32);	
674
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n/ID[<", 11);
675
+ 	written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
676
+ 				sizeof(t2p->pdf_fileid) - 1);
677
+@@ -5188,9 +5155,8 @@
678
+ 	written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
679
+ 				sizeof(t2p->pdf_fileid) - 1);
680
+ 	written += t2pWriteFile(output, (tdata_t) ">]\n>>\nstartxref\n", 16);
681
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_startxref);
682
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_startxref);
683
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
684
+-	_TIFFmemset(buffer, 0x00, 32);	
685
+ 	written += t2pWriteFile(output, (tdata_t) "\n%%EOF\n", 7);
686
+ 
687
+ 	return(written);
688
+Index: tiff-4.0.3/tools/tiff2ps.c
689
+===================================================================
690
+--- tiff-4.0.3.orig/tools/tiff2ps.c	2013-06-23 10:36:51.163629483 -0400
691
++++ tiff-4.0.3/tools/tiff2ps.c	2013-06-23 10:36:51.155629481 -0400
692
+@@ -1781,8 +1781,8 @@
693
+ 		imageOp = "imagemask";
694
+ 
695
+ 	(void)strcpy(im_x, "0");
696
+-	(void)sprintf(im_y, "%lu", (long) h);
697
+-	(void)sprintf(im_h, "%lu", (long) h);
698
++	(void)snprintf(im_y, sizeof(im_y), "%lu", (long) h);
699
++	(void)snprintf(im_h, sizeof(im_h), "%lu", (long) h);
700
+ 	tile_width = w;
701
+ 	tile_height = h;
702
+ 	if (TIFFIsTiled(tif)) {
703
+@@ -1803,7 +1803,7 @@
704
+ 		}
705
+ 		if (tile_height < h) {
706
+ 			fputs("/im_y 0 def\n", fd);
707
+-			(void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
708
++			(void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
709
+ 		}
710
+ 	} else {
711
+ 		repeat_count = tf_numberstrips;
712
+@@ -1815,7 +1815,7 @@
713
+ 			fprintf(fd, "/im_h %lu def\n",
714
+ 			    (unsigned long) tile_height);
715
+ 			(void)strcpy(im_h, "im_h");
716
+-			(void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
717
++			(void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
718
+ 		}
719
+ 	}
720
+ 
721
+Index: tiff-4.0.3/tools/tiffcrop.c
722
+===================================================================
723
+--- tiff-4.0.3.orig/tools/tiffcrop.c	2013-06-23 10:36:51.163629483 -0400
724
++++ tiff-4.0.3/tools/tiffcrop.c	2013-06-23 10:36:51.159629481 -0400
725
+@@ -2077,7 +2077,7 @@
726
+         return 1;
727
+         }
728
+ 
729
+-      sprintf (filenum, "-%03d%s", findex, export_ext);
730
++      snprintf(filenum, sizeof(filenum), "-%03d%s", findex, export_ext);
731
+       filenum[14] = '\0';
732
+       strncat (exportname, filenum, 15);
733
+       }
734
+@@ -2230,8 +2230,8 @@
735
+ 
736
+           /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes 
737
+              fewer than PATH_MAX */ 
738
+-          memset (temp_filename, '\0', PATH_MAX + 1);              
739
+-          sprintf (temp_filename, "%s-read-%03d.%s", dump.infilename, dump_images,
740
++          snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s",
741
++		   dump.infilename, dump_images,
742
+                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
743
+           if ((dump.infile = fopen(temp_filename, dump.mode)) == NULL)
744
+             {
745
+@@ -2249,8 +2249,8 @@
746
+ 
747
+           /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes 
748
+              fewer than PATH_MAX */ 
749
+-          memset (temp_filename, '\0', PATH_MAX + 1);              
750
+-          sprintf (temp_filename, "%s-write-%03d.%s", dump.outfilename, dump_images,
751
++          snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s",
752
++		   dump.outfilename, dump_images,
753
+                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
754
+           if ((dump.outfile = fopen(temp_filename, dump.mode)) == NULL)
755
+             {
756
+Index: tiff-4.0.3/tools/tiff2bw.c
757
+===================================================================
758
+--- tiff-4.0.3.orig/tools/tiff2bw.c	2013-06-23 10:36:51.163629483 -0400
759
++++ tiff-4.0.3/tools/tiff2bw.c	2013-06-23 10:36:51.159629481 -0400
760
+@@ -205,7 +205,7 @@
761
+ 		}
762
+ 	}
763
+ 	TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
764
+-	sprintf(thing, "B&W version of %s", argv[optind]);
765
++	snprintf(thing, sizeof(thing), "B&W version of %s", argv[optind]);
766
+ 	TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
767
+ 	TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw");
768
+ 	outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));

+ 17
- 0
libs/tiff/patches/013-CVE-2013-4231.patch 查看文件

@@ -0,0 +1,17 @@
1
+Description: Buffer overflow in gif2tiff
2
+Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2450
3
+Bug-Debian: http://bugs.debian.org/719303
4
+
5
+Index: tiff-4.0.3/tools/gif2tiff.c
6
+===================================================================
7
+--- tiff-4.0.3.orig/tools/gif2tiff.c	2013-08-22 11:46:11.960846910 -0400
8
++++ tiff-4.0.3/tools/gif2tiff.c	2013-08-22 11:46:11.956846910 -0400
9
+@@ -333,6 +333,8 @@
10
+     int status = 1;
11
+ 
12
+     datasize = getc(infile);
13
++    if (datasize > 12)
14
++	return 0;
15
+     clear = 1 << datasize;
16
+     eoi = clear + 1;
17
+     avail = clear + 2;

+ 18
- 0
libs/tiff/patches/014-CVE-2013-4232.patch 查看文件

@@ -0,0 +1,18 @@
1
+Description: use after free in tiff2pdf
2
+Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2449
3
+Bug-Debian: http://bugs.debian.org/719303
4
+
5
+Index: tiff-4.0.3/tools/tiff2pdf.c
6
+===================================================================
7
+--- tiff-4.0.3.orig/tools/tiff2pdf.c	2013-08-22 11:46:37.292847242 -0400
8
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-08-22 11:46:37.292847242 -0400
9
+@@ -2461,7 +2461,8 @@
10
+ 					(unsigned long) t2p->tiff_datasize, 
11
+ 					TIFFFileName(input));
12
+ 				t2p->t2p_error = T2P_ERR_ERROR;
13
+-			  _TIFFfree(buffer);
14
++				_TIFFfree(buffer);
15
++				return(0);
16
+ 			} else {
17
+ 				buffer=samplebuffer;
18
+ 				t2p->tiff_datasize *= t2p->tiff_samplesperpixel;

+ 18
- 0
libs/tiff/patches/015-CVE-2013-4244.patch 查看文件

@@ -0,0 +1,18 @@
1
+Description: OOB write in gif2tiff
2
+Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=996468
3
+
4
+Index: tiff-4.0.3/tools/gif2tiff.c
5
+===================================================================
6
+--- tiff-4.0.3.orig/tools/gif2tiff.c	2013-08-24 11:17:13.546447901 -0400
7
++++ tiff-4.0.3/tools/gif2tiff.c	2013-08-24 11:17:13.546447901 -0400
8
+@@ -400,6 +400,10 @@
9
+     }
10
+ 
11
+     if (oldcode == -1) {
12
++        if (code >= clear) {
13
++            fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
14
++            return 0;
15
++        }
16
+ 	*(*fill)++ = suffix[code];
17
+ 	firstchar = oldcode = code;
18
+ 	return 1;

+ 37
- 0
libs/tiff/patches/016-CVE-2013-4243.patch 查看文件

@@ -0,0 +1,37 @@
1
+Index: tiff/tools/gif2tiff.c
2
+===================================================================
3
+--- tiff.orig/tools/gif2tiff.c
4
++++ tiff/tools/gif2tiff.c
5
+@@ -280,6 +280,10 @@ readgifimage(char* mode)
6
+         fprintf(stderr, "no colormap present for image\n");
7
+         return (0);
8
+     }
9
++    if (width == 0 || height == 0) {
10
++        fprintf(stderr, "Invalid value of width or height\n");
11
++        return(0);
12
++    }
13
+     if ((raster = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) {
14
+         fprintf(stderr, "not enough memory for image\n");
15
+         return (0);
16
+@@ -404,6 +408,10 @@ process(register int code, unsigned char
17
+             fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
18
+             return 0;
19
+         }
20
++        if (*fill >= raster + width*height) {
21
++            fprintf(stderr, "raster full before eoi code\n");
22
++            return 0;
23
++        }
24
+ 	*(*fill)++ = suffix[code];
25
+ 	firstchar = oldcode = code;
26
+ 	return 1;
27
+@@ -434,6 +442,10 @@ process(register int code, unsigned char
28
+     }
29
+     oldcode = incode;
30
+     do {
31
++        if (*fill >= raster + width*height) {
32
++            fprintf(stderr, "raster full before eoi code\n");
33
++            return 0;
34
++        }
35
+ 	*(*fill)++ = *--stackp;
36
+     } while (stackp > stack);
37
+     return 1;

+ 4
- 0
multimedia/minidlna/Makefile 查看文件

@@ -14,7 +14,11 @@ PKG_RELEASE:=1
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=@SF/minidlna
16 16
 PKG_MD5SUM:=879027192c89e5376cdd2ae2d1aa33b4
17
+
17 18
 PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
19
+
20
+PKG_LICENSE:=GPL-2.0
21
+PKG_LICENSE_FILE:=COPYING
18 22
 PKG_BUILD_PARALLEL:=0
19 23
 PKG_BUILD_DEPENDS:=util-linux
20 24
 

+ 12
- 0
multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch 查看文件

@@ -0,0 +1,12 @@
1
+--- a/upnphttp.c
2
++++ b/upnphttp.c
3
+@@ -1259,7 +1259,7 @@
4
+ 	int try_sendfile = 1;
5
+ #endif
6
+ 
7
+-	while( offset < end_offset )
8
++	while( offset <= end_offset )
9
+ 	{
10
+ #if HAVE_SENDFILE
11
+ 		if( try_sendfile )
12
+

+ 1
- 1
multimedia/mjpg-streamer/Makefile 查看文件

@@ -13,7 +13,7 @@ PKG_VERSION:=r$(PKG_REV)
13 13
 PKG_RELEASE:=1
14 14
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
15 15
 
16
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
17 17
 PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
18 18
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 19
 PKG_SOURCE_VERSION:=$(PKG_REV)

+ 63
- 0
net/dhcpcd/Makefile 查看文件

@@ -0,0 +1,63 @@
1
+#
2
+# Copyright (C) 2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=dhcpcd
11
+PKG_VERSION:=6.4.3
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE_URL:=ftp://roy.marples.name/pub/dhcpcd \
15
+    http://roy.marples.name/downloads/dhcpcd
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17
+PKG_MD5SUM:=b22005c131e7108ecf598b6a4ac091eb
18
+
19
+PKG_LICENSE:=BSD-2c
20
+PKG_LICENSE_FILES:=
21
+
22
+PKG_MAINTAINER:=Roy Marples <roy@marples.name>
23
+
24
+PKG_BUILD_PARALLEL:=1
25
+PKG_INSTALL:=1
26
+
27
+include $(INCLUDE_DIR)/package.mk
28
+
29
+define Package/dhcpcd
30
+  SECTION:=net
31
+  CATEGORY:=Network
32
+  TITLE:=DHCPv4/IPv4LL/IPv6RS/DHCPv6 quad stack client
33
+  URL:=http://roy.marples.name/projects/dhcpcd
34
+endef
35
+
36
+define Package/dhcpcd/description
37
+  DHCPv4, IPv6RS and DHCPv6 client with IPv4LL support
38
+  dhcpcd is a one stop network management daemon which includes
39
+    * RFC compliant DHCPv4 and DHCPv6 clients
40
+    * DHCPv6 Prefix Delegation support
41
+    * IPv4LL (aka ZeroConf) support
42
+    * ARP address conflict resolution
43
+    * Link carrier detection
44
+    * Wireless SSID profiles
45
+    * ARP ping profiles
46
+endef
47
+
48
+CONFIGURE_ARGS+=	--prefix=/ --sbindir=/sbin \
49
+			--libexecdir=/lib/dhcpcd --dbdir=/var/dhcpcd
50
+
51
+define Package/dhcpcd/install
52
+	$(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/dhcpcd/dhcpcd-hooks
53
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/dhcpcd $(1)/sbin/
54
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/dhcpcd/dhcpcd-run-hooks \
55
+	    $(1)/lib/dhcpcd/
56
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/dhcpcd/dhcpcd-hooks/* \
57
+	    $(1)/lib/dhcpcd/dhcpcd-hooks/
58
+	$(INSTALL_DIR) $(1)/etc/init.d
59
+	$(INSTALL_BIN) ./files/dhcpcd.init $(1)/etc/init.d/dhcpcd
60
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/dhcpcd.conf $(1)/etc/dhcpcd.conf
61
+endef
62
+
63
+$(eval $(call BuildPackage,dhcpcd))

+ 24
- 0
net/dhcpcd/files/dhcpcd.init 查看文件

@@ -0,0 +1,24 @@
1
+#!/bin/sh /etc/rc.common
2
+#
3
+# Copyright (C) 2014 OpenWrt.org
4
+#
5
+# This is free software, licensed under the GNU General Public License v2.
6
+# See /LICENSE for more information.
7
+#
8
+
9
+START=30
10
+STOP=85
11
+USE_PROCD=1
12
+
13
+start_service()
14
+{
15
+	procd_open_instance
16
+	procd_set_param command /sbin/dhcpcd -B
17
+	procd_set_param respawn
18
+	procd_close_instance
19
+}
20
+
21
+reload_service()
22
+{
23
+	/sbin/dhcpcd -n
24
+}

+ 45
- 0
net/horst/Makefile 查看文件

@@ -0,0 +1,45 @@
1
+#
2
+# Copyright (C) 2006 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=horst
11
+PKG_VERSION:=4.0
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-git.tar.gz
15
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16
+PKG_SOURCE_URL:=git://br1.einfach.org/horst
17
+PKG_SOURCE_PROTO:=git
18
+PKG_SOURCE_VERSION:=version-4.0
19
+
20
+PKG_BUILD_PARALLEL:=1
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+define Package/horst
25
+	SECTION:=net
26
+	CATEGORY:=Network
27
+	SUBMENU:=wireless
28
+	DEPENDS:=+libncurses
29
+	MAINTAINER:=Bruno Randolf <br1@einfach.org>
30
+	TITLE:=Highly Optimized 802.11 Radio Scanning Tool
31
+	URL:=http://br1.einfach.org/tech/horst/
32
+endef
33
+
34
+define Package/horst/description
35
+	[horst] is a scanning and analysis tool for 802.11 wireless networks
36
+	and especially IBSS (ad-hoc) mode and mesh networks (OLSR).
37
+endef
38
+
39
+define Package/horst/install
40
+	$(INSTALL_DIR) $(1)/usr/sbin
41
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/horst $(1)/usr/sbin/
42
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/horst.sh $(1)/usr/sbin/
43
+endef
44
+
45
+$(eval $(call BuildPackage,horst))

+ 1
- 1
net/nginx/Makefile 查看文件

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=nginx
11 11
 PKG_VERSION:=1.4.7
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://nginx.org/download/

+ 0
- 11
net/nginx/patches/400-nginx-1.4.x_proxy_protocol_patch_v2.patch 查看文件

@@ -882,17 +882,6 @@ Index: nginx-1.4.7/src/http/ngx_http_request.c
882 882
  
883 883
  #if (NGX_HTTP_SSL)
884 884
  
885
-@@ -1291,6 +1368,10 @@ ngx_http_read_request_header(ngx_http_re
886
-     c = r->connection;
887
-     rev = c->read;
888
- 
889
-+fprintf(stderr, "DEBUG: pos: %p, last: %p, start: %p, end: %p\n",
890
-+		r->header_in->pos, r->header_in->last, r->header_in->start,
891
-+		r->header_in->end);
892
-+
893
-     n = r->header_in->last - r->header_in->pos;
894
- 
895
-     if (n > 0) {
896 885
 Index: nginx-1.4.7/src/http/ngx_http_upstream.c
897 886
 ===================================================================
898 887
 --- nginx-1.4.7.orig/src/http/ngx_http_upstream.c

+ 0
- 26
net/ocserv/files/ocserv.init 查看文件

@@ -4,30 +4,6 @@ SERVICE_USE_PID=1
4 4
 
5 5
 START=50
6 6
 
7
-setup_firewall() {
8
-	local port fw
9
-	config_get port	$1 port
10
-	test -z "$port" && return
11
-
12
-	config_get fwport $1 fwport
13
-	test "$fwport" = "$port" && return
14
-
15
-	logger -t ocserv "opening port $port..."
16
-	#can we remove the old rule?
17
-	uci add firewall rule
18
-	uci set firewall.@rule[-1].src=wan
19
-	uci set firewall.@rule[-1].name="ocserv-ext-port"
20
-	uci set firewall.@rule[-1].target=ACCEPT
21
-	uci set firewall.@rule[-1].proto=tcpudp
22
-	uci set firewall.@rule[-1].dest_port=$port
23
-	uci commit firewall
24
-
25
-	uci set ocserv.config.fwport="$port"
26
-	uci commit ocserv
27
-
28
-	/etc/init.d/firewall restart
29
-}
30
-
31 7
 setup_config() {
32 8
 	config_get port         $1 port "4443"
33 9
 	config_get max_clients  $1 max_clients "8"
@@ -170,8 +146,6 @@ start() {
170 146
 	chmod 600 /var/etc/ocpasswd
171 147
 	config_foreach setup_users ocservusers
172 148
 
173
-	setup_firewall config
174
-
175 149
 	service_start /usr/sbin/ocserv -c /var/etc/ocserv.conf
176 150
 }
177 151
 

+ 59
- 0
net/p910nd/Makefile 查看文件

@@ -0,0 +1,59 @@
1
+#
2
+# Copyright (C) 2009-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=p910nd
11
+PKG_VERSION:=0.97
12
+PKG_RELEASE:=4
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
+PKG_SOURCE_URL:=@SF/p910nd
16
+PKG_LICENSE:=GPLv2
17
+PKG_LICENSE_FILES:=COPYING
18
+PKG_MD5SUM:=69461a6c54dca0b13ecad5b83864b43e
19
+PKG_MAINTAINER:=Philipp Kerling <pkerling@casix.org>
20
+
21
+PKG_INSTALL:=1
22
+
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+define Package/p910nd
26
+  SECTION:=net
27
+  CATEGORY:=Network
28
+  SUBMENU:=Printing
29
+  TITLE:=A small non-spooling printer server
30
+  URL:=http://p910nd.sourceforge.net
31
+endef
32
+
33
+define Package/p910nd/conffiles
34
+/etc/config/p910nd
35
+endef
36
+
37
+define Package/p910nd/description
38
+ p910nd is a small daemon that copies any data received on
39
+ the port it is listening on to the corresponding printer
40
+ port. It is primarily intended for diskless Linux hosts
41
+ running as printer drivers but there is no reason why it
42
+ could not be used on diskful hosts. Port 9100 is copied
43
+ to /dev/lp0, 9101 to /dev/lp1 and 9102 to /dev/lp2. The
44
+ default is port 9100 to /dev/lp0.
45
+endef
46
+
47
+MAKE_FLAGS += \
48
+	CFLAGS="$(TARGET_CFLAGS) -DLOCKFILE_DIR=\"\\\"/tmp\"\\\""
49
+
50
+define Package/p910nd/install
51
+	$(INSTALL_DIR) $(1)/usr/sbin
52
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/p910nd $(1)/usr/sbin/
53
+	$(INSTALL_DIR) $(1)/etc/config
54
+	$(INSTALL_DATA) ./files/p910nd.config $(1)/etc/config/p910nd
55
+	$(INSTALL_DIR) $(1)/etc/init.d
56
+	$(INSTALL_BIN) ./files/p910nd.init $(1)/etc/init.d/p910nd
57
+endef
58
+
59
+$(eval $(call BuildPackage,p910nd))

+ 5
- 0
net/p910nd/files/p910nd.config 查看文件

@@ -0,0 +1,5 @@
1
+config p910nd
2
+	option device        /dev/usb/lp0
3
+	option port          0
4
+	option bidirectional 1
5
+	option enabled       0

+ 51
- 0
net/p910nd/files/p910nd.init 查看文件

@@ -0,0 +1,51 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2007 OpenWrt.org
3
+START=50
4
+
5
+append_bool() {
6
+	local section="$1"
7
+	local option="$2"
8
+	local value="$3"
9
+	local _val
10
+	config_get_bool _val "$section" "$option" '0'
11
+	[ "$_val" -gt 0 ] && append args "$3"
12
+}
13
+
14
+append_string() {
15
+	local section="$1"
16
+	local option="$2"
17
+	local value="$3"
18
+	local _val
19
+	config_get _val "$section" "$option"
20
+	[ -n "$_val" ] && append args "$3$_val"
21
+}
22
+
23
+start_service() {
24
+	local section="$1"
25
+	args=""
26
+
27
+	append_bool "$section" bidirectional "-b"
28
+	append_string "$section" device "-f "
29
+	append_string "$section" bind "-i "
30
+	append_string "$section" port ""
31
+	config_get_bool "enabled" "$section" "enabled" '1'
32
+	[ "$enabled" -gt 0 ] && /usr/sbin/p910nd $args
33
+}
34
+
35
+stop_service() {
36
+	local section="$1"
37
+	config_get port "$section" port
38
+
39
+	PID_F=/var/run/p910${port}d.pid
40
+	[ -f $PID_F ] && kill $(cat $PID_F)
41
+}
42
+
43
+start() {
44
+	config_load "p910nd"
45
+	config_foreach start_service p910nd
46
+}
47
+
48
+stop() {
49
+	config_load "p910nd"
50
+	config_foreach stop_service p910nd
51
+}

+ 57
- 0
net/radsecproxy/Makefile 查看文件

@@ -0,0 +1,57 @@
1
+#
2
+# Copyright (C) 2008-2012 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=radsecproxy
11
+PKG_VERSION:=1.6.5
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/
16
+PKG_MD5SUM:=f74f82a7ae2cdf2b1d9d271a5c360617
17
+
18
+PKG_INSTALL:=1
19
+
20
+include $(INCLUDE_DIR)/package.mk
21
+
22
+define Package/radsecproxy
23
+  SECTION:=net
24
+  CATEGORY:=Network
25
+  DEPENDS:=+libopenssl +libpthread
26
+  TITLE:=radsecproxy
27
+  URL:=http://software.uninett.no/radsecproxy
28
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
29
+endef
30
+
31
+define Package/radsecproxy/description
32
+  A generic radius proxy for UDP/TLS (RadSec)
33
+endef
34
+
35
+CONFIGURE_ARGS+= \
36
+	--with-ssl="$(STAGING_DIR)/usr"
37
+
38
+#TARGET_CFLAGS += -ansi
39
+#TARGET_CFLAGS += -std=c99
40
+TARGET_CFLAGS += -Wno-long-long
41
+
42
+
43
+define Package/radsecproxy/install
44
+	$(INSTALL_DIR) $(1)/usr/sbin/
45
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/radsecproxy $(1)/usr/sbin/
46
+	$(INSTALL_DIR) $(1)/etc/
47
+	$(CP) $(PKG_BUILD_DIR)/radsecproxy.conf-example $(1)/etc/radsecproxy.conf
48
+	$(INSTALL_DIR) $(1)/etc/init.d/
49
+	$(INSTALL_BIN) ./files/radsecproxy.init $(1)/etc/init.d/radsecproxy
50
+endef
51
+
52
+define Package/radsecproxy/conffiles
53
+/etc/radsecproxy.conf
54
+endef
55
+
56
+$(eval $(call BuildPackage,radsecproxy))
57
+

+ 16
- 0
net/radsecproxy/files/radsecproxy.init 查看文件

@@ -0,0 +1,16 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+
4
+START=70
5
+
6
+USE_PROCD=1
7
+PROG=/usr/sbin/radsecproxy
8
+CONFFILE=/etc/radsecproxy.conf
9
+
10
+start_service() {
11
+	procd_open_instance
12
+	procd_set_param command $PROG -f -c $CONFFILE
13
+	procd_set_param file $CONFFILE
14
+	procd_set_param respawn
15
+	procd_close_instance
16
+}

+ 58
- 0
net/radsecproxy/patches/100-missing-return.patch 查看文件

@@ -0,0 +1,58 @@
1
+--- a/dtls.c
2
++++ b/dtls.c
3
+@@ -523,6 +523,7 @@ void *udpdtlsserverrd(void *arg) {
4
+ 	free(params);
5
+ 	cacheexpire(sessioncache, &lastexpiry);
6
+     }
7
++    return NULL;
8
+ }
9
+ 
10
+ int dtlsconnect(struct server *server, struct timeval *when, int timeout, char *text) {
11
+@@ -642,6 +643,7 @@ void *udpdtlsclientrd(void *arg) {
12
+ 	if (udp2bio(s, conf->servers->rbios, cnt))
13
+ 	    debug(DBG_DBG, "radudpget: got DTLS in UDP from %s", addr2string((struct sockaddr *)&from));
14
+     }
15
++    return NULL;
16
+ }
17
+ 
18
+ void *dtlsclientrd(void *arg) {
19
+--- a/radsecproxy.c
20
++++ b/radsecproxy.c
21
+@@ -3203,6 +3203,8 @@ void *sighandler(void *arg) {
22
+             debug(DBG_WARN, "sighandler: ignoring signal %d", sig);
23
+         }
24
+     }
25
++
26
++    return NULL;
27
+ }
28
+ 
29
+ int createpidfile(const char *pidfile) {
30
+@@ -3289,6 +3291,8 @@ int radsecproxy_main(int argc, char **ar
31
+     /* just hang around doing nothing, anything to do here? */
32
+     for (;;)
33
+ 	sleep(1000);
34
++
35
++    return 0;
36
+ }
37
+ 
38
+ /* Local Variables: */
39
+--- a/udp.c
40
++++ b/udp.c
41
+@@ -266,6 +266,8 @@ void *udpclientrd(void *arg) {
42
+ 	buf = radudpget(*s, NULL, &server, NULL);
43
+ 	replyh(server, buf);
44
+     }
45
++
46
++    return NULL;
47
+ }
48
+ 
49
+ void *udpserverrd(void *arg) {
50
+@@ -310,6 +312,8 @@ void *udpserverwr(void *arg) {
51
+ 	debug(DBG_DBG, "udpserverwr: refcount %d", reply->refcount);
52
+ 	freerq(reply);
53
+     }
54
++
55
++    return NULL;
56
+ }
57
+ 
58
+ void addclientudp(struct client *client) {

+ 31
- 0
net/radsecproxy/patches/200-logdest-on-foreground.patch 查看文件

@@ -0,0 +1,31 @@
1
+diff --git a/radsecproxy.c b/radsecproxy.c
2
+index 563c4a8..9fa076d 100644
3
+--- a/radsecproxy.c
4
++++ b/radsecproxy.c
5
+@@ -3382,18 +3382,16 @@ int radsecproxy_main(int argc, char **argv) {
6
+ 	options.loglevel = loglevel;
7
+     else if (options.loglevel)
8
+ 	debug_set_level(options.loglevel);
9
+-    if (!foreground) {
10
+-	debug_set_destination(options.logdestination
11
+-                              ? options.logdestination
12
+-                              : "x-syslog:///", LOG_TYPE_DEBUG);
13
++    debug_set_destination(options.logdestination
14
++			  ? options.logdestination
15
++			  : "x-syslog:///", LOG_TYPE_DEBUG);
16
+ #if defined(WANT_FTICKS)
17
+-    	if (options.ftickssyslogfacility) {
18
+-            debug_set_destination(options.ftickssyslogfacility,
19
+-                                  LOG_TYPE_FTICKS);
20
+-            free(options.ftickssyslogfacility);
21
+-    	}
22
+-#endif
23
++    if (options.ftickssyslogfacility) {
24
++	debug_set_destination(options.ftickssyslogfacility,
25
++			      LOG_TYPE_FTICKS);
26
++	free(options.ftickssyslogfacility);
27
+     }
28
++#endif
29
+     free(options.logdestination);
30
+ 
31
+     if (!list_first(clconfs))

+ 60
- 0
net/tinc/Makefile 查看文件

@@ -0,0 +1,60 @@
1
+#
2
+# Copyright (C) 2007-2013 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=tinc
11
+PKG_VERSION:=1.0.24
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://www.tinc-vpn.org/packages
16
+PKG_MD5SUM:=14a91eb2e85bdc0451a815612521b708
17
+
18
+PKG_INSTALL:=1
19
+
20
+include $(INCLUDE_DIR)/package.mk
21
+
22
+define Package/tinc
23
+  SECTION:=net
24
+  CATEGORY:=Network
25
+  DEPENDS:=+liblzo +libopenssl +kmod-tun
26
+  TITLE:=VPN tunneling daemon
27
+  URL:=http://www.tinc-vpn.org/
28
+  MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
29
+  SUBMENU:=VPN
30
+endef
31
+
32
+define Package/tinc/description
33
+  tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and
34
+  encryption to create a secure private network between hosts on the Internet.
35
+endef
36
+
37
+TARGET_CFLAGS += -std=gnu99
38
+
39
+CONFIGURE_ARGS += \
40
+	--with-kernel="$(LINUX_DIR)" \
41
+	--with-zlib="$(STAGING_DIR)/usr" \
42
+	--with-lzo-include="$(STAGING_DIR)/usr/include/lzo"
43
+
44
+define Package/tinc/install
45
+	$(INSTALL_DIR) $(1)/usr/sbin
46
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tincd $(1)/usr/sbin/
47
+	$(INSTALL_DIR) $(1)/etc/init.d/
48
+	$(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
49
+	$(INSTALL_DIR) $(1)/etc/config
50
+	$(INSTALL_CONF) files/$(PKG_NAME).config $(1)/etc/config/$(PKG_NAME)
51
+	$(INSTALL_DIR) $(1)/etc/tinc
52
+	$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
53
+	$(INSTALL_DATA) files/tinc.upgrade $(1)/lib/upgrade/keep.d/tinc
54
+endef
55
+
56
+define Package/tinc/conffiles
57
+/etc/config/tinc
58
+endef
59
+
60
+$(eval $(call BuildPackage,tinc))

+ 56
- 0
net/tinc/files/tinc.config 查看文件

@@ -0,0 +1,56 @@
1
+config tinc-net NETNAME
2
+	option enabled 0
3
+
4
+	## Daemon Configuration	(cmd arguments)
5
+	#option generate_keys 0
6
+	#option key_size 2048
7
+	#option logfile /tmp/log/tinc.NETNAME.log
8
+	#option debug 3
9
+
10
+	## Server Configuration (tinc.conf)
11
+	#option AddressFamily any
12
+	#option BindToAddress 127.0.0.1
13
+	#option BindToInterface lo
14
+
15
+	#list ConnectTo peer1
16
+
17
+	#option DirectOnly 0
18
+	#option Forwarding internal
19
+	#option GraphDumpFile /tmp/log/tinc.NETNAME.dot
20
+	#option Hostnames 0
21
+	#option IffOneQueue 0
22
+	#option Interface NETNAME
23
+	#option KeyExpire 3600
24
+	#option MACExpire 600
25
+	#option MaxTimeout 900
26
+	#option Mode router
27
+
28
+	option Name NODENAME
29
+
30
+	#option PingInterval 60
31
+	#option PingTimeout 5
32
+	#option PriorityInheritance 0
33
+	#option PrivateKeyFile /etc/tinc/NETNAME/rsa_key.priv
34
+	#option ProcessPriority normal
35
+	#option ReplayWindow 16
36
+	#option StrictSubnets 0
37
+	#option TunnelServer 0
38
+	#option UDPRcvBuf x
39
+	#option UDPSndBuf x
40
+
41
+config tinc-host NODENAME
42
+	option enabled 0
43
+
44
+	option net NETNAME
45
+
46
+	#list Address example.com
47
+	#option Cipher blowfish
48
+	#option ClampMSS yes
49
+	#option Compression 0
50
+	#option Digest sha1
51
+	#option IndirectData 0
52
+	#option MACLength 4
53
+	#option PMTU 1514
54
+	#option PMTUDiscovery yes
55
+	#option Port 655
56
+	#option Subnet 192.168.1.0/24

+ 241
- 0
net/tinc/files/tinc.init 查看文件

@@ -0,0 +1,241 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2011 OpenWrt.org
3
+# Copyright (C) 2011 Linus Lüssing
4
+#  Based on Jo-Philipp Wich's OpenVPN init script
5
+# This is free software, licensed under the GNU General Public License v2.
6
+# See /LICENSE for more information.
7
+
8
+START=42
9
+
10
+SERVICE_USE_PID=1
11
+
12
+BIN=/usr/sbin/tincd
13
+EXTRA_COMMANDS="up down"
14
+
15
+LIST_SEP="
16
+"
17
+TMP_TINC="/tmp/tinc"
18
+
19
+append_param() {
20
+	local v="$1"
21
+	case "$v" in
22
+		*_*_*_*) v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;;
23
+		*_*_*)   v=${v%%_*}-${v#*_}; v=${v%%_*}-${v#*_} ;;
24
+		*_*)     v=${v%%_*}-${v#*_} ;;
25
+	esac
26
+	ARGS="$ARGS --$v"
27
+	return 0
28
+}
29
+
30
+append_conf_bools() {
31
+	local p; local v; local s="$1"; local f="$2"; shift; shift
32
+	for p in $*; do
33
+		config_get_bool v "$s" "$p"
34
+		[ "$v" == 1 ] && echo "$p = yes" >> "$f"
35
+		[ "$v" == 0 ] && echo "$p = no" >> "$f"
36
+	done
37
+}
38
+
39
+append_params() {
40
+	local p; local v; local s="$1"; shift
41
+	for p in $*; do
42
+		config_get v "$s" "$p"
43
+		IFS="$LIST_SEP"
44
+		for v in $v; do
45
+			[ -n "$v" ] && append_param "$p" && ARGS="$ARGS=$v"
46
+		done
47
+		unset IFS
48
+	done
49
+}
50
+
51
+append_conf_params() {
52
+	local p; local v; local s="$1"; local f="$2"; shift; shift
53
+	for p in $*; do
54
+		config_get v "$s" "$p"
55
+		IFS="$LIST_SEP"
56
+		for v in $v; do
57
+			# Look up OpenWRT interface names
58
+			[ "$p" = "BindToInterface" ] && {
59
+				local ifname=$(uci -P /var/state get network.$v.ifname 2>&-)
60
+				[ -n "$ifname" ] && v="$ifname"
61
+			}
62
+
63
+			[ -n "$v" ] && echo "$p = $v" >> "$f"
64
+		done
65
+		unset IFS
66
+	done
67
+}
68
+
69
+section_enabled() {
70
+	config_get_bool enabled "$1" 'enabled' 0
71
+	[ $enabled -gt 0 ]
72
+}
73
+
74
+prepare_host() {
75
+	local s="$1"
76
+	local n
77
+
78
+	# net disabled?
79
+	config_get n "$s" net
80
+	section_enabled "$n" || return 1
81
+
82
+	if [ "$#" = "2" ]; then
83
+		[ "$2" != "$n" ] && return 1
84
+	fi
85
+
86
+	# host disabled?
87
+	section_enabled "$s" || {
88
+		[ -f "$TMP_TINC/$n/hosts/$s" ] && rm "$TMP_TINC/$n/hosts/$s"
89
+		return 1
90
+	}
91
+
92
+	[ ! -f "/etc/tinc/$n/hosts/$s" ] && {
93
+		echo -n "tinc: Warning, public key for $s for network $n "
94
+		echo -n "missing in /etc/tinc/$n/hosts/$s, "
95
+		echo "skipping configuration of $s"
96
+		return 1
97
+	}
98
+
99
+	# append flags
100
+	append_conf_bools "$s" "$TMP_TINC/$n/hosts/$s" \
101
+		ClampMSS IndirectData PMTUDiscovery TCPOnly
102
+
103
+	# append params
104
+	append_conf_params "$s" "$TMP_TINC/$n/hosts/$s" \
105
+		Address Cipher Compression Digest MACLength PMTU \
106
+		Port PublicKey PublicKeyFile Subnet
107
+}
108
+
109
+check_gen_own_key() {
110
+	local s="$1"; local n; local k
111
+
112
+	config_get n "$s" Name
113
+	config_get_bool k "$s" generate_keys 0
114
+	[ "$k" == 0 ] && return 0
115
+
116
+	([ -z "$n" ] || [ -f "$TMP_TINC/$s/hosts/$n" ] || [ -f "$TMP_TINC/$s/rsa_key.priv" ]) && \
117
+		return 0
118
+	[ ! -d "$TMP_TINC/$s/hosts" ] && mkdir -p "$TMP_TINC/$s/hosts"
119
+
120
+	config_get k "$s" key_size
121
+	if [ -z "$k" ]; then
122
+		$BIN -c "$TMP_TINC/$s" --generate-keys </dev/null
123
+	else
124
+		$BIN -c "$TMP_TINC/$s" "--generate-keys=$k" </dev/null
125
+	fi
126
+
127
+	[ ! -d "/etc/tinc/$s/hosts" ] && mkdir -p "/etc/tinc/$s/hosts"
128
+	cp "$TMP_TINC/$s/rsa_key.priv" "/etc/tinc/$s/"
129
+	[ -n "$n" ] && cp "$TMP_TINC/$s/hosts/$n" "/etc/tinc/$s/hosts/"
130
+}
131
+
132
+prepare_net() {
133
+	local s="$1"
134
+	local n
135
+
136
+	section_enabled "$s" || return 1
137
+
138
+        # rm old config
139
+        rm -rf "$TMP_TINC/$s/"
140
+
141
+	[ ! -d "$TMP_TINC/$s" ] && mkdir -p "$TMP_TINC/$s"
142
+	[ -d "/etc/tinc/$s" ] && cp -r "/etc/tinc/$s" "$TMP_TINC/"
143
+
144
+	# append flags
145
+	append_conf_bools "$s" "$TMP_TINC/$s/tinc.conf" \
146
+		DecrementTTL DirectOnly Hostnames IffOneQueue \
147
+		LocalDiscovery PriorityInheritance StrictSubnets TunnelServer \
148
+		ClampMSS IndirectData PMTUDiscovery TCPOnly
149
+
150
+	# append params
151
+	append_conf_params "$s" "$TMP_TINC/$s/tinc.conf" \
152
+		AddressFamily BindToAddress ConnectTo BindToInterface \
153
+		Broadcast Device DeviceType Forwarding \
154
+		GraphDumpFile Interface KeyExpire MACExpire \
155
+		MaxTimeout Mode Name PingInterval PingTimeout \
156
+		PrivateKey PrivateKeyFile ProcessPriority ReplayWindow \
157
+		UDPRcvBuf UDPSndBuf \
158
+		Address Cipher Compression Digest MACLength PMTU \
159
+		Port PublicKey PublicKeyFile Subnet
160
+
161
+	check_gen_own_key "$s" && return 0
162
+}
163
+
164
+start_instance() {
165
+	local s="$1"
166
+
167
+	section_enabled "$s" || return 1
168
+
169
+	ARGS=""
170
+
171
+	# append params
172
+	append_params "$s" logfile debug
173
+
174
+	SERVICE_PID_FILE="/var/run/tinc.$s.pid"
175
+	service_start $BIN -c "$TMP_TINC/$s" -n $s $ARGS --pidfile="$SERVICE_PID_FILE"
176
+}
177
+
178
+stop_instance() {
179
+	local s="$1"
180
+
181
+	section_enabled "$s" || return 1
182
+
183
+	SERVICE_PID_FILE="/var/run/tinc.$s.pid"
184
+	service_stop $BIN
185
+	# rm old config
186
+	rm -rf "$TMP_TINC/$s/"
187
+}
188
+
189
+reload_instance() {
190
+	local s="$1"
191
+
192
+	section_enabled "$s" || return 1
193
+
194
+	SERVICE_PID_FILE="/var/run/tinc.$s.pid"
195
+	service_reload $BIN
196
+}
197
+
198
+start() {
199
+	config_load 'tinc'
200
+
201
+	config_foreach prepare_net 'tinc-net'
202
+	config_foreach prepare_host 'tinc-host'
203
+
204
+	config_foreach start_instance 'tinc-net'
205
+}
206
+
207
+stop() {
208
+	config_load 'tinc'
209
+	config_foreach stop_instance 'tinc-net'
210
+}
211
+
212
+reload() {
213
+	config_load 'tinc'
214
+	config_foreach reload_instance 'tinc-net'
215
+}
216
+
217
+up() {
218
+	local exists
219
+	local instance
220
+	config_load 'tinc'
221
+	for instance in "$@"; do
222
+		config_get exists "$instance" 'TYPE'
223
+		if [ "$exists" == "tinc-net" ]; then
224
+			prepare_net "$instance"
225
+			config_foreach prepare_host 'tinc-host' "$instance"
226
+			start_instance "$instance"
227
+		fi
228
+	done
229
+}
230
+
231
+down() {
232
+	local exists
233
+	local instance
234
+	config_load 'tinc'
235
+	for instance in "$@"; do
236
+		config_get exists "$instance" 'TYPE'
237
+		if [ "$exists" == "tinc-net" ]; then
238
+			stop_instance "$instance"
239
+		fi
240
+	done
241
+}

+ 1
- 0
net/tinc/files/tinc.upgrade 查看文件

@@ -0,0 +1 @@
1
+/etc/tinc/

+ 4
- 5
sound/mpd/Makefile 查看文件

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=mpd
11 11
 PKG_VERSION:=0.18.11
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.18/
@@ -35,8 +35,8 @@ define Package/mpd/Default
35 35
   CATEGORY:=Sound
36 36
   TITLE:=Music Player Daemon
37 37
   URL:=http://www.musicpd.org/
38
-  DEPENDS:= +glib2 +libcurl +libpthread +libmpdclient $(ICONV_DEPENDS) \
39
-	    +libflac +BUILD_PATENTED:libmad +libvorbisidec
38
+  DEPENDS:= +glib2 +libcurl +libpthread +libmpdclient $(ICONV_DEPENDS) +libstdcpp \
39
+	    +libflac +BUILD_PATENTED:libmad +libvorbisidec +AUDIO_SUPPORT:alsa-lib
40 40
 endef
41 41
 
42 42
 define Package/mpd/Default/description
@@ -50,7 +50,6 @@ define Package/mpd-full
50 50
 $(call Package/mpd/Default)
51 51
   TITLE+= (full)
52 52
   DEPENDS+= \
53
-	+AUDIO_SUPPORT:alsa-lib \
54 53
 	+libaudiofile +BUILD_PATENTED:libfaad2 +libffmpeg +libid3tag \
55 54
 	+libmms +libogg +libsndfile +libvorbis
56 55
   PROVIDES:=mpd
@@ -128,7 +127,7 @@ CONFIGURE_ARGS += \
128 127
 	--enable-flac \
129 128
 	--enable-httpd-output \
130 129
 	$(call autoconf_bool,CONFIG_BUILD_PATENTED,mad) \
131
-	$(call autoconf_bool,CONFIG_AUDIO_SUPPORT,oss) \
130
+	$(call autoconf_bool,CONFIG_AUDIO_SUPPORT,alsa) \
132 131
 	--enable-tcp \
133 132
 	--enable-un \
134 133
 

+ 0
- 9
utils/acl/Makefile 查看文件

@@ -47,15 +47,6 @@ $(call Package/acl/Default)
47 47
   CATEGORY:=Libraries
48 48
   TITLE+=library
49 49
   DEPENDS:=+libattr
50
-  KCONFIG:= \
51
-    CONFIG_EXT4_FS_POSIX_ACL=y \
52
-    CONFIG_FS_POSIX_ACL=y \
53
-    CONFIG_HFSPLUS_FS_POSIX_ACL=y \
54
-    CONFIG_JFFS2_FS_POSIX_ACL=y \
55
-    CONFIG_JFS_POSIX_ACL=y \
56
-    CONFIG_TMPFS_POSIX_ACL=y \
57
-    CONFIG_XFS_POSIX_ACL=y \
58
-
59 50
 endef
60 51
 
61 52
 define Package/libacl/description

+ 0
- 8
utils/attr/Makefile 查看文件

@@ -46,14 +46,6 @@ $(call Package/attr/Default)
46 46
   SECTION:=libs
47 47
   CATEGORY:=Libraries
48 48
   TITLE+=library
49
-  KCONFIG:= \
50
-    CONFIG_CIFS_XATTR=y \
51
-    CONFIG_EXT4_FS_XATTR=y \
52
-    CONFIG_JFFS2_FS_XATTR=y \
53
-    CONFIG_REISERFS_FS_XATTR=y \
54
-    CONFIG_SQUASHFS_XATTR=y \
55
-    CONFIG_TMPFS_XATTR=y \
56
-
57 49
 endef
58 50
 
59 51
 define Package/libattr/description