Re: [PATCH] Documentation: security/credentials.rst: explain need to sort group_list
From: Matthew Wilcox
Date: Tue Jan 02 2018 - 16:04:38 EST
On Wed, Jan 03, 2018 at 08:01:15AM +1100, NeilBrown wrote:
>
> +When replacing the group list, the new list must be sorted before it
> +is added to the credential, as a binary search is used to test for
> +membership. In practice, this means ``groups_sort()`` should be
For a .rst file, shouldn't we be using :c:func:`groups_sort` instead of
``groups_sort()``?
> +called before ``set_groups()`` or ``set_current_groups()``.
> +``groups_sort()`` must not be called on a ``struct group_list`` which
> +is shared as it may permute elements as part of the sorting process
> +even if the array is already sorted.
>
> When the credential set is ready, it should be committed to the current process
> by calling::
> --
> 2.14.0.rc0.dirty
>