kern_resource.c (46116) | kern_resource.c (46155) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 | 1/*- 2 * Copyright (c) 1982, 1986, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 |
39 * $Id: kern_resource.c,v 1.46 1999/04/27 11:16:02 phk Exp $ | 39 * $Id: kern_resource.c,v 1.47 1999/04/27 12:21:07 phk Exp $ |
40 */ 41 42#include "opt_compat.h" 43#include "opt_rlimit.h" 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/sysproto.h> --- 334 unchanged lines hidden (view full) --- 382 */ 383 if (limp->rlim_cur < 0) 384 limp->rlim_cur = RLIM_INFINITY; 385 if (limp->rlim_max < 0) 386 limp->rlim_max = RLIM_INFINITY; 387 388 if (limp->rlim_cur > alimp->rlim_max || 389 limp->rlim_max > alimp->rlim_max) | 40 */ 41 42#include "opt_compat.h" 43#include "opt_rlimit.h" 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/sysproto.h> --- 334 unchanged lines hidden (view full) --- 382 */ 383 if (limp->rlim_cur < 0) 384 limp->rlim_cur = RLIM_INFINITY; 385 if (limp->rlim_max < 0) 386 limp->rlim_max = RLIM_INFINITY; 387 388 if (limp->rlim_cur > alimp->rlim_max || 389 limp->rlim_max > alimp->rlim_max) |
390 if ((error = suser(p))) | 390 if ((error = suser_xxx(0, p, PRISON_ROOT))) |
391 return (error); 392 if (limp->rlim_cur > limp->rlim_max) 393 limp->rlim_cur = limp->rlim_max; 394 if (p->p_limit->p_refcnt > 1 && 395 (p->p_limit->p_lflags & PL_SHAREMOD) == 0) { 396 p->p_limit->p_refcnt--; 397 p->p_limit = limcopy(p->p_limit); 398 alimp = &p->p_rlimit[which]; --- 245 unchanged lines hidden --- | 391 return (error); 392 if (limp->rlim_cur > limp->rlim_max) 393 limp->rlim_cur = limp->rlim_max; 394 if (p->p_limit->p_refcnt > 1 && 395 (p->p_limit->p_lflags & PL_SHAREMOD) == 0) { 396 p->p_limit->p_refcnt--; 397 p->p_limit = limcopy(p->p_limit); 398 alimp = &p->p_rlimit[which]; --- 245 unchanged lines hidden --- |