mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 00:13:04 +01:00
Get rid of domainnamelen.
This commit is contained in:
parent
a52752a457
commit
27aef04699
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12280
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
|
||||
* $Id: kern_sysctl.c,v 1.40 1995/11/14 09:05:40 phk Exp $
|
||||
* $Id: kern_sysctl.c,v 1.41 1995/11/14 09:07:14 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -270,19 +270,8 @@ SYSCTL_PROC(_sysctl, 0, debug, CTLTYPE_STRING|CTLFLAG_RD,
|
||||
0, 0, sysctl_sysctl_debug, "");
|
||||
|
||||
char domainname[MAXHOSTNAMELEN];
|
||||
int domainnamelen;
|
||||
static int
|
||||
sysctl_kern_domainname SYSCTL_HANDLER_ARGS
|
||||
{
|
||||
int error = sysctl_handle_string(oidp,
|
||||
oidp->oid_arg1, oidp->oid_arg2, req);
|
||||
if (req->newptr && (error == 0 || error == ENOMEM))
|
||||
domainnamelen = req->newlen;
|
||||
return error;
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_kern, KERN_DOMAINNAME, domainname, CTLTYPE_STRING|CTLFLAG_RW,
|
||||
&domainname, sizeof(domainname), sysctl_kern_domainname, "");
|
||||
SYSCTL_STRING(_kern, KERN_DOMAINNAME, domainname, CTLFLAG_RW,
|
||||
&domainname, sizeof(domainname), "");
|
||||
|
||||
long hostid;
|
||||
/* Some trouble here, if sizeof (int) != sizeof (long) */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93
|
||||
* $Id: kern_xxx.c,v 1.17 1995/11/12 06:43:03 bde Exp $
|
||||
* $Id: kern_xxx.c,v 1.18 1995/11/12 07:04:30 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -280,6 +280,7 @@ getdomainname(p, uap, retval)
|
||||
struct getdomainname_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int domainnamelen = strlen(domainname) + 1;
|
||||
if ((u_int)uap->len > domainnamelen + 1)
|
||||
uap->len = domainnamelen + 1;
|
||||
return (copyout((caddr_t)domainname, (caddr_t)uap->domainname, uap->len));
|
||||
@ -299,7 +300,7 @@ setdomainname(p, uap, retval)
|
||||
struct setdomainname_args *uap;
|
||||
int *retval;
|
||||
{
|
||||
int error;
|
||||
int error, domainnamelen;
|
||||
|
||||
if ((error = suser(p->p_ucred, &p->p_acflag)))
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user