Date: Sat, 8 Jan 2011 19:49:27 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r217162 - stable/8/sys/kern Message-ID: <201101081949.p08JnR3f002392@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Sat Jan 8 19:49:27 2011 New Revision: 217162 URL: http://svn.freebsd.org/changeset/base/217162 Log: MFC r216861: Mfp4 CH177924: Add and export constants of array sizes of jail parameters as compiled into the kernel. This is the least intrusive way to allow kvm to read the (sparse) arrays independent of the options the kernel was compiled with. Reviewed by: jhb (originally) MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Modified: stable/8/sys/kern/kern_jail.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_jail.c ============================================================================== --- stable/8/sys/kern/kern_jail.c Sat Jan 8 18:51:15 2011 (r217161) +++ stable/8/sys/kern/kern_jail.c Sat Jan 8 19:49:27 2011 (r217162) @@ -140,7 +140,9 @@ static int prison_restrict_ip6(struct pr #define PD_LIST_XLOCKED 0x10 /* - * Parameter names corresponding to PR_* flag values + * Parameter names corresponding to PR_* flag values. Size values are for kvm + * as we cannot figure out the size of a sparse array, or an array without a + * terminating entry. */ static char *pr_flag_names[] = { [0] = "persist", @@ -151,6 +153,7 @@ static char *pr_flag_names[] = { [8] = "ip6.saddrsel", #endif }; +const size_t pr_flag_names_size = sizeof(pr_flag_names); static char *pr_flag_nonames[] = { [0] = "nopersist", @@ -161,6 +164,7 @@ static char *pr_flag_nonames[] = { [8] = "ip6.nosaddrsel", #endif }; +const size_t pr_flag_nonames_size = sizeof(pr_flag_nonames); struct jailsys_flags { const char *name; @@ -178,6 +182,7 @@ struct jailsys_flags { { "ip6", PR_IP6_USER | PR_IP6_DISABLE, PR_IP6_USER }, #endif }; +const size_t pr_flag_jailsys_size = sizeof(pr_flag_jailsys); static char *pr_allow_names[] = { "allow.set_hostname", @@ -188,6 +193,7 @@ static char *pr_allow_names[] = { "allow.quotas", "allow.socket_af", }; +const size_t pr_allow_names_size = sizeof(pr_allow_names); static char *pr_allow_nonames[] = { "allow.noset_hostname", @@ -198,6 +204,7 @@ static char *pr_allow_nonames[] = { "allow.noquotas", "allow.nosocket_af", }; +const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); #define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME #define JAIL_DEFAULT_ENFORCE_STATFS 2
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101081949.p08JnR3f002392>