On Fri, Sep 10, 2021 at 01:41:11PM +0200, [email protected] wrote:
> From: Martin Wilck <[email protected]>
> 
> The SO_PEERCRED socket option returns "the credentials that were
> in effect at the time of the call to connect(2)" (see unix(7)).
> So we might as well fetch these credentials at that time.
> 
Reviewed-by: Benjamin Marzinski <[email protected]>
> Signed-off-by: Martin Wilck <[email protected]>
> ---
>  multipathd/uxlsnr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
> index 9a945ea..9cf6964 100644
> --- a/multipathd/uxlsnr.c
> +++ b/multipathd/uxlsnr.c
> @@ -92,8 +92,6 @@ static struct pollfd *polls;
>  static int notify_fd = -1;
>  static char *watch_config_dir;
>  
> -static bool _socket_client_is_root(int fd);
> -
>  static bool _socket_client_is_root(int fd)
>  {
>       socklen_t len = 0;
> @@ -132,6 +130,7 @@ static void new_client(int ux_sock)
>       INIT_LIST_HEAD(&c->node);
>       c->fd = fd;
>       c->state = CLT_RECV;
> +     c->is_root = _socket_client_is_root(c->fd);
>  
>       /* put it in our linked list */
>       pthread_mutex_lock(&client_lock);
> -- 
> 2.33.0

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to