Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I526fd15b8365fd2a77b5aa5250a75d956fd8efc3
common.h \
condition.c \
context.c context.h \
- credentials.h \
+ credentials.c credentials.h \
daemonize.c daemonize.h \
defaults.c \
dynamic-array.c dynamic-array.h \
--- /dev/null
+/*
+ * Copyright (C) 2020 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#include <assert.h>
+#include <stdbool.h>
+#include "credentials.h"
+
+bool lttng_credentials_is_equal(const struct lttng_credentials *a,
+ const struct lttng_credentials *b)
+{
+ assert(a);
+ assert(b);
+
+ if ((a->uid != b->uid) || (a->gid != b->gid)) {
+ return false;
+ }
+
+ return true;
+};
#define LTTNG_CREDENTIALS_H
#include <sys/types.h>
+#include <stdbool.h>
struct lttng_credentials {
uid_t uid;
gid_t gid;
};
+bool lttng_credentials_is_equal(const struct lttng_credentials *a,
+ const struct lttng_credentials *b);
+
#endif /* LTTNG_CREDENTIALS_H */