#827550 vsftpd: when executing pam_exec on successfull login vsftp hangs and is not possible to transfer files

Package:
vsftpd
Source:
vsftpd
Description:
lightweight, efficient FTP server written for security
Submitter:
antonio
Date:
2026-06-25 15:47:22 UTC
Severity:
normal
#827550#5
Date:
2016-06-17 15:50:00 UTC
From:
To:

#827550#10
Date:
2016-06-19 06:28:30 UTC
From:
To:
control: tag -1 +moreinfo
control: merge 827550 827551

Dear Antonio,

Thank you for your bug report.

As it stands you have not provided enough information for a Debian
contributor to investigate the problem.  Could you provide a log
including the error?

Thanks.

#827550#21
Date:
2016-06-20 09:20:25 UTC
From:
To:
Hi Sean,

Sorry, there is no error message in the server form the vsftpd service.

Below you can find the information for both connections (with and
without pam_exec), also add the information from the client, hope it
help to fix this issue.

Regards,
António


This is the log when pam is used for login without calling pam_exec:

** Server log
Jun 20 11:01:03 cmdev vsftpd[12152]: pam_unix(vsftpd:session): session
opened for user administrator by (uid=0)
Jun 20 11:01:03 cmdev vsftpd[12152]: [administrator] OK LOGIN: Client
"192.168.8.1"
Jun 20 11:01:03 cmdev systemd-logind[552]: New session c85 of user
administrator.
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "230 Login successful."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "CWD /local"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "250 Directory successfully changed."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "TYPE A"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "200 Switching to ASCII mode."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "PASV"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "227 Entering Passive Mode (192,168,8,2,6,8)."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "STOR test.php"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "150 Ok to send data."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] OK UPLOAD: Client
"192.168.8.1", "/local/test.php", 2683 bytes, 7616.62Kbyte/sec
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "226 Transfer complete."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "TYPE I"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "200 Switching to Binary mode."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "PASV"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "227 Entering Passive Mode (192,168,8,2,4,86)."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP command: Client
"192.168.8.1", "LIST -a"
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "150 Here comes the directory listing."
Jun 20 11:01:03 cmdev vsftpd[12154]: [administrator] FTP response:
Client "192.168.8.1", "226 Directory send OK."


** client log

Status:    Connecting to 192.168.8.2:21...
Status:    Connection established, waiting for welcome message...
Response:    220 Welcome to Commsmundi FTP server
Command:    USER administrator
Response:    331 Please specify the password.
Command:    PASS **********
Response:    230 Login successful.
Status:    Server does not support non-ASCII characters.
Status:    Connected
Status:    Starting upload of /home/antonio/Desktop/test.php
Command:    CWD /local
Response:    250 Directory successfully changed.
Command:    TYPE A
Response:    200 Switching to ASCII mode.
Command:    PASV
Response:    227 Entering Passive Mode (192,168,8,2,6,8).
Command:    STOR test.php
Response:    150 Ok to send data.
Response:    226 Transfer complete.
Status:    File transfer successful, transferred 2,683 bytes in 1 second




This is the log with pam_exec enabled (error transferring data):

** Server log
Jun 20 11:02:07 cmdev vsftpd[25478]: pam_exec(vsftpd:auth): Calling
/tmp/test.sh ...
Jun 20 11:02:07 cmdev vsftpd[25476]: pam_unix(vsftpd:session): session
opened for user administrator by (uid=0)
Jun 20 11:02:07 cmdev vsftpd[25476]: [administrator] OK LOGIN: Client
"192.168.8.1"
Jun 20 11:02:07 cmdev systemd-logind[552]: New session c87 of user
administrator.
Jun 20 11:02:07 cmdev vsftpd[25479]: [administrator] FTP response:
Client "192.168.8.1", "230 Login successful."
Jun 20 11:02:07 cmdev vsftpd[25479]: [administrator] FTP command: Client
"192.168.8.1", "CWD /local"
Jun 20 11:02:07 cmdev vsftpd[25479]: [administrator] FTP response:
Client "192.168.8.1", "250 Directory successfully changed."
Jun 20 11:02:08 cmdev vsftpd[25479]: [administrator] FTP command: Client
"192.168.8.1", "TYPE A"
Jun 20 11:02:08 cmdev vsftpd[25479]: [administrator] FTP response:
Client "192.168.8.1", "200 Switching to ASCII mode."
Jun 20 11:02:08 cmdev vsftpd[25479]: [administrator] FTP command: Client
"192.168.8.1", "PASV"


The pam_exec script is executed, "auth    optional    pam_exec.so debug
seteuid log=/tmp/pam_exec.log /tmp/test.sh", in the log i see:

*** Mon Jun 20 11:02:07 2016
administrator



** client log
Status:    Connecting to 192.168.8.2:21...
Status:    Connection established, waiting for welcome message...
Response:    220 Welcome to Commsmundi FTP server
Command:    USER administrator
Response:    331 Please specify the password.
Command:    PASS **********
Response:    230 Login successful.
Status:    Server does not support non-ASCII characters.
Status:    Connected
Status:    Starting upload of /home/antonio/Desktop/test.php
Command:    CWD /local
Response:    250 Directory successfully changed.
Command:    TYPE A
Response:    200 Switching to ASCII mode.
Command:    PASV
Error:    Connection timed out
Error:    File transfer failed

