Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsftpd: update to replace old setrlimit call #27701

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions net/vsftpd/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PortSystem 1.0

name vsftpd
version 3.0.5
revision 0
revision 1
categories net
license {GPL-2 OpenSSLException}
platforms darwin
Expand All @@ -26,7 +26,8 @@ checksums rmd160 f308bbd0b214a1af7438b1f84e9b12cacf06858d \
patchfiles patch-sysdeputil.c.diff \
patch-vsf_findlibs.sh.diff \
patch-vsftpd.conf.diff \
patch-Makefile.diff
patch-Makefile.diff \
patch-sysutil.c.diff

configure {
reinplace "s|/etc/|${prefix}/etc/|g" \
Expand Down
49 changes: 49 additions & 0 deletions net/vsftpd/files/patch-sysutil.c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git sysutil.c.old sysutil.c
index ff8885b..c465b99 100644
--- sysutil.c.old
+++ sysutil.c
@@ -2792,6 +2792,7 @@ vsf_sysutil_getuid(void)
void
vsf_sysutil_set_address_space_limit(unsigned long bytes)
{
+#if! defined(__APPLE__)
/* Unfortunately, OpenBSD is missing RLIMIT_AS. */
#ifdef RLIMIT_AS
int ret;
@@ -2807,12 +2808,14 @@ vsf_sysutil_set_address_space_limit(unsigned long bytes)
die("setrlimit");
}
#endif /* RLIMIT_AS */
+#endif
(void) bytes;
}

void
vsf_sysutil_set_no_fds()
{
+#if! defined(__APPLE__)
int ret;
struct rlimit rlim;
rlim.rlim_cur = 0;
@@ -2822,11 +2825,13 @@ vsf_sysutil_set_no_fds()
{
die("setrlimit NOFILE");
}
+#endif
}

void
vsf_sysutil_set_no_procs()
{
+#if! defined(__APPLE__)
#ifdef RLIMIT_NPROC
int ret;
struct rlimit rlim;
@@ -2838,6 +2843,7 @@ vsf_sysutil_set_no_procs()
die("setrlimit NPROC");
}
#endif
+#endif
}

void