credentials: implement is_equal
[lttng-tools.git] / src / common / credentials.c
diff --git a/src/common/credentials.c b/src/common/credentials.c
new file mode 100644 (file)
index 0000000..dc1bdd8
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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;
+};
This page took 0.023754 seconds and 4 git commands to generate.