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

ProFTPD compiling on OpenBSD fails #75

Closed
vaygr opened this issue Nov 25, 2014 · 5 comments
Closed

ProFTPD compiling on OpenBSD fails #75

vaygr opened this issue Nov 25, 2014 · 5 comments
Assignees

Comments

@vaygr
Copy link

vaygr commented Nov 25, 2014

I've been using ProFTPD on OpenBSD for more than 9 years and just wanted to add my ¢2:

I can confirm it compiles fine with these options enabled:

--enable-ipv6
--enable-openssl
--enable-pcre
--enable-nls

and these modules compile/work without additional patches:

  mod_core.c
  mod_xfer.c
  mod_rlimit.c
  mod_auth_unix.c
  mod_auth_file.c
  mod_auth.c
  mod_ls.c
  mod_log.c
  mod_site.c
  mod_delay.c
  mod_facts.c
  mod_ident.c
  mod_tls.c
  mod_ban.c
  mod_sql.c
  mod_sql_sqlite.c
  mod_sftp.c
  mod_sftp_sql.c
  mod_ifsession.c
  mod_lang.c

The only problem I faced was about 'mod_ctrls.c' (along with '--enable-ctrls'):

--- src/ctrls.c.orig    Wed May 29 00:02:02 2013
+++ src/ctrls.c Tue Nov 25 09:48:38 2014
@@ -1117,7 +1117,7 @@ int pr_ctrls_issock_unix(mode_t sock_mode) {
 #if defined(SO_PEERCRED)
 static int ctrls_get_creds_peercred(int sockfd, uid_t *uid, gid_t *gid,
     pid_t *pid) {
-  struct ucred cred;
+  struct sockpeercred cred;
   socklen_t credlen = sizeof(cred);

   if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cred, &credlen) < 0) {

It's the only thing you need to build it on OpenBSD (checked with 5.6/i386), so maybe some #if/#ifdef magic is needed for the OpenBSD platform.

@Castaglia
Copy link
Member

Could you provide the output from `proftpd -V', when it is built without the --enable-ctrls option? That should give me enough info to add the right #ifdef magic. Thanks!

@Castaglia Castaglia self-assigned this Nov 29, 2014
@vaygr
Copy link
Author

vaygr commented Nov 29, 2014

Of course, here we go:

Compile-time Settings:
  Version: 1.3.5 (stable)
  Platform: OPENBSD5 (OPENBSD5_6) [OpenBSD 5.6 i386]
  Built: Sat Nov 29 2014 23:19:34 GMT-3
  Built With:
    configure  '--enable-ipv6' '--enable-openssl' '--enable-pcre' '--enable-nls' '--with-modules=mod_tls:mod_sql:mod_sql_sqlite:mod_sftp:mod_sftp_sql:mod_ifsession' '--prefix=/usr/local' '--sysconfdir=/etc' '--mandir=/usr/local/man' '--infodir=/usr/local/info' '--localstatedir=/var/proftpd' '--disable-silent-rules' 'CC=cc' 'CFLAGS=-O2 -pipe' 'LDFLAGS=-L/usr/local/lib' 'CPPFLAGS=-I/usr/local/include' 'CXX=c++' 'CXXFLAGS=-O2 -pipe'

  CFLAGS: -O2 -pipe -Wall
  LDFLAGS: -L$(top_srcdir)/lib -L/usr/local/lib 
  LIBS: -lintl  -lpcreposix -lpcre -lssl -lcrypto -lssl -lcrypto -lsqlite3  -lssl  -lcrypto -lz -lsupp  -liconv -lutil

  Files:
    Configuration File:
      /etc/proftpd.conf
    Pid File:
      /var/proftpd/proftpd.pid
    Scoreboard File:
      /var/proftpd/proftpd.scoreboard

  Features:
    - Autoshadow support
    - Controls support
    + curses support
    - Developer support
    - DSO support
    + IPv6 support
    + Largefile support
    - Lastlog support
    - Memcache support
    + ncursesw support
    + NLS support
    + OpenSSL support
    + PCRE support
    - POSIX ACL support
    - Shadow file suppport
    - Sendfile support
    + Trace support

  Tunable Options:
    PR_TUNABLE_BUFFER_SIZE = 1024
    PR_TUNABLE_DEFAULT_RCVBUFSZ = 8192
    PR_TUNABLE_DEFAULT_SNDBUFSZ = 8192
    PR_TUNABLE_GLOBBING_MAX_MATCHES = 100000
    PR_TUNABLE_GLOBBING_MAX_RECURSION = 8
    PR_TUNABLE_HASH_TABLE_SIZE = 40
    PR_TUNABLE_NEW_POOL_SIZE = 512
    PR_TUNABLE_SCOREBOARD_BUFFER_SIZE = 80
    PR_TUNABLE_SCOREBOARD_SCRUB_TIMER = 30
    PR_TUNABLE_SELECT_TIMEOUT = 30
    PR_TUNABLE_TIMEOUTIDENT = 10
    PR_TUNABLE_TIMEOUTIDLE = 600
    PR_TUNABLE_TIMEOUTLINGER = 30
    PR_TUNABLE_TIMEOUTLOGIN = 300
    PR_TUNABLE_TIMEOUTNOXFER = 300
    PR_TUNABLE_TIMEOUTSTALLED = 3600
    PR_TUNABLE_XFER_SCOREBOARD_UPDATES = 10

I needed to disable mod_ban as well, since it requires ctrls support.

Castaglia added a commit that referenced this issue Nov 29, 2014
OpenBSD systems), and update the Controls API to use this.
@Castaglia
Copy link
Member

Hopefully this pull request fixes things; I don't have access to an OpenBSD system to try it out, though:

#77

@vaygr
Copy link
Author

vaygr commented Nov 30, 2014

Thanks, confirming it fixed with the above patch.

Castaglia added a commit that referenced this issue Nov 30, 2014
OpenBSD systems), and update the Controls API to use this.
Castaglia added a commit that referenced this issue Nov 30, 2014
Issue #75: Add configure-time check for struct sockpeercred (as used on
@Castaglia
Copy link
Member

Excellent! I've merged this to master, and backported the change to the 1.3.5 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants