Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HardenedBSD
HardenedBSD
Commits
835ff695
Commit
835ff695
authored
Oct 22, 2021
by
HardenedBSD Sync Service
Browse files
Merge branch 'freebsd/current/main' into hardened/current/master
parents
7536b4ae
c8ee75f2
Changes
66
Hide whitespace changes
Inline
Side-by-side
ObsoleteFiles.inc
View file @
835ff695
...
...
@@ -40,6 +40,17 @@
# xargs -n1 | sort | uniq -d;
# done
# 20211022
OLD_FILES+=sbin/spppcontrol
.if ${TARGET_ARCH} == "i386"
OLD_FILES+=usr/include/machine/cserial.h
.endif
OLD_FILES+=usr/include/net/if_sppp.h
OLD_FILES+=usr/include/netgraph/ng_sppp.h
OLD_FILES+=usr/share/man/man4/ng_sppp.4.gz
OLD_FILES+=usr/share/man/man4/sppp.4.gz
OLD_FILES+=usr/share/man/man8/spppcontrol.8.gz
# 20210929:
OLD_FILES+=usr/sbin/hcseriald
OLD_FILES+=usr/share/man/man8/hcseriald.8.gz
...
...
UPDATING
View file @
835ff695
...
...
@@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW:
world, or to merely disable the most expensive debugging functionality
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20211022:
The synchronous PPP kernel driver sppp(4) has been removed.
The cp(4) and ce(4) drivers are now always compiled with netgraph(4)
support, formerly enabled by NETGRAPH_CRONYX option.
20211020:
sh(1) is now the default shell for the root user. To force root to use
the csh shell, please run the following command as root:
...
...
lib/libc/net/getnameinfo.c
View file @
835ff695
...
...
@@ -467,7 +467,7 @@ getnameinfo_link(const struct afd *afd,
* The following have zero-length addresses.
* IFT_GIF (net/if_gif.c)
* IFT_LOOP (net/if_loop.c)
* IFT_PPP (net/if_
ppp.c, net/if_spppsubr
.c)
* IFT_PPP (net/if_
tuntap
.c)
* IFT_SLIP (net/if_sl.c, net/if_strip.c)
* IFT_STF (net/if_stf.c)
* IFT_L2VLAN (net/if_vlan.c)
...
...
lib/libnetgraph/debug.c
View file @
835ff695
...
...
@@ -96,7 +96,6 @@ __FBSDID("$FreeBSD$");
#include <netgraph/ng_socket.h>
#include <netgraph/ng_source.h>
#include <netgraph/ng_split.h>
#include <netgraph/ng_sppp.h>
#include <netgraph/ng_tag.h>
#include <netgraph/ng_tcpmss.h>
#include <netgraph/ng_tee.h>
...
...
@@ -172,7 +171,6 @@ static const struct ng_cookie cookies[] = {
COOKIE
(
SOCKET
),
COOKIE
(
SOURCE
),
COOKIE
(
SPLIT
),
COOKIE
(
SPPP
),
COOKIE
(
TAG
),
COOKIE
(
TCPMSS
),
COOKIE
(
TEE
),
...
...
libexec/rc/netstart
View file @
835ff695
...
...
@@ -43,7 +43,6 @@ _start=quietstart
/etc/rc.d/ipfilter
${
_start
}
/etc/rc.d/ipnat
${
_start
}
/etc/rc.d/ipfs
${
_start
}
/etc/rc.d/sppp
${
_start
}
/etc/rc.d/netif
${
_start
}
/etc/rc.d/ipsec
${
_start
}
/etc/rc.d/ppp
${
_start
}
...
...
libexec/rc/rc.conf
View file @
835ff695
...
...
@@ -262,12 +262,6 @@ cloned_interfaces="" # List of cloned network interfaces to create.
#
#autobridge_interfaces="bridge0" # List of bridges to check
#autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge
#
# If you have any sppp(4) interfaces above, you might also want to set
# the following parameters. Refer to spppcontrol(8) for their meaning.
sppp_interfaces
=
""
# List of sppp interfaces.
#sppp_interfaces="...0" # example: sppp over ...
#spppconfig_...0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'"
# User ppp configuration.
ppp_enable
=
"NO"
# Start user-ppp (or NO).
...
...
libexec/rc/rc.d/Makefile
View file @
835ff695
...
...
@@ -96,7 +96,6 @@ CONFS= DAEMON \
savecore
\
securelevel
\
serial
\
sppp
\
statd
\
static_arp
\
static_ndp
\
...
...
libexec/rc/rc.d/netif
View file @
835ff695
...
...
@@ -26,7 +26,7 @@
#
# PROVIDE: netif
# REQUIRE: FILESYSTEMS iovctl serial
sppp
sysctl
# REQUIRE: FILESYSTEMS iovctl serial sysctl
# REQUIRE: hostid
# KEYWORD: nojailvnet
...
...
libexec/rc/rc.d/sppp
deleted
100755 → 0
View file @
7536b4ae
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: sppp
# REQUIRE: root
# BEFORE: netif
# KEYWORD: nojail
.
/etc/rc.subr
name
=
"sppp"
desc
=
"Point to point protocol network layer for synchronous lines"
start_cmd
=
"sppp_start"
stop_cmd
=
":"
sppp_start
()
{
# Special options for sppp(4) interfaces go here. These need
# to go _before_ the general ifconfig since in the case
# of hardwired (no link1 flag) but required authentication, you
# cannot pass auth parameters down to the already running interface.
#
for
ifn
in
${
sppp_interfaces
}
;
do
eval
spppcontrol_args
=
\$
spppconfig_
${
ifn
}
if
[
-n
"
${
spppcontrol_args
}
"
]
;
then
# The auth secrets might contain spaces; in order
# to retain the quotation, we need to eval them
# here.
eval
spppcontrol
${
ifn
}
${
spppcontrol_args
}
fi
done
}
load_rc_config
$name
run_rc_command
"
$1
"
rescue/rescue/Makefile
View file @
835ff695
...
...
@@ -103,7 +103,7 @@ CRUNCH_PROGS_sbin= \
mount_udf mount_unionfs newfs
\
newfs_msdos nos-tun ping reboot
\
restore rcorder route savecore
\
shutdown
spppcontrol
swapon sysctl tunefs umount
shutdown swapon sysctl tunefs umount
.if
${MK_CCD}
!=
"no"
CRUNCH_PROGS_sbin
+=
ccdconfig
...
...
sbin/Makefile
View file @
835ff695
...
...
@@ -63,7 +63,6 @@ SUBDIR=adjkerntz \
savecore
\
setkey
\
shutdown
\
spppcontrol
\
swapon
\
sysctl
\
tunefs
\
...
...
@@ -94,10 +93,6 @@ SUBDIR.${MK_TESTS}+= tests
SUBDIR_PARALLEL
=
# Add architecture-specific manpages
# to be included anyway
MAN
=
sconfig/sconfig.8
.
include
<bsd.prog.mk>
.
include
<bsd.subdir.mk>
sbin/Makefile.amd64
View file @
835ff695
...
...
@@ -2,3 +2,4 @@
SUBDIR
+=
bsdlabel
SUBDIR
+=
fdisk
SUBDIR
+=
sconfig
sbin/sconfig/Makefile
View file @
835ff695
...
...
@@ -4,7 +4,7 @@
PACKAGE
=
runtime
PROG
=
sconfig
MAN
=
sconfig.8
MANSUBDIR
=
/i386
WARNS
?=
2
CFLAGS
+=
-I
${SRCTOP}
/sys/dev/cp
.
include
<bsd.prog.mk>
sbin/sconfig/sconfig.8
View file @
835ff695
...
...
@@ -216,9 +216,6 @@ Select the Frame Relay synchronous protocol
T1.617 Annex D).
.It Cm ppp
Select the synchronous PPP protocol.
PPP parameters can be configured using the
.Xr spppcontrol 8
utility.
.It Sm Cm keepalive No = Bro Cm on , off Brc Sm
Turn on/off transmission of keepalive messages.
This option is used only for synchronous PPP.
...
...
@@ -569,10 +566,8 @@ Test error (G.703 only).
.Sh SEE ALSO
.Xr stty 1 ,
.Xr ioctl 2 ,
.Xr sppp 4 ,
.Xr ifconfig 8 ,
.Xr route 8 ,
.Xr spppcontrol 8
.\"--------------------------------------------------------------
.Sh HISTORY
The
...
...
sbin/sconfig/sconfig.c
View file @
835ff695
...
...
@@ -29,10 +29,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <net/if.h>
#include <machine/cserial.h>
#include "cserial.h"
#define MAXCHAN 128
...
...
sbin/spppcontrol/Makefile
deleted
100644 → 0
View file @
7536b4ae
# $FreeBSD$
PACKAGE
=
ppp
PROG
=
spppcontrol
MAN
=
spppcontrol.8
WARNS
?=
2
.
include
<bsd.prog.mk>
sbin/spppcontrol/Makefile.depend
deleted
100644 → 0
View file @
7536b4ae
# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS
=
\
gnu/lib/csu
\
include
\
include/xlocale
\
lib/
${CSU_DIR}
\
lib/libc
\
lib/libcompiler_rt
\
.
include
<dirdeps.mk>
.if
${DEP_RELDIR}
==
${_DEP_RELDIR}
# local dependencies - needed for -jN in clean tree
.
endif
sbin/spppcontrol/spppcontrol.8
deleted
100644 → 0
View file @
7536b4ae
.\" Copyright (C) 1997, 2001 by Joerg Wunsch, Dresden
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 30, 2001
.Dt SPPPCONTROL 8
.Os
.Sh NAME
.Nm spppcontrol
.Nd display or set parameters for an sppp interface
.Sh SYNOPSIS
.Nm
.Op Fl v
.Ar ifname
.Op Ar parameter Ns Op Li = Ns Ar value
.Op Ar ...
.Sh DESCRIPTION
The
.Xr sppp 4
driver might require a number of additional arguments or optional
parameters besides the settings that can be adjusted with
.Xr ifconfig 8 .
These are things like authentication protocol parameters, but also
other tunable configuration variables.
The
.Nm
utility can be used to display the current settings, or adjust these
parameters as required.
.Pp
For whatever intent
.Nm
is being called, at least the parameter
.Ar ifname
needs to be specified, naming the interface for which the settings
are to be performed or displayed.
Use
.Xr ifconfig 8 ,
or
.Xr netstat 1
to see which interfaces are available.
.Pp
If no other parameter is given,
.Nm
will just list the current settings for
.Ar ifname
and exit.
The reported settings include the current PPP phase the
interface is in, which can be one of the names
.Em dead ,
.Em establish ,
.Em authenticate ,
.Em network ,
or
.Em terminate .
If an authentication protocol is configured for the interface, the
name of the protocol to be used, as well as the system name to be used
or expected will be displayed, plus any possible options to the
authentication protocol if applicable.
Note that the authentication
secrets (sometimes also called
.Em keys )
are not being returned by the underlying system call, and are thus not
displayed.
.Pp
If any additional parameter is supplied, superuser privileges are
required, and the command works in the
.Dq set
mode.
This is normally done quietly, unless the option
.Fl v
is also enabled, which will cause a final printout of the settings as
described above once all other actions have been taken.
Use of this
mode will be rejected if the interface is currently in any other phase
than
.Em dead .
Note that you can force an interface into
.Em dead
phase by calling
.Xr ifconfig 8
with the parameter
.Cm down .
.Pp
The currently supported parameters include:
.Bl -tag -offset indent -width indent
.It Va authproto Ns Li = Ns Ar protoname
Set both, his and my authentication protocol to
.Ar protoname .
The protocol name can be one of
.Dq Li chap ,
.Dq Li pap ,
or
.Dq Li none .
In the latter case, the use of an authentication protocol will be
turned off for the named interface.
This has the side-effect of
clearing the other authentication-related parameters for this
interface as well (i.e., system name and authentication secret will
be forgotten).
.It Va myauthproto Ns Li = Ns Ar protoname
Same as above, but only for my end of the link.
I.e., this is the
protocol when remote is authenticator, and I am the peer required to
authenticate.
.It Va hisauthproto Ns Li = Ns Ar protoname
Same as above, but only for his end of the link.
.It Va myauthname Ns Li = Ns Ar name
Set my system name for the authentication protocol.
.It Va hisauthname Ns Li = Ns Ar name
Set his system name for the authentication protocol.
For CHAP, this
will only be used as a hint, causing a warning message if remote did
supply a different name.
For PAP, it is the name remote must use to
authenticate himself (in connection with his secret).
.It Va myauthsecret Ns Li = Ns Ar secret
Set my secret (key, password) for use in the authentication phase.
For CHAP, this will be used to compute the response hash value, based
on remote's challenge.
For PAP, it will be transmitted as plain text
together with the system name.
Do not forget to quote the secrets from
the shell if they contain shell metacharacters (or white space).
.It Va myauthkey Ns Li = Ns Ar secret
Same as above.
.It Va hisauthsecret Ns Li = Ns Ar secret
Same as above, to be used if we are an authenticator and the remote peer
needs to authenticate.
.It Va hisauthkey Ns Li = Ns Va secret
Same as above.
.It Va callin
Require remote to authenticate himself only when he is calling in, but
not when we are caller.
This is required for some peers that do not
implement the authentication protocols symmetrically (like Ascend
routers, for example).
.It Va always
The opposite of
.Va callin .
Require remote to always authenticate, regardless of which side is
placing the call.
This is the default, and will not be explicitly
displayed in the
.Dq list
mode.
.It Va norechallenge
Only meaningful with CHAP.
Do not re-challenge peer once the initial
CHAP handshake was successful.
Used to work around broken peer
implementations that cannot grok being re-challenged once the
connection is up.
.It Ar rechallenge
With CHAP, send re-challenges at random intervals while the connection
is in network phase.
(The intervals are currently in the range of 300
through approximately 800 seconds.)
This is the default, and will not
be explicitly displayed in the
.Dq list
mode.
.It Va lcp-timeout Ns Li = Ns Ar timeout-value
Allows to change the value of the LCP restart timer.
Values are
specified in milliseconds.
The value must be between 10 and 20000 ms,
defaulting to 3000 ms.
.It Va enable-vj
Enable negotiation of Van Jacobsen header compression.
(Enabled by default.)
.It Va disable-vj
Disable negotiation of Van Jacobsen header compression.
.It Va enable-ipv6
Enable negotiation of the IPv6 network control protocol.
(Enabled by default if the kernel has IPv6 enabled.)
.It Va disable-ipv6
Disable negotiation of the IPv6 network control protocol.
Since every
IPv4 interface in an IPv6-enabled kernel automatically gets an IPv6
address assigned, this option provides for a way to administratively
prevent the link from attempting to negotiate IPv6.
Note that
initialization of an IPv6 interface causes a multicast packet to be
sent, which can cause unwanted traffic costs (for dial-on-demand
interfaces).
.El
.Sh EXAMPLES
.Bd -literal
# spppcontrol bppp0
bppp0: phase=dead
myauthproto=chap myauthname="uriah"
hisauthproto=chap hisauthname="ifb-gw" norechallenge
lcp-timeout=3000
enable-vj
enable-ipv6
.Ed
.Pp
Display the settings for
.Li bppp0 .
The interface is currently in
.Em dead
phase, i.e., the LCP layer is down, and no traffic is possible.
Both
ends of the connection use the CHAP protocol, my end tells remote the
system name
.Dq Li uriah ,
and remote is expected to authenticate by the name
.Dq Li ifb-gw .
Once the initial CHAP handshake was successful, no further CHAP
challenges will be transmitted.
There are supposedly some known CHAP
secrets for both ends of the link which are not being shown.
.Bd -literal
# spppcontrol bppp0 \e
authproto=chap \e
myauthname=uriah myauthsecret='some secret' \e
hisauthname=ifb-gw hisauthsecret='another' \e
norechallenge
.Ed
.Pp
A possible call to
.Nm
that could have been used to bring the interface into the state shown
by the previous example.
.Sh SEE ALSO
.Xr netstat 1 ,
.Xr sppp 4 ,
.Xr ifconfig 8
.Rs
.%A B. Lloyd
.%A W. Simpson
.%T "PPP Authentication Protocols"
.%O RFC 1334
.Re
.Rs
.%A W. Simpson, Editor
.%T "The Point-to-Point Protocol (PPP)"
.%O RFC 1661
.Re
.Rs
.%A W. Simpson
.%T "PPP Challenge Handshake Authentication Protocol (CHAP)"
.%O RFC 1994
.Re
.Sh HISTORY
The
.Nm
utility appeared in
.Fx 3.0 .
.Sh AUTHORS
The program was written by
.An J\(:org Wunsch ,
Dresden.
sbin/spppcontrol/spppcontrol.c
deleted
100644 → 0
View file @
7536b4ae
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 1997, 2001 Joerg Wunsch
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_sppp.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
static
void
usage
(
void
);
void
print_vals
(
const
char
*
ifname
,
struct
spppreq
*
sp
);
const
char
*
phase_name
(
enum
ppp_phase
phase
);
const
char
*
proto_name
(
u_short
proto
);
const
char
*
authflags
(
u_short
flags
);
#define PPP_PAP 0xc023
#define PPP_CHAP 0xc223
int
main
(
int
argc
,
char
**
argv
)
{
int
s
,
c
;
int
errs
=
0
,
verbose
=
0
;
size_t
off
;
long
to
;
char
*
endp
;
const
char
*
ifname
,
*
cp
;
struct
ifreq
ifr
;
struct
spppreq
spr
;
while
((
c
=
getopt
(
argc
,
argv
,
"v"
))
!=
-
1
)
switch
(
c
)
{
case
'v'
:
verbose
++
;
break
;
default:
errs
++
;
break
;
}
argv
+=
optind
;
argc
-=
optind
;
if
(
errs
||
argc
<
1
)
usage
();
ifname
=
argv
[
0
];
strncpy
(
ifr
.
ifr_name
,
ifname
,
sizeof
ifr
.
ifr_name
);
/* use a random AF to create the socket */
if
((
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
<
0
)
err
(
EX_UNAVAILABLE
,
"ifconfig: socket"
);
argc
--
;
argv
++
;
spr
.
cmd
=
(
uintptr_t
)
SPPPIOGDEFS
;
ifr
.
ifr_data
=
(
caddr_t
)
&
spr
;
if
(
ioctl
(
s
,
SIOCGIFGENERIC
,
&
ifr
)
==
-
1
)
err
(
EX_OSERR
,
"SIOCGIFGENERIC(SPPPIOGDEFS)"
);
if
(
argc
==
0
)
{
/* list only mode */
print_vals
(
ifname
,
&
spr
);
return
0
;
}
#define startswith(s) strncmp(argv[0], s, (off = strlen(s))) == 0
while
(
argc
>
0
)
{
if
(
startswith
(
"authproto="
))
{
cp
=
argv
[
0
]
+
off
;
if
(
strcmp
(
cp
,
"pap"
)
==
0
)
spr
.
defs
.
myauth
.
proto
=
spr
.
defs
.
hisauth
.
proto
=
PPP_PAP
;
else
if
(
strcmp
(
cp
,
"chap"
)
==
0
)
spr
.
defs
.
myauth
.
proto
=
spr
.
defs
.
hisauth
.
proto
=
PPP_CHAP
;