login_class.c (d84c42924cc7621b2aec9f67f6b8d4785fa40da9) login_class.c (bc093719ca478fe10b938cef32c30b528042cbcd)
1/*-
2 * Copyright (c) 1996 by
3 * Sean Eric Fagan <sef@kithrup.com>
4 * David Nugent <davidn@blaze.net.au>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, is permitted provided that the following conditions

--- 36 unchanged lines hidden (view full) ---

45#include <unistd.h>
46
47
48static struct login_res {
49 const char *what;
50 rlim_t (*who)(login_cap_t *, const char *, rlim_t, rlim_t);
51 int why;
52} resources[] = {
1/*-
2 * Copyright (c) 1996 by
3 * Sean Eric Fagan <sef@kithrup.com>
4 * David Nugent <davidn@blaze.net.au>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, is permitted provided that the following conditions

--- 36 unchanged lines hidden (view full) ---

45#include <unistd.h>
46
47
48static struct login_res {
49 const char *what;
50 rlim_t (*who)(login_cap_t *, const char *, rlim_t, rlim_t);
51 int why;
52} resources[] = {
53 { "cputime", login_getcaptime, RLIMIT_CPU },
54 { "filesize", login_getcapsize, RLIMIT_FSIZE },
55 { "datasize", login_getcapsize, RLIMIT_DATA },
56 { "stacksize", login_getcapsize, RLIMIT_STACK },
57 { "memoryuse", login_getcapsize, RLIMIT_RSS },
58 { "memorylocked", login_getcapsize, RLIMIT_MEMLOCK },
59 { "maxproc", login_getcapnum, RLIMIT_NPROC },
60 { "openfiles", login_getcapnum, RLIMIT_NOFILE },
61 { "coredumpsize", login_getcapsize, RLIMIT_CORE },
62 { "sbsize", login_getcapsize, RLIMIT_SBSIZE },
63 { "vmemoryuse", login_getcapsize, RLIMIT_VMEM },
64 { NULL, 0, 0 }
53 { "cputime", login_getcaptime, RLIMIT_CPU },
54 { "filesize", login_getcapsize, RLIMIT_FSIZE },
55 { "datasize", login_getcapsize, RLIMIT_DATA },
56 { "stacksize", login_getcapsize, RLIMIT_STACK },
57 { "memoryuse", login_getcapsize, RLIMIT_RSS },
58 { "memorylocked", login_getcapsize, RLIMIT_MEMLOCK },
59 { "maxproc", login_getcapnum, RLIMIT_NPROC },
60 { "openfiles", login_getcapnum, RLIMIT_NOFILE },
61 { "coredumpsize", login_getcapsize, RLIMIT_CORE },
62 { "sbsize", login_getcapsize, RLIMIT_SBSIZE },
63 { "vmemoryuse", login_getcapsize, RLIMIT_VMEM },
64 { "pseudoterminals", login_getcapnum, RLIMIT_NPTS },
65 { NULL, 0, 0 }
65};
66
67
68void
69setclassresources(login_cap_t *lc)
70{
71 struct login_res *lr;
72

--- 464 unchanged lines hidden ---
66};
67
68
69void
70setclassresources(login_cap_t *lc)
71{
72 struct login_res *lr;
73

--- 464 unchanged lines hidden ---