Bug 171779

Summary: [patch] passwd(1): make option NO_FSCHG incomplete
Product: Base System Reporter: Gareth de Vaux <freebsd>
Component: binAssignee: Enji Cooper <ngie>
Status: Closed FIXED    
Severity: Affects Some People CC: ngie
Priority: Normal Flags: ngie: mfc-stable10+
ngie: mfc-stable9+
ngie: mfc-stable8-
Version: 8.3-STABLE   
Hardware: Any   
OS: Any   

Description Gareth de Vaux 2012-09-19 14:30:21 UTC
Outlined in http://lists.freebsd.org/pipermail/freebsd-stable/2012-September/069610.html

Running a make installworld with NO_FSCHG defined fails to prevent /usr/bin/passwd being installed with the schg flag.

Fix: 

add conditional to 'afterinstall' in /usr/src/usr.bin/passwd/Makefile:

.if !defined(NO_FSCHG)
afterinstall:
        -chflags schg ${DESTDIR}${BINDIR}/passwd
.endif
How-To-Repeat: chflags -R noschg /
NO_FSCHG=true
make installworld
ls -lo /usr/bin/passwd
Comment 1 Jaakko Heinonen freebsd_committer freebsd_triage 2012-11-27 16:46:42 UTC
State Changed
From-To: open->patched

Fixed in head (r243617).
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2015-10-25 21:38:48 UTC
- stable/8 has been EOLed.
- It hasn't been MFCed to stable/9.
- Already present in stable/10.

Taking for the MFC.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-10-25 21:49:34 UTC
A commit references this bug:

Author: ngie
Date: Sun Oct 25 21:48:46 UTC 2015
New revision: 289944
URL: https://svnweb.freebsd.org/changeset/base/289944

Log:
  MFC r243617 (to fix a longstanding bug):

  PR: 171779

  r243617 (by pjd):

  Respect NO_FSCHG and don't set 'schg' flag on passwd/yppasswd is defined.

Changes:
_U  stable/9/
_U  stable/9/usr.bin/
_U  stable/9/usr.bin/passwd/
  stable/9/usr.bin/passwd/Makefile