common: move bytecode utilities from filter to its own file
[lttng-tools.git] / src / common / runas.c
index 30bf4263aa3d55c365c99a2ff4e57ef61a7614ed..21c1a91adde55648238359d736c8e7e820009de6 100644 (file)
@@ -22,6 +22,7 @@
 #include <assert.h>
 #include <signal.h>
 
+#include <common/bytecode/bytecode.h>
 #include <common/lttng-kernel.h>
 #include <common/common.h>
 #include <common/utils.h>
@@ -37,7 +38,6 @@
 
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/filter/filter-ast.h>
-#include <common/filter/filter-bytecode.h>
 
 #include "runas.h"
 
@@ -1799,8 +1799,7 @@ error:
 
 LTTNG_HIDDEN
 int run_as_generate_filter_bytecode(const char *filter_expression,
-               uid_t uid,
-               gid_t gid,
+               const struct lttng_credentials *creds,
                struct lttng_filter_bytecode **bytecode)
 {
        int ret;
@@ -1808,6 +1807,8 @@ int run_as_generate_filter_bytecode(const char *filter_expression,
        struct run_as_ret run_as_ret = {};
        const struct lttng_filter_bytecode *view_bytecode = NULL;
        struct lttng_filter_bytecode *local_bytecode = NULL;
+       const uid_t uid = lttng_credentials_get_uid(creds);
+       const gid_t gid = lttng_credentials_get_gid(creds);
 
        DBG3("generate_filter_bytecode() from expression=\"%s\" for uid %d and gid %d",
                        filter_expression, (int) uid, (int) gid);
This page took 0.023878 seconds and 4 git commands to generate.