diff options
author | ru <ru@FreeBSD.org> | 2001-09-20 08:25:25 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-09-20 08:25:25 +0000 |
commit | ad8cb244ec2767471efbc523ffdc85952b0f3599 (patch) | |
tree | 23d598a48ef130877069efaca6b7d01738c74b39 | |
parent | 8b6fdd579212c065aaf0017090b6332e30721237 (diff) | |
download | FreeBSD-src-ad8cb244ec2767471efbc523ffdc85952b0f3599.zip FreeBSD-src-ad8cb244ec2767471efbc523ffdc85952b0f3599.tar.gz |
Use the current process's credentials rather than socket's cached.
If the process drops its super-user privileges, we certainly don't
want to allow it to modify routing tables.
Discussed with: rwatson
-rw-r--r-- | sys/net/rtsock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index e7f3a2c..46adc0a 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -331,8 +331,8 @@ route_output(m, so) * Verify that the caller has the appropriate privilege; RTM_GET * is the only operation the non-superuser is allowed. */ - if (rtm->rtm_type != RTM_GET && suser_xxx(so->so_cred, NULL, 0) != 0) - senderr(EPERM); + if (rtm->rtm_type != RTM_GET && (error = suser(curproc)) != 0) + senderr(error); switch (rtm->rtm_type) { |