Author Topic: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql  (Read 472 times)

Offline Wanderedinn

  • Regular User
  • **
  • Posts: 34
    • View Profile
So, we recently updated our version of proftpd to 1.3.5-b.  Custom compile to include mod_sql so we could write log data to a Microsoft SQL server.  We have seen a handful of clients who are seeing disconnects.  In the proftpd log we see:

ProFTPD terminating (signal 11)

From one of our clients who is experiencing these disconnects they are seeing this:

**** pty read: pseudo-tty: Input/output error
---- Disconnecting

Prior to the update, this issue did not exist.  Any suggestions as to what may be causing this problem?
Thanks, Geof

Offline Flo

  • Supporter
  • ***
  • Posts: 109
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #1 on: March 14, 2017, 05:57:43 pm »
What does "proftpd -V" say ?

Offline Wanderedinn

  • Regular User
  • **
  • Posts: 34
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #2 on: March 14, 2017, 06:37:29 pm »
Compile-time Settings:
  Version: 1.3.5b (maint)
  Platform: LINUX [Linux 2.6.18-417.el5 x86_64]
  Built: Fri Oct 14 2016 15:58:55 EDT
  Built With:
    configure  '--prefix=/usr/proftpd' '--sysconfdir=/ftp/proftpd/etc' '--localstatedir=/usr/proftpd/var' 'LIBS=-lodbc' '--with-modules=mod_sql:mod_sql_odbc:mod_sftp:mod_tls:mod_sql_tds' '--with-includes=/usr/include/freetds' '--with-libraries=/usr/local/lib' '--with-includes=/usr/local/include'

  CFLAGS: -O2 -Wall
  LDFLAGS: -L$(top_srcdir)/lib  -L/usr/local/lib
  LIBS:  -lssl -lcrypto -L$(top_srcdir)/lib/libcap -lcap  -lsybdb  -lssl  -lcrypto -lz -lsupp -lcrypt -lodbc

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

  Features:
    - Autoshadow support
    - Controls support
    - curses support
    - Developer support
    - DSO support
    + IPv6 support
    + Largefile support
    - Lastlog support
    - Memcache support
    - ncurses support
    - NLS support
    + OpenSSL support (FIPS enabled)
    - PCRE support
    - POSIX ACL support
    + Shadow file support
    + 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

Offline Flo

  • Supporter
  • ***
  • Posts: 109
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #3 on: March 14, 2017, 06:56:16 pm »
Is the login data of the users stored in plain text or encrypted ? If encrypted, then

mod_sql_passwd

is missing. If it is stored in plain text, please share your sql log, which can be enabled with

SQLLogFile /var/log/proftpd/sql.log

in your proftpd.conf

Offline Flo

  • Supporter
  • ***
  • Posts: 109
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #4 on: March 14, 2017, 06:57:50 pm »
Sorry, i didnt see
mod_sql_tds

Please share the log first so i can look for an error.

Offline Wanderedinn

  • Regular User
  • **
  • Posts: 34
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #5 on: March 15, 2017, 12:48:07 pm »
I'm sharing the proftpd log, transfer log and a subset of the sql log that pertains to this transaction.  The sql log for the related process id is over 4000 lines as 51 files were transferred during this connection.   If you need more of it, let me know and I'll provide it.

(replaced non-pertinent info with ...)

proftpd log:

2017-03-12 13:00:21,045 proftpd[878] ...  SSH2 session opened.
2017-03-12 13:00:21,370 proftpd[878] ...  USER USERID: Login successful
2017-03-12 13:00:21,371 proftpd[878] ...  USER USERID: Login successful.
2017-03-12 13:00:28,306 proftpd[878] ...  ProFTPD terminating (signal 11)
2017-03-12 13:00:28,306 proftpd[878] ...  SSH2 session closed.
2017-03-12 13:00:28,517 proftpd[2131] ... SSH2 session opened.


transfer log:

Sun Mar 12 13:00:28 2017 0 ... 55040 /.../filename.txt b _ i r USERID sftp 0 * c

sql log:

.
.
2017-03-12 13:00:28,268 mod_sql/4.3[878]: <<< tds cmd_open
2017-03-12 13:00:28,268 mod_sql/4.3[878]: query "INSERT INTO TABLE VALUES ('USERID', '2017-03-12 13:00:28', '/.../filename.txt', 'STOR' , '', 'sftp', 55040, 'xxx.xxx.xxx.xxx')"
2017-03-12 13:00:28,306 mod_sql/4.3[878]: >>> tds cmd_close
2017-03-12 13:00:28,306 mod_sql/4.3[878]: connection 'default' count is now 1
2017-03-12 13:00:28,306 mod_sql/4.3[878]: <<< tds cmd_close
2017-03-12 13:00:28,306 mod_sql/4.3[878]: <<< tds cmd_insert
2017-03-12 13:00:28,306 mod_sql/4.3[878]: <<< process_named_query 'insertfileinfo'
2017-03-12 13:00:28,306 mod_sql/4.3[878]: <<< log_master (SQLLog_STOR)
2017-03-12 13:00:28,306 mod_sql/4.3[878]: >>> tds cmd_exit
2017-03-12 13:00:28,306 mod_sql/4.3[878]: >>> tds cmd_close
2017-03-12 13:00:28,306 mod_sql/4.3[878]: connection 'default' closed
2017-03-12 13:00:28,306 mod_sql/4.3[878]: connection 'default' count is now 0
2017-03-12 13:00:28,306 mod_sql/4.3[878]: <<< tds cmd_close
2017-03-12 13:00:28,306 mod_sql/4.3[878]: <<< tds cmd_exit

Offline Wanderedinn

  • Regular User
  • **
  • Posts: 34
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #6 on: March 17, 2017, 12:53:02 pm »
So it appears that we have determined this issue is caused actually by the client connecting.  The client is lftp using the ssh protocol.  It's difficult to determine the exact reason, but it appears that if a file already exists on the target server, in some cases, lftp generates a segfault.  I'm not sure why this causes proftpd to generate a signal 11 and disconnect.

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5336
    • View Profile
    • http://www.castaglia.org/
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #7 on: March 18, 2017, 05:38:01 pm »
Hmm.  Is it possible that, given you are using ProFTPD 1.3.5, you might be encountering either of these issues:

  http://bugs.proftpd.org/show_bug.cgi?id=4287
  http://bugs.proftpd.org/show_bug.cgi?id=4288

Offline Wanderedinn

  • Regular User
  • **
  • Posts: 34
    • View Profile
Re: Disconnects after upgrading proftpd to Proftpd-1.3.5-b using mod_sql
« Reply #8 on: March 21, 2017, 03:48:57 pm »
I need to test with 1.3.6 I guess.  I'll see if I can rebuild with 1.3.6 and test.  Any idea when 1.3.6 will be available (not a rc)?
« Last Edit: March 22, 2017, 01:22:31 pm by Wanderedinn »