From 5294f47313a2d45cb876c50ccb759a2073bc2ea2 Mon Sep 17 00:00:00 2001 From: gjb Date: Thu, 28 Jan 2016 02:56:30 +0000 Subject: [PATCH] Restore the 'beforeinstall' for chpass(1), so files with the schg flag are handled before being replaced by a symbolic link. Fix passwd(1)/yppasswd(1) schg issue similarly to chpass(1). Note: These are likely temporary fixes while identifying any remaining files that are not marked as 'flags=schg' via mtree(8). Sponsored by: The FreeBSD Foundation --- usr.bin/chpass/Makefile | 7 +++++++ usr.bin/passwd/Makefile | 8 ++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/usr.bin/chpass/Makefile b/usr.bin/chpass/Makefile index 96bbd4be6eaa..16974e211d92 100644 --- a/usr.bin/chpass/Makefile +++ b/usr.bin/chpass/Makefile @@ -35,4 +35,11 @@ MLINKS= chpass.1 chfn.1 chpass.1 chsh.1 MLINKS+= chpass.1 ypchpass.1 chpass.1 ypchfn.1 chpass.1 ypchsh.1 .endif +beforeinstall: +.for i in chpass chfn chsh ypchpass ypchfn ypchsh +.if exists(${DESTDIR}${BINDIR}/$i) + -chflags noschg ${DESTDIR}${BINDIR}/$i +.endif +.endfor + .include diff --git a/usr.bin/passwd/Makefile b/usr.bin/passwd/Makefile index f1fff4668709..fac1bb105809 100644 --- a/usr.bin/passwd/Makefile +++ b/usr.bin/passwd/Makefile @@ -6,9 +6,10 @@ PROG = passwd BINOWN = root BINMODE = 4555 +PRECIOUSPROG= LIBADD = pam .if ${MK_NIS} != "no" -LINKS = ${BINDIR}/passwd ${BINDIR}/yppasswd +SYMLINKS = ${BINDIR}/passwd ${BINDIR}/yppasswd MLINKS = passwd.1 yppasswd.1 .endif @@ -18,9 +19,4 @@ beforeinstall: chflags noschg ${DESTDIR}${BINDIR}/$i || true .endfor -.if !defined(NO_FSCHG) -afterinstall: - -chflags schg ${DESTDIR}${BINDIR}/passwd -.endif - .include