From 12335518ab39608d58370c85ff9f5384ad2aa5f7 Mon Sep 17 00:00:00 2001
From: MCApollo <34170230+MCApollo@users.noreply.github.com>
Date: Sat, 20 Apr 2019 20:49:46 -0500
Subject: Ported in the homebrew-marauder for a hacky update/import system. 
 TODO: Maybe add a license & fix up messy code.

---
 homebrew/vsftpd/.beer                 | 70 +++++++++++++++++++++++++++++++++++
 homebrew/vsftpd/.make.sh-auto         |  9 +++++
 homebrew/vsftpd/_metadata/description |  1 +
 homebrew/vsftpd/_metadata/homepage    |  1 +
 homebrew/vsftpd/_metadata/name        |  1 +
 homebrew/vsftpd/_metadata/version     |  1 +
 homebrew/vsftpd/download.sh           |  1 +
 homebrew/vsftpd/patches.sh            | 44 ++++++++++++++++++++++
 8 files changed, 128 insertions(+)
 create mode 100644 homebrew/vsftpd/.beer
 create mode 100644 homebrew/vsftpd/.make.sh-auto
 create mode 100644 homebrew/vsftpd/_metadata/description
 create mode 100644 homebrew/vsftpd/_metadata/homepage
 create mode 100644 homebrew/vsftpd/_metadata/name
 create mode 100644 homebrew/vsftpd/_metadata/version
 create mode 100755 homebrew/vsftpd/download.sh
 create mode 100755 homebrew/vsftpd/patches.sh

(limited to 'homebrew/vsftpd')

