[CRIU] [PATCH 08/12] kdat: Config for loginuid
Dmitry Safonov
0x7f454c46 at gmail.com
Tue Apr 25 04:17:04 PDT 2017
2017-04-24 23:08 GMT+03:00 Pavel Emelyanov <xemul at virtuozzo.com>:
> The write- or readability of /proc/pid/loginuid can be determined
> compile-time.
>
> Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
> ---
> criu/kerndat.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/criu/kerndat.c b/criu/kerndat.c
> index 837ddee..90fca22 100644
> --- a/criu/kerndat.c
> +++ b/criu/kerndat.c
> @@ -471,6 +471,21 @@ int check_loginuid_op(bool full)
> return 1;
> }
>
> +#ifdef CONFIG_KERNEL_LOGINUID
> +static inline int kerndat_loginuid(bool for_restore)
> +{
> +# if CONFIG_KERNEL_LOGINUID == 0
> + kdat.has_loginuid = false;
> +# elif CONFIG_KERNEL_LOGINUID == 1
> + kdat.has_loginuid = !for_restore;
> +# elif CONFIG_KERNEL_LOGINUID == 2
> + kdat.has_loginuid = true;
> +# else
> +# error "Bad CONFIG_KERNEL_LOGINUID config value"
> +# endif
> + return 0;
> +}
> +#else
Ouch!~
*sigh*
> static int kerndat_loginuid(bool for_restore)
> {
> int ret;
> @@ -483,6 +498,7 @@ static int kerndat_loginuid(bool for_restore)
> }
> return ret;
> }
> +#endif
>
> #ifdef CONFIG_IPTABLES_HAS_XTLOCKS
> static inline int kerndat_iptables_has_xtlocks(void)
--
Dmitry
More information about the CRIU
mailing list