[MacPorts] #67202: Virtual users feature does not work out of the box

MacPorts noreply at macports.org
Fri Apr 7 01:45:08 UTC 2023


#67202: Virtual users feature does not work out of the box
--------------------------+-----------------------
 Reporter:  briankendall  |      Owner:  (none)
     Type:  defect        |     Status:  new
 Priority:  Normal        |  Milestone:
Component:  ports         |    Version:
 Keywords:                |       Port:  pure-ftpd
--------------------------+-----------------------
 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/67202>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list