diff --git a/usr.bin/passwd/Makefile b/usr.bin/passwd/Makefile index d914060f53b6..f1fff4668709 100644 --- a/usr.bin/passwd/Makefile +++ b/usr.bin/passwd/Makefile @@ -7,10 +7,20 @@ PROG = passwd BINOWN = root BINMODE = 4555 LIBADD = pam -PRECIOUSPROG= .if ${MK_NIS} != "no" LINKS = ${BINDIR}/passwd ${BINDIR}/yppasswd MLINKS = passwd.1 yppasswd.1 .endif +beforeinstall: +.for i in passwd yppasswd + [ ! -e ${DESTDIR}${BINDIR}/$i ] || \ + chflags noschg ${DESTDIR}${BINDIR}/$i || true +.endfor + +.if !defined(NO_FSCHG) +afterinstall: + -chflags schg ${DESTDIR}${BINDIR}/passwd +.endif + .include