Skip to content

Commit

Permalink
Use PRECIOUSPROG instead of custom code to handle schg
Browse files Browse the repository at this point in the history
This allows to preserve schg when installed with -DNO_ROOT

MFC after:	1 week
  • Loading branch information
bapt committed Feb 12, 2015
1 parent 54f0d78 commit 8486c03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
13 changes: 1 addition & 12 deletions usr.bin/chpass/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PROG= chpass
SRCS= chpass.c edit.c field.c pw_scan.c table.c util.c
BINOWN= root
BINMODE=4555
PRECIOUSPROG=
.if ${MK_NIS} != "no"
CFLAGS+= -DYP
.endif
Expand All @@ -34,16 +35,4 @@ 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

.if !defined(NO_FSCHG)
afterinstall:
-chflags schg ${DESTDIR}${BINDIR}/chpass
.endif

.include <bsd.prog.mk>
12 changes: 1 addition & 11 deletions usr.bin/passwd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@ 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 <bsd.prog.mk>

0 comments on commit 8486c03

Please sign in to comment.