40c40
< * $FreeBSD: head/sys/kern/kern_mib.c 87072 2001-11-28 21:22:05Z rwatson $
---
> * $FreeBSD: head/sys/kern/kern_mib.c 87275 2001-12-03 16:12:27Z rwatson $
50a51,52
> #include <sys/lock.h>
> #include <sys/mutex.h>
157a160
> char tmphostname[MAXHOSTNAMELEN];
164c167,176
< error = sysctl_handle_string(oidp, pr->pr_host,
---
> /*
> * Process is in jail, so make a local copy of jail
> * hostname to get/set so we don't have to hold the jail
> * mutex during the sysctl copyin/copyout activities.
> */
> mtx_lock(&pr->pr_mtx);
> bcopy(pr->pr_host, tmphostname, MAXHOSTNAMELEN);
> mtx_unlock(&pr->pr_mtx);
>
> error = sysctl_handle_string(oidp, tmphostname,
165a178,187
>
> if (req->newptr != NULL && error == 0) {
> /*
> * Copy the locally set hostname to the jail, if
> * appropriate.
> */
> mtx_lock(&pr->pr_mtx);
> bcopy(tmphostname, pr->pr_host, MAXHOSTNAMELEN);
> mtx_unlock(&pr->pr_mtx);
> }
197c219,220
< if (pr != NULL)
---
> if (pr != NULL) {
> mtx_lock(&pr->pr_mtx);
199c222,223
< else
---
> mtx_unlock(&pr->pr_mtx);
> } else
208a233
> mtx_lock(&pr->pr_mtx);
210c235,236
< (level < imax(securelevel, pr->pr_securelevel)))
---
> (level < imax(securelevel, pr->pr_securelevel))) {
> mtx_unlock(&pr->pr_mtx);
211a238
> }
212a240
> mtx_unlock(&pr->pr_mtx);
< * $FreeBSD: head/sys/kern/kern_mib.c 87072 2001-11-28 21:22:05Z rwatson $
---
> * $FreeBSD: head/sys/kern/kern_mib.c 87275 2001-12-03 16:12:27Z rwatson $
50a51,52
> #include <sys/lock.h>
> #include <sys/mutex.h>
157a160
> char tmphostname[MAXHOSTNAMELEN];
164c167,176
< error = sysctl_handle_string(oidp, pr->pr_host,
---
> /*
> * Process is in jail, so make a local copy of jail
> * hostname to get/set so we don't have to hold the jail
> * mutex during the sysctl copyin/copyout activities.
> */
> mtx_lock(&pr->pr_mtx);
> bcopy(pr->pr_host, tmphostname, MAXHOSTNAMELEN);
> mtx_unlock(&pr->pr_mtx);
>
> error = sysctl_handle_string(oidp, tmphostname,
165a178,187
>
> if (req->newptr != NULL && error == 0) {
> /*
> * Copy the locally set hostname to the jail, if
> * appropriate.
> */
> mtx_lock(&pr->pr_mtx);
> bcopy(tmphostname, pr->pr_host, MAXHOSTNAMELEN);
> mtx_unlock(&pr->pr_mtx);
> }
197c219,220
< if (pr != NULL)
---
> if (pr != NULL) {
> mtx_lock(&pr->pr_mtx);
199c222,223
< else
---
> mtx_unlock(&pr->pr_mtx);
> } else
208a233
> mtx_lock(&pr->pr_mtx);
210c235,236
< (level < imax(securelevel, pr->pr_securelevel)))
---
> (level < imax(securelevel, pr->pr_securelevel))) {
> mtx_unlock(&pr->pr_mtx);
211a238
> }
212a240
> mtx_unlock(&pr->pr_mtx);