#827550#26
Date:
2020-01-27 04:17:05 UTC
From:
To:
#827550#31
Date:
2026-06-25 15:40:06 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
vsftpd, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 827550@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Keng-Yu Lin <kengyu@debian.org> (supplier of updated vsftpd package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Thu, 25 Jun 2026 22:40:00 +0800
Source: vsftpd
Built-For-Profiles: noudeb
Architecture: source
Version: 3.0.5-1
Distribution: unstable
Urgency: medium
Maintainer: Keng-Yu Lin <kengyu@debian.org>
Changed-By: Keng-Yu Lin <kengyu@debian.org>
Closes: 644920 825271 827550 838678 844297 885402 929958 950577 950584 952421 958469 961712 968888 973766 1012476
Changes:
 vsftpd (3.0.5-1) unstable; urgency=medium
 .
   * Add debian/patches/0079-debian-bugfixes.patch to address multiple bugs:
     - Return 502 Command not implemented instead of 550 for disabled
       PASV/PORT commands (Closes: #1012476).
     - Document the Debian-specific utf8_filesystem option in the
       man page (Closes: #950577).
     - Trim leading and trailing whitespace/tabs in vsftpd.conf parsing
       to prevent startup failures due to extra spaces (Closes: #950584).
     - Dynamically fall back to IPv4 listening if IPv6 is disabled in
       the kernel, avoiding package installation and daemon startup
       failures (Closes: #961712).
   * Add debian/patches/0080-pam-exec-hang.patch to prevent hanging in
     the SIGCHLD handler when using PAM modules that spawn subprocesses,
     e.g. pam_exec (Closes: #952421, #827550).
   * Add debian/patches/0081-pasv-address-ipv6.patch to fix pasv_address
     being ignored when listen_ipv6 is enabled and clients connect
     via IPv4 (Closes: #968888).
   * Add debian/patches/0082-debian-bugfixes-tls-utf8.patch to fix:
     - Cap TLS 1.3 session ticket lifetime at 7 days (604800s) instead
       of INT_MAX to comply with RFC 8446, preventing connection drops on
       both control and data channels (Closes: #929958, #958469).
     - Allow UTF-8 characters (high bytes >= 128) in logs and fix 177
       typo in printability check (Closes: #644920).
     - Fix assignment typo in vsf_sysutil_realpath causing double slashes
       when resolving paths under the root directory (Closes: #825271).
     - Remove obsolete absolute paths to pam_userdb.so in virtual users
       examples (Closes: #885402).
   * Move adduser from Recommends to Depends to satisfy postinst script.
   * Officially close historically resolved/satisfied bugs that were left
     open in the Debian Bug Tracking System (Closes: #838678, #844297, #973766).
Checksums-Sha1:
 e89a4181f761a4c2ab46650e236eebec5b2a2fa4 1979 vsftpd_3.0.5-1.dsc
 6032bde540e8463743db9c38fba3a9cc2a584509 40932 vsftpd_3.0.5-1.debian.tar.xz
 41a2d3204773be4132348141d58f877b958cc5a5 7662 vsftpd_3.0.5-1_source.buildinfo
Checksums-Sha256:
 b7d0b80446298de719b9c75480454ea4d0fe80f487684c7df8d1f0c71d2a055e 1979 vsftpd_3.0.5-1.dsc
 4f24fdf374d2ff2bb0a749ef3a6db110ca3a30577c053a7ffaa902d882b2c843 40932 vsftpd_3.0.5-1.debian.tar.xz
 f1b81ef09409584caa63d48ecd019889e34d6cb26f28ac1725ecad328a655d35 7662 vsftpd_3.0.5-1_source.buildinfo
Files:
 1535e6c2a8445e6a8306b294975b42a7 1979 net - vsftpd_3.0.5-1.dsc
 f23c7fde59435c896033cc7d9fa24b3f 40932 net - vsftpd_3.0.5-1.debian.tar.xz
 ccc1766c8c9970127a3c28aad71a0eb8 7662 net - vsftpd_3.0.5-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJGBAEBCgAwFiEEdwtc2/tLhothQ0hFxheGnxR4UE4FAmo9RpoSHGtlbmd5dUBk
ZWJpYW4ub3JnAAoJEMYXhp8UeFBOBZoQAJgA0vT6Cy/3UEQftfU3aMmIl5xAoNxj
nbB64UaCtToVZiu1LMD36RpzRAf82aaO1MyGXkg4YkaR1DQWkvmmLEKn9vN2BgqQ
Z+TPEOKYSfum5BbfTpWI0OKEAzt6TgtcV12q6SdSZbDT7qlUQDKxZicojKXePCCN
gdH7PetlN4+w6c4czyYl+Vg5aSPv7qqrvroK6FONz5Q90B6kj+1wdvL3jjkhTYgr
1uIlmR9hLVsI/ab6OmHbtn7VjlO1XKE2NMrGr+NcCPFmSjVU1dUmcY+0pdojB8y7
u+vm0CT4KXI46RGUSTkrVKvibo/jdtrRG9WYKLN6sTMa69k310LUvZwuVaMT8kuJ
k9VvVWrHL83f9vjAPkXck722caYQ2QTzkcMQVFWts4WTFTktAHyPaLA+w3OXKiys
thpp5H7uBWLQukg7x4TivFt3nDB2RifqJFjQUcNpfKFkvsmafhZbkE48Zh1sJDSX
wjeib4h5sMii899gmTFkPDzyPQdxULey2q1URR3sNY/8uYLb2LHEy0WFR5unoTpz
ezkUbdgiFkeZOemZBoIgf7OBjWgpXsxZtsYS4JhP1S7Y0ZJdVfk/HyMqot98ht8Y
rO45bkeFIh4+VB4FQobA9HaZiMrcK+P9yLVQZi+tiJdecH2nLF9+4ZJbMcRRu0qN
9N9M8AKNBI11
=V8J2
-----END PGP SIGNATURE-----