From: frank Date: Mon, 16 Jan 2012 06:16:09 +0000 (+0100) Subject: committing changes in /etc after emerge run X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=afe8e219267967be3e84e5b0722ca5f57dd5e1eb;p=config%2Fbruni%2Fetc.git committing changes in /etc after emerge run Package changes: +net-dialup/ppp-2.4.5-r1 --- diff --git a/.etckeeper b/.etckeeper index 6aa5af16..03589ccb 100755 --- a/.etckeeper +++ b/.etckeeper @@ -7,6 +7,7 @@ mkdir -p './polkit-1/localauthority/20-org.d' mkdir -p './polkit-1/localauthority/30-site.d' mkdir -p './polkit-1/localauthority/50-local.d' mkdir -p './polkit-1/localauthority/90-mandatory.d' +mkdir -p './ppp/peers' mkdir -p './security/limits.d' mkdir -p './security/namespace.d' mkdir -p './skel/.ssh' @@ -421,6 +422,7 @@ maybe chmod 0644 './modprobe.d/aliases.conf' maybe chmod 0644 './modprobe.d/blacklist.conf' maybe chmod 0644 './modprobe.d/i386.conf' maybe chmod 0644 './modprobe.d/pnp-aliases.conf' +maybe chmod 0644 './modprobe.d/ppp.conf' maybe chmod 0644 './modprobe.d/usb-load-ehci-first.conf' maybe chmod 0644 './mtab' maybe chmod 0755 './mysql' @@ -456,6 +458,7 @@ maybe chmod 0644 './pam.d/other' maybe chmod 0644 './pam.d/passwd' maybe chmod 0644 './pam.d/polkit-1' maybe chmod 0644 './pam.d/pop' +maybe chmod 0644 './pam.d/ppp' maybe chmod 0644 './pam.d/screen' maybe chmod 0644 './pam.d/shadow' maybe chmod 0644 './pam.d/sshd' @@ -501,6 +504,21 @@ maybe chmod 0644 './portage/postsync.d/q-reinitialize' maybe chmod 0755 './portage/savedconfig' maybe chmod 0755 './portage/savedconfig/sys-apps' maybe chmod 0644 './portage/savedconfig/sys-apps/busybox-1.19.3-r1' +maybe chmod 0755 './ppp' +maybe chmod 0600 './ppp/chap-secrets.example' +maybe chmod 0755 './ppp/ip-down' +maybe chmod 0755 './ppp/ip-down.d' +maybe chmod 0644 './ppp/ip-down.d/30-wins.sh' +maybe chmod 0644 './ppp/ip-down.d/40-dns.sh' +maybe chmod 0644 './ppp/ip-down.d/50-initd.sh' +maybe chmod 0755 './ppp/ip-up' +maybe chmod 0755 './ppp/ip-up.d' +maybe chmod 0644 './ppp/ip-up.d/30-wins.sh' +maybe chmod 0644 './ppp/ip-up.d/40-dns.sh' +maybe chmod 0644 './ppp/ip-up.d/50-initd.sh' +maybe chmod 0644 './ppp/options' +maybe chmod 0600 './ppp/pap-secrets.example' +maybe chmod 0755 './ppp/peers' maybe chmod 0644 './profile' maybe chmod 0755 './profile.d' maybe chmod 0644 './profile.d/.keep' diff --git a/modprobe.d/ppp.conf b/modprobe.d/ppp.conf new file mode 100644 index 00000000..e936041c --- /dev/null +++ b/modprobe.d/ppp.conf @@ -0,0 +1,10 @@ +alias char-major-108 ppp_generic +alias /dev/ppp ppp_generic +alias tty-ldisc-3 ppp_async +alias tty-ldisc-13 n_hdlc +alias tty-ldisc-14 ppp_synctty +alias ppp-compress-18 ppp_mppe +alias ppp-compress-21 bsd_comp +alias ppp-compress-24 ppp_deflate +alias ppp-compress-26 ppp_deflate +alias net-pf-24 pppoe diff --git a/pam.d/ppp b/pam.d/ppp new file mode 100644 index 00000000..b94d4877 --- /dev/null +++ b/pam.d/ppp @@ -0,0 +1,6 @@ +# File autogenerated by pamd_mimic in pam eclass + + +auth include system-auth +account include system-auth +session include system-auth diff --git a/ppp/chap-secrets.example b/ppp/chap-secrets.example new file mode 100644 index 00000000..7d1c3cd7 --- /dev/null +++ b/ppp/chap-secrets.example @@ -0,0 +1,2 @@ +# Secrets for authentication using CHAP +# client server secret IP addresses diff --git a/ppp/ip-down b/ppp/ip-down new file mode 100755 index 00000000..7795ccab --- /dev/null +++ b/ppp/ip-down @@ -0,0 +1,17 @@ +#!/bin/sh + +# This script is run by pppd after the link is brought down. +# It executes all the scripts available in /etc/ppp/ip-down.d directory, +# with the following parameters: +# $1 = interface name (e.g. ppp0) +# $2 = tty device +# $3 = speed +# $4 = local IP address +# $5 = remote IP address +# $6 = ipparam (user specified parameter, see man pppd) + +cd /etc/ppp/ip-down.d || exit + +for SCRIPT in *.sh ; do + . ./"${SCRIPT}" "$@" +done diff --git a/ppp/ip-down.d/30-wins.sh b/ppp/ip-down.d/30-wins.sh new file mode 100644 index 00000000..67700af3 --- /dev/null +++ b/ppp/ip-down.d/30-wins.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Remove WINS servers from smb.conf +# Used parameters and environment variables: +# $1 - interface name (e.g. ppp0) +# $USEPEERWINS - set if user specified usepeerdns +# $WINS1 and $WINS2 - WINS servers reported by peer + +if [ "$USEPEERWINS" = 1 -a -f /etc/samba/smb.conf ]; then + # Remove the WINS servers + winsservers= + [ -n "$WINS1" ] && winsservers="$winsservers $1:$WINS1" + [ -n "$WINS2" ] && winsservers="$winsservers $1:$WINS2" + sed -i -e "s/^\([[:space:]]*wins[[:space:]]*server[[:space:]]*=[^#]*\) $winsservers /\1/i" /etc/samba/smb.conf + + # Reload nmbd configuration + smbcontrol nmbd reload-config +fi diff --git a/ppp/ip-down.d/40-dns.sh b/ppp/ip-down.d/40-dns.sh new file mode 100644 index 00000000..0d4f92b0 --- /dev/null +++ b/ppp/ip-down.d/40-dns.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Restore DNS resolver settings +# Used parameters and environment variables: +# $1 - interface name (e.g. ppp0) +# $USEPEERDNS - set if user specified usepeerdns + +if [ "$USEPEERDNS" ]; then + if [ -x /sbin/resolvconf ]; then + /sbin/resolvconf -d "$1" + else + # taken from debian's 0000usepeerdns + # follow any symlink to find the real file + REALRESOLVCONF=$(readlink -f /etc/resolv.conf) + + if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then + + # if an old resolv.conf file exists, restore it + if [ -e $REALRESOLVCONF.pppd-backup ]; then + mv $REALRESOLVCONF.pppd-backup $REALRESOLVCONF + fi + + fi + fi +fi diff --git a/ppp/ip-down.d/50-initd.sh b/ppp/ip-down.d/50-initd.sh new file mode 100644 index 00000000..21061b2f --- /dev/null +++ b/ppp/ip-down.d/50-initd.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Deactivates correspondent net.${iface} service +# Used parameters and environment variables: +# $1 - interface name (e.g. ppp0) + +if [ -x /etc/init.d/net.$1 ]; then + if /etc/init.d/net.$1 --quiet status ; then + export IN_BACKGROUND="true" + /etc/init.d/net.$1 --quiet stop + fi +fi diff --git a/ppp/ip-up b/ppp/ip-up new file mode 100755 index 00000000..69f71ccd --- /dev/null +++ b/ppp/ip-up @@ -0,0 +1,17 @@ +#!/bin/sh + +# This script is run by pppd after the link is established. +# It executes all the scripts available in /etc/ppp/ip-up.d directory, +# with the following parameters: +# $1 = interface name (e.g. ppp0) +# $2 = tty device +# $3 = speed +# $4 = local IP address +# $5 = remote IP address +# $6 = ipparam (user specified parameter, see man pppd) + +cd /etc/ppp/ip-up.d || exit + +for SCRIPT in *.sh ; do + . ./"${SCRIPT}" "$@" +done diff --git a/ppp/ip-up.d/30-wins.sh b/ppp/ip-up.d/30-wins.sh new file mode 100644 index 00000000..484080d4 --- /dev/null +++ b/ppp/ip-up.d/30-wins.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# Handle smb.conf updating when the usepeerwins pppd option is being used. +# Used parameters and environment variables: +# $1 - interface name (e.g. ppp0) +# $USEPEERWINS - set if user specified usepeerdns +# $WINS1 and $WINS2 - WINS servers reported by peer +# Will additionally "tag" the wins servers, as explained in smb.conf(5), using the $1 value. + +if [ "$USEPEERWINS" = 1 -a -f /etc/samba/smb.conf ]; then + # Add global section if it is needed + grep -qi '\[[[:space:]]*global[[:space:]]*\]' /etc/samba/smb.conf \ + || sed -i -e '1i[global]' /etc/samba/smb.conf + + # Add wins server line if is missing + grep -qi '^[[:space:]]*wins[[:space:]]*server[[:space:]]*=' /etc/samba/smb.conf \ + || sed -i -e '/\[[[:space:]]*global[[:space:]]*\]/a\ wins server =' /etc/samba/smb.conf + + # Set the WINS servers + winsservers= + [ -n "$WINS1" ] && winsservers="$winsservers $1:$WINS1" + [ -n "$WINS2" ] && winsservers="$winsservers $1:$WINS2" + sed -i -e "s/^\([[:space:]]*wins[[:space:]]*server[[:space:]]*=[^#]*\)/\1 $winsservers /i" /etc/samba/smb.conf + + # Reload nmbd configuration + smbcontrol nmbd reload-config +fi diff --git a/ppp/ip-up.d/40-dns.sh b/ppp/ip-up.d/40-dns.sh new file mode 100644 index 00000000..6d041e5b --- /dev/null +++ b/ppp/ip-up.d/40-dns.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# Handle resolv.conf generation when usepeerdns pppd option is being used. +# Used parameters and environment variables: +# $1 - interface name (e.g. ppp0) +# $USEPEERDNS - set if user specified usepeerdns +# $DNS1 and $DNS2 - DNS servers reported by peer + +if [ "$USEPEERDNS" ]; then + + if [ -x /sbin/resolvconf ]; then + { + echo "# Generated by ppp for $1" + [ -n "$DNS1" ] && echo "nameserver $DNS1" + [ -n "$DNS2" ] && echo "nameserver $DNS2" + } | /sbin/resolvconf -a "$1" + else + # add the server supplied DNS entries to /etc/resolv.conf + # (taken from debian's 0000usepeerdns) + + # follow any symlink to find the real file + REALRESOLVCONF=$(readlink -f /etc/resolv.conf) + + if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then + + # merge the new nameservers with the other options from the old configuration + { + grep --invert-match '^nameserver[[:space:]]' $REALRESOLVCONF + cat /etc/ppp/resolv.conf + } > $REALRESOLVCONF.tmp + + # backup the old configuration and install the new one + cp -dpP $REALRESOLVCONF $REALRESOLVCONF.pppd-backup + mv $REALRESOLVCONF.tmp $REALRESOLVCONF + + # correct permissions + chmod 0644 /etc/resolv.conf + chown root:root /etc/resolv.conf + fi + fi + +fi diff --git a/ppp/ip-up.d/50-initd.sh b/ppp/ip-up.d/50-initd.sh new file mode 100644 index 00000000..8e308624 --- /dev/null +++ b/ppp/ip-up.d/50-initd.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# Activates correspondent net.${iface} service +# Used parameters and environment variables: +# $1 - interface name (e.g. ppp0) + +if [ -x /etc/init.d/net.$1 ]; then + if ! /etc/init.d/net.$1 --quiet status ; then + export IN_BACKGROUND="true" + /etc/init.d/net.$1 --quiet start + fi +fi diff --git a/ppp/ipv6-down b/ppp/ipv6-down new file mode 120000 index 00000000..bea4aa37 --- /dev/null +++ b/ppp/ipv6-down @@ -0,0 +1 @@ +ip-down \ No newline at end of file diff --git a/ppp/ipv6-up b/ppp/ipv6-up new file mode 120000 index 00000000..e894dd4c --- /dev/null +++ b/ppp/ipv6-up @@ -0,0 +1 @@ +ip-up \ No newline at end of file diff --git a/ppp/options b/ppp/options new file mode 100644 index 00000000..4b67b6a0 --- /dev/null +++ b/ppp/options @@ -0,0 +1 @@ +lock diff --git a/ppp/pap-secrets.example b/ppp/pap-secrets.example new file mode 100644 index 00000000..f8b7dce3 --- /dev/null +++ b/ppp/pap-secrets.example @@ -0,0 +1,2 @@ +# Secrets for authentication using PAP +# client server secret IP addresses