Browse Source

vsftpd: import from oldpackages. No changes.

Hannu Nyman 10 years ago
parent
commit
aff2e9e764

+ 85
- 0
net/vsftpd/Makefile View File

@@ -0,0 +1,85 @@
1
+#
2
+# Copyright (C) 2006-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:=vsftpd
11
+PKG_VERSION:=3.0.2
12
+PKG_RELEASE:=3
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=https://security.appspot.com/downloads/
16
+PKG_MD5SUM:=8b00c749719089401315bd3c44dddbb2
17
+
18
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
19
+
20
+include $(INCLUDE_DIR)/package.mk
21
+
22
+define Package/vsftpd/Default
23
+  SUBMENU:=File Transfer
24
+  SECTION:=net
25
+  CATEGORY:=Network
26
+  TITLE:=A fast and secure FTP server
27
+  URL:=http://vsftpd.beasts.org/
28
+  MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
29
+endef
30
+
31
+
32
+define Package/vsftpd
33
+$(call Package/vsftpd/Default)
34
+  VARIANT:=notls
35
+  TITLE+= (no TLS)
36
+endef
37
+
38
+define Package/vsftpd-tls
39
+$(call Package/vsftpd/Default)
40
+  VARIANT:=tls
41
+  TITLE+= (TLS)
42
+  DEPENDS+=+libopenssl
43
+endef
44
+
45
+define Package/vsftpd/conffiles
46
+/etc/vsftpd.conf
47
+endef
48
+
49
+Package/vsftpd-tls/conffiles=$(Package/vsftpd/conffiles)
50
+
51
+ifeq ($(BUILD_VARIANT),notls)
52
+ define Build/Compile
53
+	$(MAKE) -C $(PKG_BUILD_DIR) \
54
+		CC="$(TARGET_CC)" \
55
+		CFLAGS="$(TARGET_CFLAGS)" \
56
+		LDFLAGS="$(TARGET_LDFLAGS)" \
57
+		vsftpd
58
+ endef
59
+endif
60
+
61
+ifeq ($(BUILD_VARIANT),tls)
62
+ define Build/Compile
63
+	$(SED) 's/#undef VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(PKG_BUILD_DIR)/builddefs.h
64
+	$(SED) 's/-lcrypt -lnsl/-lcrypt -lnsl -lssl -lcrypto/' $(PKG_BUILD_DIR)/Makefile
65
+	$(MAKE) -C $(PKG_BUILD_DIR) \
66
+		CC="$(TARGET_CC)" \
67
+		CFLAGS="$(TARGET_CFLAGS)" \
68
+		LDFLAGS="$(TARGET_LDFLAGS)" \
69
+		vsftpd
70
+ endef
71
+endif
72
+
73
+define Package/vsftpd/install
74
+	$(INSTALL_DIR) $(1)/usr/sbin
75
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
76
+	$(INSTALL_DIR) $(1)/etc
77
+	$(INSTALL_CONF) ./files/$(PKG_NAME).conf $(1)/etc/$(PKG_NAME).conf
78
+	$(INSTALL_DIR) $(1)/etc/init.d
79
+	$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
80
+endef
81
+
82
+Package/vsftpd-tls/install=$(Package/vsftpd/install)
83
+
84
+$(eval $(call BuildPackage,vsftpd))
85
+$(eval $(call BuildPackage,vsftpd-tls))

+ 17
- 0
net/vsftpd/files/vsftpd.conf View File

@@ -0,0 +1,17 @@
1
+background=YES
2
+listen=YES
3
+anonymous_enable=NO
4
+local_enable=YES
5
+write_enable=YES
6
+local_umask=022
7
+check_shell=NO
8
+#dirmessage_enable=YES
9
+#ftpd_banner=Welcome to blah FTP service.
10
+session_support=NO
11
+#syslog_enable=YES
12
+#userlist_enable=YES
13
+#userlist_deny=NO
14
+#userlist_file=/etc/vsftpd.users
15
+#xferlog_enable=YES
16
+#xferlog_file=/var/log/vsftpd.log
17
+#xferlog_std_format=YES

+ 13
- 0
net/vsftpd/files/vsftpd.init View File

@@ -0,0 +1,13 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2006-2011 OpenWrt.org
3
+
4
+START=50
5
+
6
+start() {
7
+	mkdir -m 0755 -p /var/run/vsftpd
8
+	service_start /usr/sbin/vsftpd
9
+}
10
+
11
+stop() {
12
+	service_stop /usr/sbin/vsftpd
13
+}

+ 47
- 0
net/vsftpd/patches/001-destdir.patch View File

