sessiond: enforce user-exclusive session access in session_access_ok
[lttng-tools.git] / src / bin / lttng-relayd / sessiond-trace-chunks.c
index db9f558012a515d580da0af018be39e24f8c22c1..1065234739a8d6e529c1dc58ba3dde24140c2666 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "sessiond-trace-chunks.h"
@@ -375,7 +365,7 @@ struct lttng_trace_chunk *sessiond_trace_chunk_registry_publish_chunk(
        lttng_uuid_copy(key.sessiond_uuid, sessiond_uuid);
 
        status = lttng_trace_chunk_get_id(new_chunk, &chunk_id);
-        if (status == LTTNG_TRACE_CHUNK_STATUS_OK) {
+       if (status == LTTNG_TRACE_CHUNK_STATUS_OK) {
                int ret;
 
                ret = snprintf(chunk_id_str, sizeof(chunk_id_str), "%" PRIu64,
@@ -385,25 +375,25 @@ struct lttng_trace_chunk *sessiond_trace_chunk_registry_publish_chunk(
                        WARN("Failed to format trace chunk id");
                }
                is_anonymous_chunk = false;
-        } else if (status == LTTNG_TRACE_CHUNK_STATUS_NONE) {
+       } else if (status == LTTNG_TRACE_CHUNK_STATUS_NONE) {
                is_anonymous_chunk = true;
        } else {
                ERR("Failed to get trace chunk id");
                goto end;
        }
 
-        DBG("Attempting to publish trace chunk: sessiond {%s}, session_id = "
+       DBG("Attempting to publish trace chunk: sessiond {%s}, session_id = "
                        "%" PRIu64 ", chunk_id = %s",
                        uuid_str, session_id,
                        is_anonymous_chunk ? "anonymous" : chunk_id_str);
 
-        element = trace_chunk_registry_ht_element_find(sessiond_registry, &key);
+       element = trace_chunk_registry_ht_element_find(sessiond_registry, &key);
        if (!element) {
                ERR("Failed to find registry of sessiond {%s}", uuid_str);
                goto end;
        }
 
-        published_chunk = lttng_trace_chunk_registry_publish_chunk(
+       published_chunk = lttng_trace_chunk_registry_publish_chunk(
                        element->trace_chunk_registry, session_id, new_chunk);
        /*
         * At this point, two references to the published chunks exist. One
This page took 0.024252 seconds and 4 git commands to generate.