From 03452a498cd474fcc1edcaafa9cbb024fef2c479 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 17 Sep 2018 18:56:47 +0000 Subject: [PATCH] Move hosts, hosts.equiv, networks, nsswitch.conf, protocols to lib/libc/net/ This uses relative paths to make it more specific to avoid any potential future problems with .PATH and leverages CONFS. 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: re (gjb), will (mentor) Differential Revision: https://reviews.freebsd.org/D17164 --- etc/Makefile | 9 --------- lib/libc/net/Makefile.inc | 6 ++++++ {etc => lib/libc/net}/hosts | 0 {etc => lib/libc/net}/hosts.equiv | 0 {etc => lib/libc/net}/networks | 0 {etc => lib/libc/net}/nsswitch.conf | 0 {etc => lib/libc/net}/protocols | 0 7 files changed, 6 insertions(+), 9 deletions(-) rename {etc => lib/libc/net}/hosts (100%) rename {etc => lib/libc/net}/hosts.equiv (100%) rename {etc => lib/libc/net}/networks (100%) rename {etc => lib/libc/net}/nsswitch.conf (100%) rename {etc => lib/libc/net}/protocols (100%) diff --git a/etc/Makefile b/etc/Makefile index 71283a973eaa..91eaa0ca50fc 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -16,18 +16,13 @@ BIN1= \ dhclient.conf \ disktab \ group \ - hosts \ hosts.allow \ - hosts.equiv \ libalias.conf \ libmap.conf \ login.access \ mac.conf \ netconfig \ - networks \ - nsswitch.conf \ phones \ - protocols \ rc.bsdextended \ rc.firewall \ remote \ @@ -160,10 +155,6 @@ distribution: ${DESTDIR}/boot/device.hints .endif .endif -.if ${MK_NIS} == "no" - sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ - ${DESTDIR}/etc/nsswitch.conf -.endif MTREE_CMD?= mtree diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc index 304c465b8545..b31c1a36fcfe 100644 --- a/lib/libc/net/Makefile.inc +++ b/lib/libc/net/Makefile.inc @@ -4,6 +4,7 @@ # machine-independent net sources .PATH: ${LIBC_SRCTOP}/net +CONFS+= net/hosts net/hosts.equiv net/networks net/nsswitch.conf net/protocols SRCS+= base64.c ether_addr.c eui64.c \ gai_strerror.c getaddrinfo.c \ gethostbydns.c gethostbyht.c gethostbynis.c gethostnamadr.c \ @@ -123,3 +124,8 @@ SRCS+= hesiod.c MAN+= hesiod.3 .endif +.if ${MK_NIS} == "no" +afterinstallconfig: + sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \ + ${DESTDIR}/etc/nsswitch.conf +.endif diff --git a/etc/hosts b/lib/libc/net/hosts similarity index 100% rename from etc/hosts rename to lib/libc/net/hosts diff --git a/etc/hosts.equiv b/lib/libc/net/hosts.equiv similarity index 100% rename from etc/hosts.equiv rename to lib/libc/net/hosts.equiv diff --git a/etc/networks b/lib/libc/net/networks similarity index 100% rename from etc/networks rename to lib/libc/net/networks diff --git a/etc/nsswitch.conf b/lib/libc/net/nsswitch.conf similarity index 100% rename from etc/nsswitch.conf rename to lib/libc/net/nsswitch.conf diff --git a/etc/protocols b/lib/libc/net/protocols similarity index 100% rename from etc/protocols rename to lib/libc/net/protocols