@@ -0,0 +1,47 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -22,6 +22,8 @@ OBJS	=	main.o utility.o prelogin.o ftpcm
4
+     seccompsandbox.o
5
+ 
6
+ 
7
++DESTDIR =
8
++
9
+ .c.o:
10
+ 	$(CC) -c $*.c $(CFLAGS) $(IFLAGS)
11
+ 
12
+@@ -29,21 +31,20 @@ vsftpd: $(OBJS) 
13
+ 	$(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS)
14
+ 
15
+ install:
16
+-	if [ -x /usr/local/sbin ]; then \
17
+-		$(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \
18
+-	else \
19
+-		$(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi
20
+-	if [ -x /usr/local/man ]; then \
21
+-		$(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
22
+-		$(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
23
+-	elif [ -x /usr/share/man ]; then \
24
+-		$(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
25
+-		$(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
26
+-	else \
27
+-		$(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
28
+-		$(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
29
+-	if [ -x /etc/xinetd.d ]; then \
30
+-		$(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi
31
++	mkdir -p $(DESTDIR)/usr/sbin
32
++	$(INSTALL) -m 755 vsftpd $(DESTDIR)/usr/sbin/
33
++	mkdir -p $(DESTDIR)/usr/share/man/man8
34
++	$(INSTALL) -m 644 vsftpd.8 $(DESTDIR)/usr/share/man/man8/
35
++	mkdir -p $(DESTDIR)/usr/share/man/man5
36
++	$(INSTALL) -m 644 vsftpd.conf.5 $(DESTDIR)/usr/share/man/man5/
37
++	mkdir -p $(DESTDIR)/etc/xinetd.d
38
++	$(INSTALL) -m 644 xinetd.d/vsftpd $(DESTDIR)/etc/xinetd.d/
39
++
40
++uninstall:
41
++	rm -f $(DESTDIR)/usr/sbin/vsftpd
42
++	rm -f $(DESTDIR)/usr/share/man/man8/vsftpd.8
43
++	rm -f $(DESTDIR)/usr/share/man/man5/vsftpd.conf.5
44
++	rm -f $(DESTDIR)/etc/xinetd.d/vsftpd
45
+ 
46
+ clean:
47
+ 	rm -f *.o *.swp vsftpd

+ 13
- 0
net/vsftpd/patches/002-find_libs.patch View File

@@ -0,0 +1,13 @@
1
+--- a/Makefile
2
++++ b/Makefile
3
+@@ -8,8 +8,8 @@ CFLAGS	=	-O2 -fPIE -fstack-protector --p
4
+ 	-D_FORTIFY_SOURCE=2 \
5
+ 	#-pedantic -Wconversion
6
+ 
7
+-LIBS	=	`./vsf_findlibs.sh`
8
+-LINK	=	-Wl,-s
9
++LIBS	=	-lcrypt -lnsl
10
++LINK	=
11
+ LDFLAGS	=	-fPIE -pie -Wl,-z,relro -Wl,-z,now
12
+ 
13
+ OBJS	=	main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \

+ 11
- 0
net/vsftpd/patches/003-chroot.patch View File

@@ -0,0 +1,11 @@
1
+--- a/tunables.c
2
++++ b/tunables.c
3
+@@ -254,7 +254,7 @@ tunables_load_defaults()
4
+   /* -rw------- */
5
+   tunable_chown_upload_mode = 0600;
6
+ 
7
+-  install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir);
8
++  install_str_setting("/var/run/vsftpd", &tunable_secure_chroot_dir);
9
+   install_str_setting("ftp", &tunable_ftp_username);
10
+   install_str_setting("root", &tunable_chown_username);
11
+   install_str_setting("/var/log/xferlog", &tunable_xferlog_file);

+ 12
- 0
net/vsftpd/patches/004-disable-capabilities.patch View File

@@ -0,0 +1,12 @@
1
+--- a/sysdeputil.c
2
++++ b/sysdeputil.c
3
+@@ -165,6 +165,9 @@
4
+ #endif
5
+ /* END config */
6
+ 
7
++#undef VSF_SYSDEP_HAVE_CAPABILITIES
8
++#undef VSF_SYSDEP_HAVE_LIBCAP
9
++
10
+ /* PAM support - we include our own dummy version if the system lacks this */
11
+ #include <security/pam_appl.h>
12
+ 

+ 11
- 0
net/vsftpd/patches/005-disable-pam.patch View File

@@ -0,0 +1,11 @@
1
+--- a/builddefs.h
2
++++ b/builddefs.h
3
+@@ -2,7 +2,7 @@
4
+ #define VSF_BUILDDEFS_H
5
+ 
6
+ #undef VSF_BUILD_TCPWRAPPERS
7
+-#define VSF_BUILD_PAM
8
++#undef VSF_BUILD_PAM
9
+ #undef VSF_BUILD_SSL
10
+ 
11
+ #endif /* VSF_BUILDDEFS_H */