From 871b6b10ce2f27a95f1113736f26a1a4d576d1b7 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 16 May 2019 01:09:13 +0000 Subject: [PATCH] Move master.passwd and group to lib/libc/gen/ libc was picked as the destination location for these because of the syscalls that use these files as the lowest level place they are referenced. Approved by: will (mentor), rgrimes, manu Differential Revision: https://reviews.freebsd.org/D16728 --- Makefile.inc1 | 4 ++-- etc/Makefile | 17 +---------------- lib/libc/gen/Makefile.inc | 16 +++++++++++++++- {etc => lib/libc/gen}/group | 0 {etc => lib/libc/gen}/master.passwd | 0 5 files changed, 18 insertions(+), 19 deletions(-) rename {etc => lib/libc/gen}/group (100%) rename {etc => lib/libc/gen}/master.passwd (100%) diff --git a/Makefile.inc1 b/Makefile.inc1 index bd82cee8b951..293a0d4aad44 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -871,8 +871,8 @@ DB_FROM_SRC= yes .endif .if defined(DB_FROM_SRC) -INSTALLFLAGS+= -N ${.CURDIR}/etc -MTREEFLAGS+= -N ${.CURDIR}/etc +INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen +MTREEFLAGS+= -N ${.CURDIR}/lib/libc/gen .endif _INSTALL_DDIR= ${DESTDIR}/${DISTDIR} INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} diff --git a/etc/Makefile b/etc/Makefile index 4714b580cc82..ee8b2dd6ee56 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -15,7 +15,6 @@ SUBDIR+=sendmail .endif BIN1= \ - group \ login.access \ rc.bsdextended \ rc.firewall \ @@ -65,21 +64,7 @@ distribution: .endif cd ${.CURDIR}; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${BIN1} ${DESTDIR}/etc; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - master.passwd ${DESTDIR}/etc; - -.if ${MK_TCSH} == "no" - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd -.endif - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd -.if defined(NO_ROOT) - ( \ - echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ - echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ - echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ - ) | ${METALOG.add} -.endif + ${BIN1} ${DESTDIR}/etc ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index fa292fc4984d..7746dab96bf2 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -4,7 +4,8 @@ # machine-independent gen sources .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen -CONFS= shells +CONFS+= group master.passwd shells +CONFSMODE_master.passwd= 600 SRCS+= __getosreldate.c \ __pthread_mutex_init_calloc_cb_stub.c \ @@ -543,3 +544,16 @@ MLINKS+=vis.3 nvis.3 \ vis.3 svis.3 MLINKS+=wordexp.3 wordfree.3 + +afterinstallconfig: +.if ${MK_TCSH} == "no" + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd +.endif + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd +.if defined(NO_ROOT) && defined(METALOG) + ( \ + echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ + echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ + echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ + ) | cat -l >> ${METALOG} +.endif diff --git a/etc/group b/lib/libc/gen/group similarity index 100% rename from etc/group rename to lib/libc/gen/group diff --git a/etc/master.passwd b/lib/libc/gen/master.passwd similarity index 100% rename from etc/master.passwd rename to lib/libc/gen/master.passwd