summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-08-10 00:13:02 +0000
committerbrian <brian@FreeBSD.org>2000-08-10 00:13:02 +0000
commit21c4f73753c73891410e1f902c46d05e8d55e144 (patch)
treedecace3a4e0d51ff7fe1b416c2e455683fccb876 /etc
parent7c1fac0cb6f4f48a29c7ad250e038165988f4749 (diff)
downloadFreeBSD-src-21c4f73753c73891410e1f902c46d05e8d55e144.zip
FreeBSD-src-21c4f73753c73891410e1f902c46d05e8d55e144.tar.gz
Allow a ppp_user specification to run ppp at startup
PR: 20258
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rc.conf1
-rw-r--r--etc/network.subr17
-rw-r--r--etc/rc.d/netoptions17
-rw-r--r--etc/rc.d/network117
-rw-r--r--etc/rc.d/network217
-rw-r--r--etc/rc.d/network317
-rw-r--r--etc/rc.d/routing17
-rw-r--r--etc/rc.network17
8 files changed, 64 insertions, 56 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 4df5338..a0ea9b1 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -82,6 +82,7 @@ ppp_mode="auto" # Choice of "auto", "ddial", "direct" or "dedicated".
# For details see man page for ppp(8). Default is auto.
ppp_nat="YES" # Use PPP's internal network address translation or NO.
ppp_profile="papchap" # Which profile to use from /etc/ppp/ppp.conf.
+ppp_user="root" # Which user to run ppp as
### Network daemon (miscellaneous) & NFS options: ###
syslogd_enable="YES" # Run syslog daemon (or NO).
diff --git a/etc/network.subr b/etc/network.subr
index 1c38d05..2ba323e 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions
index 1c38d05..2ba323e 100644
--- a/etc/rc.d/netoptions
+++ b/etc/rc.d/netoptions
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
diff --git a/etc/rc.d/network1 b/etc/rc.d/network1
index 1c38d05..2ba323e 100644
--- a/etc/rc.d/network1
+++ b/etc/rc.d/network1
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
diff --git a/etc/rc.d/network2 b/etc/rc.d/network2
index 1c38d05..2ba323e 100644
--- a/etc/rc.d/network2
+++ b/etc/rc.d/network2
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
diff --git a/etc/rc.d/network3 b/etc/rc.d/network3
index 1c38d05..2ba323e 100644
--- a/etc/rc.d/network3
+++ b/etc/rc.d/network3
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
diff --git a/etc/rc.d/routing b/etc/rc.d/routing
index 1c38d05..2ba323e 100644
--- a/etc/rc.d/routing
+++ b/etc/rc.d/routing
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
diff --git a/etc/rc.network b/etc/rc.network
index 1c38d05..2ba323e 100644
--- a/etc/rc.network
+++ b/etc/rc.network
@@ -138,7 +138,7 @@ network_pass1() {
;;
esac
- # Warm up user ppp if required, must happen before natd.
+ # Start user ppp if required. This must happen before natd.
#
case ${ppp_enable} in
[Yy][Ee][Ss])
@@ -147,27 +147,28 @@ network_pass1() {
if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
-a "${ppp_mode}" != "dedicated" \
-a "${ppp_mode}" != "background" ]; then
- ppp_mode="auto";
+ ppp_mode="auto"
fi
- ppp_command="-${ppp_mode} ";
+ ppp_command="/usr/sbin/ppp -quiet -${ppp_mode}"
- # Switch on alias mode?
+ # Switch on NAT mode?
#
case ${ppp_nat} in
[Yy][Ee][Ss])
- ppp_command="${ppp_command} -nat";
+ ppp_command="${ppp_command} -nat"
;;
esac
- echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
+ ppp_command="${ppp_command} ${ppp_profile}"
+
+ echo -n "Starting ppp as \"${ppp_user}\""
+ su ${ppp_user} -c "exec ${ppp_command}"
;;
esac
# Initialize IP filtering using ipfw
#
- echo ''
-
if /sbin/ipfw -q flush > /dev/null 2>&1; then
firewall_in_kernel=1
else
OpenPOWER on IntegriCloud