Corruption for etc/pam.d/ftpd when running etcupdate for 14.3 to 15.0

0 views
Skip to first unread message

Sad Clouds

unread,
Jan 4, 2026, 9:39:40 AM (yesterday) Jan 4
to freebsd-...@freebsd.org
Hello, I'm observing corruption or bad merge for some files when
manually upgrading from 14.3 to 15.0 with etcupdate.

This looks like a bug in etcupdate. Can someone please confirm this?

UPDATE_ROOT="/mnt"
BENAME=15.0

# Create and mount new boot environment
bectl create ${BENAME:?}
bectl mount ${BENAME:?} ${UPDATE_ROOT:?}

# Perform base + kernel update
...

# Perform etc update

# 1) Extract etcupdate current tree from the base archive
tar -xpf base.txz ./var/db/etcupdate/current

# 2) Create etcupdate.tar.bz2 archive
tar -C ./var/db/etcupdate/current -jcf etcupdate.tar.bz2 ./ && rm -rf ./var

# 3) Run etcupdate merging new changes in etcupdate.tar.bz2 into /etc
etcupdate -D ${UPDATE_ROOT:?} -d ${UPDATE_ROOT:?}/var/db/etcupdate -F -t etcupdate.tar.bz2

After the above steps I end up with broken /mnt/etc/pam.d/ftpd. The
original file from 14.3 in /etc/pam.d/ftpd was never even modified.

All the other files in /etc seem to be OK according to:
etcupdate diff -D ${UPDATE_ROOT:?} -d ${UPDATE_ROOT:?}/var/db/etcupdate

cat /mnt/etc/pam.d/ftpd
#
# 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

Sad Clouds

unread,
3:40 AM (20 hours ago) 3:40 AM
to freebsd-...@freebsd.org
On Sun, 4 Jan 2026 14:38:21 +0000
Sad Clouds <cryintot...@gmail.com> wrote:

> After the above steps I end up with broken /mnt/etc/pam.d/ftpd. The
> original file from 14.3 in /etc/pam.d/ftpd was never even modified.
>

If anyone is interested, I had more time this morning to look into this
issue and the root cause seems to be etcupdate is not able to cope with
hard links:

ls -li /etc/pam.d/ftp*
21415 -rw-r--r-- 2 root wheel 347 Jun 6 2025 /etc/pam.d/ftp
21415 -rw-r--r-- 2 root wheel 347 Jun 6 2025 /etc/pam.d/ftpd

This results in corrupt updates for some of those files. I'm not sure
for how long this issue existed. It appears on FreeBSD-15.X the above
files are no longer hard links.

One way to work around it: prior to running etcupdate, remove hard
links on FreeBSD-14.X

rm /etc/pam.d/ftp
cp -a /etc/pam.d/ftpd /etc/pam.d/ftp

rm /var/db/etcupdate/current/etc/pam.d/ftp
cp -a /var/db/etcupdate/current/etc/pam.d/ftpd /var/db/etcupdate/current/etc/pam.d/ftp

Reply all
Reply to author
Forward
0 new messages