diff options
author | ume <ume@FreeBSD.org> | 2006-05-03 15:14:47 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2006-05-03 15:14:47 +0000 |
commit | bc8c6150b8b8bcf7f4d87cd487737add8f446366 (patch) | |
tree | 57b771293a8b14dea4cb4dbd0c68b00b757d2a78 /etc | |
parent | a59756eac2fa7a25a9f1ce64a6fe8be92fede138 (diff) | |
download | FreeBSD-src-bc8c6150b8b8bcf7f4d87cd487737add8f446366.zip FreeBSD-src-bc8c6150b8b8bcf7f4d87cd487737add8f446366.tar.gz |
Install /etc/nsswitch.conf statically rather than generating it at
boot. Autogeneration of nsswitch.conf doesn't makes sense in 7.0
since it's not permitted to upgrade from a pre-nss release without
passing through an intermediate release.
Suggested by: brooks
Diffstat (limited to 'etc')
-rw-r--r-- | etc/Makefile | 4 | ||||
-rw-r--r-- | etc/nsswitch.conf | 15 | ||||
-rw-r--r-- | etc/rc.d/nsswitch | 64 |
3 files changed, 17 insertions, 66 deletions
diff --git a/etc/Makefile b/etc/Makefile index e2fa4bb..2cfe331 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -11,8 +11,8 @@ BIN1= amd.map apmd.conf auth.conf \ crontab csh.cshrc csh.login csh.logout devd.conf devfs.conf \ dhclient.conf disktab fbtab ftpusers gettytab group \ hosts hosts.allow hosts.equiv hosts.lpd \ - inetd.conf login.access login.conf \ - mac.conf motd netconfig network.subr networks newsyslog.conf \ + inetd.conf login.access login.conf mac.conf motd \ + netconfig network.subr networks newsyslog.conf nsswitch.conf \ portsnap.conf pf.conf pf.os phones profile protocols \ rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \ rc.sendmail rc.shutdown \ diff --git a/etc/nsswitch.conf b/etc/nsswitch.conf new file mode 100644 index 0000000..c95b9a4 --- /dev/null +++ b/etc/nsswitch.conf @@ -0,0 +1,15 @@ +# +# nsswitch.conf(5) - name service switch configuration file +# $FreeBSD$ +# +group: compat +group_compat: nis +hosts: files dns +networks: files +passwd: compat +passwd_compat: nis +shells: files +services: compat +services_compat: nis +protocols: files +rpc: files diff --git a/etc/rc.d/nsswitch b/etc/rc.d/nsswitch index de12b56..a99459a 100644 --- a/etc/rc.d/nsswitch +++ b/etc/rc.d/nsswitch @@ -36,54 +36,6 @@ name="nsswitch" start_cmd="nsswitch_start" stop_cmd=":" -convert_host_conf() -{ - host_conf=$1; shift; - nsswitch_conf=$1; shift; - - while read line; do - line=${line##[ ]} - case $line in - hosts|local|file) - _nsswitch="${_nsswitch}${_nsswitch+ }files" - ;; - dns|bind) - _nsswitch="${_nsswitch}${_nsswitch+ }dns" - ;; - nis) - _nsswitch="${_nsswitch}${_nsswitch+ }nis" - ;; - '#'*) - ;; - *) - printf "Warning: unrecognized line [%s]", $line > "/dev/stderr" - ;; - - esac - done < $host_conf - - echo "hosts: $_nsswitch" > $nsswitch_conf -} - -generate_nsswitch_conf() -{ - nsswitch_conf=$1; shift; - - cat >$nsswitch_conf <<EOF -group: compat -group_compat: nis -hosts: files dns -networks: files -passwd: compat -passwd_compat: nis -shells: files -services: compat -services_compat: nis -protocols: files -rpc: files -EOF -} - generate_host_conf() { nsswitch_conf=$1; shift; @@ -134,22 +86,6 @@ generate_host_conf() nsswitch_start() { - # Convert host.conf to nsswitch.conf if necessary - # - if [ -f "/etc/host.conf" -a ! -f "/etc/nsswitch.conf" ]; then - echo '' - echo 'Warning: /etc/host.conf is no longer used' - echo ' /etc/nsswitch.conf will be created for you' - convert_host_conf /etc/host.conf /etc/nsswitch.conf - fi - - # Generate default nsswitch.conf if none exists - # - if [ ! -f "/etc/nsswitch.conf" ]; then - echo 'Generating nsswitch.conf.' - generate_nsswitch_conf /etc/nsswitch.conf - fi - # Generate host.conf for compatibility # if [ ! -f "/etc/host.conf" -o \ |