David Howells | 0b77f5b | 2008-04-29 01:01:32 -0700 | [diff] [blame] | 1 | /* Key management controls |
| 2 | * |
| 3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by David Howells (dhowells@redhat.com) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public Licence |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the Licence, or (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/key.h> |
| 13 | #include <linux/sysctl.h> |
| 14 | #include "internal.h" |
| 15 | |
David Howells | 5d13544 | 2009-09-02 09:14:00 +0100 | [diff] [blame] | 16 | static const int zero, one = 1, max = INT_MAX; |
| 17 | |
David Howells | 0b77f5b | 2008-04-29 01:01:32 -0700 | [diff] [blame] | 18 | ctl_table key_sysctls[] = { |
| 19 | { |
| 20 | .ctl_name = CTL_UNNUMBERED, |
| 21 | .procname = "maxkeys", |
| 22 | .data = &key_quota_maxkeys, |
| 23 | .maxlen = sizeof(unsigned), |
| 24 | .mode = 0644, |
David Howells | 5d13544 | 2009-09-02 09:14:00 +0100 | [diff] [blame] | 25 | .proc_handler = &proc_dointvec_minmax, |
| 26 | .extra1 = (void *) &one, |
| 27 | .extra2 = (void *) &max, |
David Howells | 0b77f5b | 2008-04-29 01:01:32 -0700 | [diff] [blame] | 28 | }, |
| 29 | { |
| 30 | .ctl_name = CTL_UNNUMBERED, |
| 31 | .procname = "maxbytes", |
| 32 | .data = &key_quota_maxbytes, |
| 33 | .maxlen = sizeof(unsigned), |
| 34 | .mode = 0644, |
David Howells | 5d13544 | 2009-09-02 09:14:00 +0100 | [diff] [blame] | 35 | .proc_handler = &proc_dointvec_minmax, |
| 36 | .extra1 = (void *) &one, |
| 37 | .extra2 = (void *) &max, |
David Howells | 0b77f5b | 2008-04-29 01:01:32 -0700 | [diff] [blame] | 38 | }, |
| 39 | { |
| 40 | .ctl_name = CTL_UNNUMBERED, |
| 41 | .procname = "root_maxkeys", |
| 42 | .data = &key_quota_root_maxkeys, |
| 43 | .maxlen = sizeof(unsigned), |
| 44 | .mode = 0644, |
David Howells | 5d13544 | 2009-09-02 09:14:00 +0100 | [diff] [blame] | 45 | .proc_handler = &proc_dointvec_minmax, |
| 46 | .extra1 = (void *) &one, |
| 47 | .extra2 = (void *) &max, |
David Howells | 0b77f5b | 2008-04-29 01:01:32 -0700 | [diff] [blame] | 48 | }, |
| 49 | { |
| 50 | .ctl_name = CTL_UNNUMBERED, |
| 51 | .procname = "root_maxbytes", |
| 52 | .data = &key_quota_root_maxbytes, |
| 53 | .maxlen = sizeof(unsigned), |
| 54 | .mode = 0644, |
David Howells | 5d13544 | 2009-09-02 09:14:00 +0100 | [diff] [blame] | 55 | .proc_handler = &proc_dointvec_minmax, |
| 56 | .extra1 = (void *) &one, |
| 57 | .extra2 = (void *) &max, |
| 58 | }, |
| 59 | { |
| 60 | .ctl_name = CTL_UNNUMBERED, |
| 61 | .procname = "gc_delay", |
| 62 | .data = &key_gc_delay, |
| 63 | .maxlen = sizeof(unsigned), |
| 64 | .mode = 0644, |
| 65 | .proc_handler = &proc_dointvec_minmax, |
| 66 | .extra1 = (void *) &zero, |
| 67 | .extra2 = (void *) &max, |
David Howells | 0b77f5b | 2008-04-29 01:01:32 -0700 | [diff] [blame] | 68 | }, |
| 69 | { .ctl_name = 0 } |
| 70 | }; |