Skip to content

Commit bbf96e4

Browse files
authored
Merge pull request #584 from ppp-project/update-messages
Update pppd man page and some comments, and remove an error message that is incorrect now.
2 parents aa61200 + 870da8a commit bbf96e4

2 files changed

Lines changed: 28 additions & 28 deletions

File tree

pppd/auth.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int num_np_up;
169169
/* Set if we got the contents of passwd[] from the pap-secrets file. */
170170
static int passwd_from_file;
171171

172-
/* Set if we require authentication only because we have a default route. */
172+
/* Set if we require authentication only because the user is not root. */
173173
static bool default_auth;
174174

175175
/* Hook to enable a plugin to control the idle time limit */
@@ -1355,7 +1355,7 @@ auth_check_options(void)
13551355
#endif
13561356

13571357
/*
1358-
* If we have a default route, require the peer to authenticate
1358+
* Require the peer to authenticate
13591359
* unless the noauth option was given or the real user is root.
13601360
*/
13611361
if (!auth_required && !allow_any_ip && !privileged) {
@@ -1412,8 +1412,6 @@ auth_check_options(void)
14121412
if (default_auth) {
14131413
ppp_option_error(
14141414
"By default the remote system is required to authenticate itself");
1415-
ppp_option_error(
1416-
"(because this system has a default route to the internet)");
14171415
} else if (explicit_remote)
14181416
ppp_option_error(
14191417
"The remote system (%s) is required to authenticate itself",

pppd/pppd.8

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ To escape transmitted characters, use the \fIescape\fR option.
7676
.B auth
7777
Require the peer to authenticate itself before allowing network packets to be
7878
sent or received. For security reasons this option is the default if pppd is
79-
executed as a non-privileged user. If neither this option nor the \fInoauth\fR
80-
option is specified, pppd will only allow the peer to use IP addresses to which
81-
the system does not already have a route.
79+
executed as a non-privileged user, unless the \fInoauth\fR option is
80+
in effect (since \fInoauth\fR is a privileged option, it would
81+
need to come from a privileged options file, not the command line).
8282
.TP
8383
.B call \fIname
8484
Read additional options from the file /etc/ppp/peers/\fIname\fR. This
@@ -118,7 +118,7 @@ a modem control line.
118118
Add a default route to the system routing tables, using the peer as
119119
the gateway, when IPCP negotiation is successfully completed.
120120
This entry is removed when the PPP connection is broken. This option
121-
is privileged if the \fInodefaultroute\fR option has been specified.
121+
is privileged.
122122
.TP
123123
.B defaultroute-metric
124124
Define the metric of the \fIdefaultroute\fR. By default the default route will
@@ -353,10 +353,10 @@ transmit and receive direction.
353353
Add a default IPv6 route to the system routing tables, using the peer as
354354
the gateway, when IPv6CP negotiation is successfully completed.
355355
This entry is removed when the PPP connection is broken. This option
356-
is privileged if the \fInodefaultroute6\fR option has been specified.
356+
is privileged.
357357
\fBWARNING: Do not enable this option by default\fR. IPv6 routing tables
358-
are managed by kernel (as apposite to IPv4) and IPv6 default route is
359-
configured by kernel automatically too based on ICMPv6 Router Advertisement
358+
are managed by kernel (as opposed to IPv4) and IPv6 default route is
359+
configured by kernel automatically based on ICMPv6 Router Advertisement
360360
packets. This option may conflict with kernel IPv6 route setup and should
361361
be used only for broken IPv6 networks.
362362
.TP
@@ -795,14 +795,10 @@ This option is a synonym for \fInocrtscts\fR. Either of these options will
795795
disable both forms of hardware flow control.
796796
.TP
797797
.B nodefaultroute
798-
Disable the \fIdefaultroute\fR option. The system administrator who
799-
wishes to prevent users from adding a default route with pppd
800-
can do so by placing this option in the /etc/ppp/options file.
798+
Disable the \fIdefaultroute\fR option.
801799
.TP
802800
.B nodefaultroute6
803-
Disable the \fIdefaultroute6\fR option. The system administrator who
804-
wishes to prevent users from adding a default route with pppd
805-
can do so by placing this option in the /etc/ppp/options file.
801+
Disable the \fIdefaultroute6\fR option.
806802
.TP
807803
.B nodeflate
808804
Disables Deflate compression; pppd will not request or agree to
@@ -1312,16 +1308,12 @@ those which permit potentially insecure configurations; these options
13121308
are only accepted in files which are under the control of the system
13131309
administrator, or if pppd is being run by root.
13141310
.PP
1315-
The default behaviour of pppd is to allow an unauthenticated peer to
1316-
use a given IP address only if the system does not already have a
1317-
route to that IP address. For example, a system with a
1318-
permanent connection to the wider internet will normally have a
1319-
default route, and thus all peers will have to authenticate themselves
1320-
in order to set up a connection. On such a system, the \fIauth\fR
1321-
option is the default. On the other hand, a system where the
1322-
PPP link is the only connection to the internet will not normally have
1323-
a default route, so the peer will be able to use almost any IP address
1324-
without authenticating itself.
1311+
If pppd is run by a non-privileged user, by default the peer must
1312+
authenticate itself, and the IP address(es) it may use are controlled
1313+
by the secrets file entry used to authenticate it. For the peer not
1314+
to be required to authenticate itself, either pppd must be run by root
1315+
or a privileged options file containing the \fInoauth\fR option must
1316+
be invoked.
13251317
.PP
13261318
As indicated above, some security-sensitive options are privileged,
13271319
which means that they may not be used by an ordinary non-privileged
@@ -1342,6 +1334,16 @@ file under /etc/ppp/peers, the system administrator can allow users to
13421334
establish a ppp connection via a device which they would not normally
13431335
have permission to access. Otherwise pppd uses the invoking user's
13441336
real UID when opening the device.
1337+
.PP
1338+
To avoid the possibility of privileged options files, secrets files,
1339+
and other files which contain sensitive information being compromised,
1340+
\fIpppd\fR performs a path check on these files before opening them.
1341+
This involves first translating the file path into a real absolute path
1342+
containing no symlinks or ".." components. Then each component from
1343+
the root down is checked to ensure that it is owned by root and that
1344+
its permissions do not permit writing by group or other. Failure to
1345+
conform to these requirements will cause \fIpppd\fR to exit with a
1346+
suitable error message.
13451347
.SH AUTHENTICATION
13461348
Authentication is the process whereby one peer convinces the other of
13471349
its identity. This involves the first peer sending its name to the
@@ -1376,7 +1378,7 @@ could use different authentication protocols, and in principle,
13761378
different names could be used in the two exchanges.
13771379
.LP
13781380
The default behaviour of pppd is to agree to authenticate if
1379-
requested, and to not require authentication from the peer. However,
1381+
requested. However,
13801382
pppd will not agree to authenticate itself with a particular protocol
13811383
if it has no secrets which could be used to do so.
13821384
.LP

0 commit comments

Comments
 (0)