git: 7a8747f53498 - main - libpam: provide a real /etc/pam.d/ftp

From: Lexi Winter <ivy_at_FreeBSD.org>
Date: Thu, 15 May 2025 00:04:14 UTC
The branch main has been updated by ivy:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a8747f53498fe2e3ff0f87ce2a184316b115ae5

commit 7a8747f53498fe2e3ff0f87ce2a184316b115ae5
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2025-05-14 14:15:46 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2025-05-15 00:02:52 +0000

    libpam: provide a real /etc/pam.d/ftp
    
    We provide both /etc/pam.d/ftp and /etc/pam.d/ftpd because FTP servers
    are inconsistent about which service name they use.  Previously ftp was
    a hard link to ftpd; to avoid hard linking config files, replace ftp
    with a normal config file that includes the ftpd service.
    
    Previously /etc/pam.d/ftpd was in the -ftp package, while /etc/pam.d/ftp
    was in the -runtime package (by accident, not design).  Move both of
    them to the -runtime package, where the rest of the pam.d services live,
    since FTP servers from ports use it and people using a ports FTP server
    might not want to to install the -ftp package as well.
    
    This also fixes /etc/pam.d/ftp missing the @config tag.
    
    Reviewed by:    des, bapt
    Approved by:    des (mentor)
    Differential Revision:  https://reviews.freebsd.org/D50339
---
 lib/libpam/pam.d/Makefile | 11 ++++-------
 lib/libpam/pam.d/ftp      | 13 +++++++++++++
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/lib/libpam/pam.d/Makefile b/lib/libpam/pam.d/Makefile
index 5dccf590ee4e..a58c37b6c223 100644
--- a/lib/libpam/pam.d/Makefile
+++ b/lib/libpam/pam.d/Makefile
@@ -22,18 +22,15 @@ CRONPACKAGE=	cron
 
 .if ${MK_AT} != "no"
 CONFGROUPS+=	AT
-AT+=	atrun
+AT+=		atrun
 ATPACKAGE+=	at
 .endif
 
 .if ${MK_FTP} != "no"
 CONFGROUPS+=	FTP
-FTP+=	ftpd
-FTPPACKAGE=	ftp
-
-LINKMODE=	${CONFMODE}
-afterinstallconfig:
-	${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${CONFDIR}/ftpd ${DESTDIR}${CONFDIR}/ftp
+FTP+=		ftp ftpd
+# Do not put these in the ftp package, since ports also use them.
+FTPPACKAGE=	runtime
 .endif
 
 .include <bsd.prog.mk>
diff --git a/lib/libpam/pam.d/ftp b/lib/libpam/pam.d/ftp
new file mode 100644
index 000000000000..1c255441dca6
--- /dev/null
+++ b/lib/libpam/pam.d/ftp
@@ -0,0 +1,13 @@
+#
+# PAM configuration for the "ftp" service.  This is not used by the FreeBSD
+# ftpd(8), but is provided for compatibility with FTP servers from ports.
+#
+
+# auth
+auth		include		ftpd
+
+# account
+account		include		ftpd
+
+# session
+session		include		ftpd