#67202 closed defect (fixed)

pure-ftpd: Virtual users feature does not work out of the box

Reported by: briankendall (Brian Kendall) Owned by: i0ntempest
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: pure-ftpd

Description

I just installed pure-ftpd on a macOS 12 system and tried to set up a virtual user. A number of things went wrong that I needed to address manually that ought to just work out of the box when installing pure-ftpd.

First, attempting to add a virtual user using pure-pw useradd testuser -u 501 -g 501 -d ~ fails with the following error message:

No useable password hashing function found
Please install libsodium (https://libsodium.org) and recompile pure-ftpd.

Apparently the binaries of pure-ftpd are not compiled with libsodium and therefore have no hashing function they can use for virtual users.

I worked around this by installing libsodium manually and then building pure-ftpd from source, i.e.:

port install libsodium
port install -s pure-ftpd

Now I can create a virtual user, and update the database file with pure-pw mkdb.

The next issue is that, while pure-ftpd's launch daemon is set up to use virtual users given that it uses the argument --login=puredb:/opt/local/etc/pure-ftpd/pdb/pureftpd.pdb, trying to log in with my virtual user fails with the following:

421 Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb

I thought this was odd, as I had run pure-pw mkdb. However the default place pure-pw places its database file is /opt/local/etc/pure-ftpd/conf/pureftpd.pdb, where the launch daemon is configured to look for it at /opt/local/etc/pure-ftpd/pdb/pureftpd.pdb. I worked around this with the following:

mkdir -p /opt/local/etc/pure-ftpd/pdb
pure-pw mkdb /opt/local/etc/pure-ftpd/pdb/pureftpd.pdb

Now finally I can log in as my virtual users!

In summary, two issues need to be addressed for virtual users to work correctly out of the box:

  1. libsodium should be a requirement of pure-ftpd, and binaries of pure-ftpd should be compiled with libsodium to allowing hashing of virtual user passwords
  2. One of the arguments of the pure-ftpd launch daemon should be changed from: --login=puredb:/opt/local/etc/pure-ftpd/pdb/pureftpd.pdb to --login=puredb:/opt/local/etc/pure-ftpd/conf/pureftpd.pdb so that pure-pw mkdb works as expected.

Change History (2)

comment:1 Changed 13 months ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to i0ntempest
Status: newassigned
Summary: Virtual users feature does not work out of the boxpure-ftpd: Virtual users feature does not work out of the box

comment:2 Changed 13 months ago by i0ntempest

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.