Skip to contentSkip to conversation

proftpd: fix system account login failure

PATCH New [email protected] 1 participant 1 message Aug 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proftpd: fix system account login failure

From: Mingli Yu <[email protected]>

When pam is enabled,
1, Customize the proftpd.conf to use pam to authenticate 2, Add proftpd pam configuration file /etc/pam.d/proftpd

---
 meta-networking/recipes-daemons/proftpd/proftpd_1.3.5a.bb | 9 +++++++++
 1 file changed, 9 insertions(+)
meta-networking/recipes-daemons/proftpd/proftpd_1.3.5a.bb +9 -0
index b6fd4b2..2332ef8 100644
@@ -92,6 +92,15 @@ do_install () {
     # create the pub directory
     mkdir -p ${D}/home/${FTPUSER}/pub/
     chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
+        # install proftpd pam configuration
+        install -d ${D}${sysconfdir}/pam.d
+        install -m 644 ${S}/contrib/dist/rpm/ftp.pamd ${D}${sysconfdir}/pam.d/proftpd
+        sed -i '/ftpusers/d' ${D}${sysconfdir}/pam.d/proftpd
+        # specify the user Authentication config
+        sed -i '/^MaxInstances/a\AuthPAM                         on\nAuthPAMConfig                   proftpd' \
+            ${D}${sysconfdir}/proftpd.conf
+    fi
 
     install -d ${D}/${systemd_unitdir}/system
     install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
Signature · 1 line
2.8.1