diff --git a/homebrew/vsftpd/.beer b/homebrew/vsftpd/.beer
new file mode 100644
index 000000000..a2194f478
--- /dev/null
+++ b/homebrew/vsftpd/.beer
@@ -0,0 +1,70 @@
+{
+    "name": "Vsftpd",
+    "description": "Secure FTP server for UNIX",
+    "url": "https://security.appspot.com/downloads/vsftpd-3.0.3.tar.gz",
+    "mirror": "https://fossies.org/linux/misc/vsftpd-3.0.3.tar.gz",
+    "homepage": "https://security.appspot.com/vsftpd.html",
+    "depends": [],
+    "resource": [],
+    "conflicts": [],
+    "patches": [
+        {
+            "url": null,
+            "data": [
+                "diff --git a/sysdeputil.c b/sysdeputil.c\n",
+                "index 9dc8a5e..66dbe30 100644\n",
+                "--- a/sysdeputil.c\n",
+                "+++ b/sysdeputil.c\n",
+                "@@ -64,6 +64,10 @@\n",
+                " #include <utmpx.h>\n",
+                " \n",
+                " /* BEGIN config */\n",
+                "+#if defined(__APPLE__)\n",
+                "+  #undef VSF_SYSDEP_HAVE_UTMPX\n",
+                "+#endif\n",
+                "+\n",
+                " #if defined(__linux__)\n",
+                "   #include <errno.h>\n",
+                "   #include <syscall.h>\n",
+                "diff --git a/vsf_findlibs.sh b/vsf_findlibs.sh\n",
+                "index b988be6..68d4a34 100755\n",
+                "--- a/vsf_findlibs.sh\n",
+                "+++ b/vsf_findlibs.sh\n",
+                "@@ -20,6 +20,8 @@ if find_func pam_start sysdeputil.o; then\n",
+                "   locate_library /usr/lib/libpam.sl && echo \"-lpam\";\n",
+                "   # AIX ends shared libraries with .a\n",
+                "   locate_library /usr/lib/libpam.a && echo \"-lpam\";\n",
+                "+  # Mac OS X / Darwin shared libraries with .dylib\n",
+                "+  locate_library /usr/lib/libpam.dylib && echo \"-lpam\";\n",
+                " else\n",
+                "   locate_library /lib/libcrypt.so && echo \"-lcrypt\";\n",
+                "   locate_library /usr/lib/libcrypt.so && echo \"-lcrypt\";\n",
+                "diff --git a/Makefile b/Makefile\n",
+                "index c63ed1b..556519e 100644\n",
+                "--- a/Makefile\n",
+                "+++ b/Makefile\n",
+                "@@ -10,7 +10,7 @@ CFLAGS\t=\t-O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \\\n",
+                "\n",
+                " LIBS\t=\t`./vsf_findlibs.sh`\n",
+                " LINK\t=\t-Wl,-s\n",
+                "-LDFLAGS\t=\t-fPIE -pie -Wl,-z,relro -Wl,-z,now\n",
+                "+LDFLAGS\t=\t-fPIE -pie\n",
+                "\n",
+                " OBJS\t=\tmain.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \\\n",
+                "\t\ttunables.o ftpdataio.o secbuf.o ls.o \\\n"
+            ]
+        }
+    ],
+    "install": [
+        "inreplace \"defs.h\", \"/etc/vsftpd.conf\", \"#{etc}/vsftpd.conf\"",
+        "inreplace \"tunables.c\", \"/etc\", etc",
+        "inreplace \"tunables.c\", \"/var\", var",
+        "system \"make\"",
+        "sbin.install \"vsftpd\"",
+        "etc.install \"vsftpd.conf\"",
+        "man5.install \"vsftpd.conf.5\"",
+        "man8.install \"vsftpd.8\""
+    ],
+    "version": "3.0.3",
+    "file": "vsftpd.rb"
+}
\ No newline at end of file
diff --git a/homebrew/vsftpd/.make.sh-auto b/homebrew/vsftpd/.make.sh-auto
new file mode 100644
index 000000000..aa4186d1b
--- /dev/null
+++ b/homebrew/vsftpd/.make.sh-auto
@@ -0,0 +1,9 @@
+pkg:setup
+inreplace "defs.h", "/etc/vsftpd.conf", "#{etc}/vsftpd.conf"
+inreplace "tunables.c", "/etc", etc
+inreplace "tunables.c", "/var", var
+make
+sbin.install "vsftpd"
+etc.install "vsftpd.conf"
+man5.install "vsftpd.conf.5"
+man8.install "vsftpd.8"
diff --git a/homebrew/vsftpd/_metadata/description b/homebrew/vsftpd/_metadata/description
new file mode 100644
index 000000000..1e73a355f
--- /dev/null
+++ b/homebrew/vsftpd/_metadata/description
@@ -0,0 +1 @@
+Secure FTP server for UNIX
diff --git a/homebrew/vsftpd/_metadata/homepage b/homebrew/vsftpd/_metadata/homepage
new file mode 100644
index 000000000..2164c4a71
--- /dev/null
+++ b/homebrew/vsftpd/_metadata/homepage
@@ -0,0 +1 @@
+https://security.appspot.com/vsftpd.html
diff --git a/homebrew/vsftpd/_metadata/name b/homebrew/vsftpd/_metadata/name
new file mode 100644
index 000000000..d280f19bc
--- /dev/null
+++ b/homebrew/vsftpd/_metadata/name
@@ -0,0 +1 @@
+Vsftpd
diff --git a/homebrew/vsftpd/_metadata/version b/homebrew/vsftpd/_metadata/version
new file mode 100644
index 000000000..75a22a26a
--- /dev/null
+++ b/homebrew/vsftpd/_metadata/version
@@ -0,0 +1 @@
+3.0.3
diff --git a/homebrew/vsftpd/download.sh b/homebrew/vsftpd/download.sh
new file mode 100755
index 000000000..6bd4f896f
--- /dev/null
+++ b/homebrew/vsftpd/download.sh
@@ -0,0 +1 @@
+wget https://security.appspot.com/downloads/vsftpd-3.0.3.tar.gz || wget https://fossies.org/linux/misc/vsftpd-3.0.3.tar.gz
\ No newline at end of file
diff --git a/homebrew/vsftpd/patches.sh b/homebrew/vsftpd/patches.sh
new file mode 100755
index 000000000..39bd6f2db
--- /dev/null
+++ b/homebrew/vsftpd/patches.sh
@@ -0,0 +1,44 @@
+echo 'Creating brew-patch.diff'
+cat << EOF >> brew-patch.diff
+diff --git a/sysdeputil.c b/sysdeputil.c
+index 9dc8a5e..66dbe30 100644
+--- a/sysdeputil.c
++++ b/sysdeputil.c
+@@ -64,6 +64,10 @@
+ #include <utmpx.h>
+ 
+ /* BEGIN config */
++#if defined(__APPLE__)
++  #undef VSF_SYSDEP_HAVE_UTMPX
++#endif
++
+ #if defined(__linux__)
+   #include <errno.h>
+   #include <syscall.h>
+diff --git a/vsf_findlibs.sh b/vsf_findlibs.sh
+index b988be6..68d4a34 100755
+--- a/vsf_findlibs.sh
++++ b/vsf_findlibs.sh
+@@ -20,6 +20,8 @@ if find_func pam_start sysdeputil.o; then
+   locate_library /usr/lib/libpam.sl && echo "-lpam";
+   # AIX ends shared libraries with .a
+   locate_library /usr/lib/libpam.a && echo "-lpam";
++  # Mac OS X / Darwin shared libraries with .dylib
++  locate_library /usr/lib/libpam.dylib && echo "-lpam";
+ else
+   locate_library /lib/libcrypt.so && echo "-lcrypt";
+   locate_library /usr/lib/libcrypt.so && echo "-lcrypt";
+diff --git a/Makefile b/Makefile
+index c63ed1b..556519e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -10,7 +10,7 @@ CFLAGS	=	-O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
+
+ LIBS	=	`./vsf_findlibs.sh`
+ LINK	=	-Wl,-s
+-LDFLAGS	=	-fPIE -pie -Wl,-z,relro -Wl,-z,now
++LDFLAGS	=	-fPIE -pie
+
+ OBJS	=	main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
+		tunables.o ftpdataio.o secbuf.o ls.o \
+EOF
-- 
cgit v1.2.3