Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [lttng-ust RFC v3] Add setuid wrappers for per-UID buffers
Date: Tue, 28 May 2019 10:02:43 -0400 (EDT)	[thread overview]
Message-ID: <914116098.15558.1559052163427.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20190527215101.13744-1-gabriel.pollo-guilbert@efficios.com>

----- On May 27, 2019, at 5:51 PM, Gabriel-Andrew Pollo-Guilbert gabriel.pollo-guilbert at efficios.com wrote:

> In case of a per-UID buffer, events following a change of user ID should be
> forwarded to buffers of the new UID. In order to do so, we add a wrapper around
> setuid(3), setreuid(3) and setresuid(2) that unregister and re-register the
> application from the session daemon.
> 
> While there exist some other functions such as seteuid(3) or setfsuid(2), we
> don't need to add a wrapper for them since they do not edit the real user ID,
> the actual ID returned by getuid(3) and used for creating the buffers.

The general approach looks good.

The missing part is adding tests within lttng-tools "destructive" tests (because
they will likely change the system configuration to add users (?)).

One nit below since we are here...

> diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c
> index 61dbb41b..0d0b9eb4 100644
> --- a/liblttng-ust/lttng-ust-comm.c
> +++ b/liblttng-ust/lttng-ust-comm.c
> @@ -225,10 +225,12 @@ void ust_unlock(void)
>  *   daemon problems).
>  */
> static sem_t constructor_wait;
> +
> /*
>  * Doing this for both the global and local sessiond.
>  */
> -static int sem_count = { 2 };
> +#define LTTNG_UST_INIT_SEM_COUNT 2

I know I'm the one who asked for a #define, but in general, it's better
to use:

enum { LTTNG_UST_INIT_SEM_COUNT = 2 };

So we do not pollute the preprocessor namespace (e.g. output of gcc -dM -E file.c).

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


      reply	other threads:[~2019-05-28 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-27 21:51 Gabriel-Andrew Pollo-Guilbert
2019-05-28 14:02 ` Mathieu Desnoyers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=914116098.15558.1559052163427.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox