Skip to content

Commit 7b51ee3

Browse files
committed
do not initialize CSP data structures when CSP is not compiled in (this produced a false positive in valgrind testing)
// BelongsTo: CS-1743
1 parent d300790 commit 7b51ee3

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

source/libs/gdi/ocs_gdi_ClientBase.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* All Rights Reserved.
2929
*
30-
* Portions of this software are Copyright (c) 2023-2025 HPC-Gridware GmbH
30+
* Portions of this software are Copyright (c) 2023-2026 HPC-Gridware GmbH
3131
*
3232
************************************************************************/
3333
/*___INFO__MARK_END__*/
@@ -775,13 +775,15 @@ ocs::gdi::ClientBase::setup(int component_id, u_long32 thread_id, lList **answer
775775
DRETURN(AE_ERROR);
776776
}
777777

778+
#ifdef SECURE
778779
gdi_data_set_csp_path_obj(sge_csp_path_class_create(gdi_data_get_error_handle()));
779780
if (!gdi_data_get_csp_path_obj()) {
780781
// EB: TODO: I18N + replace by an end user error message
781782
CRITICAL("sgdi_data_get_csp_path_obj() failed");
782783
answer_list_add(answer_list, SGE_EVENT, STATUS_ESEMANTIC, ANSWER_QUALITY_CRITICAL);
783784
DRETURN(AE_ERROR);
784785
}
786+
#endif
785787

786788
component_set_exit_func(gdi_default_exit_func);
787789

source/libs/gdi/sge_gdi_data.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* All Rights Reserved.
2929
*
30-
* Portions of this software are Copyright (c) 2024-2025 HPC-Gridware GmbH
30+
* Portions of this software are Copyright (c) 2024-2026 HPC-Gridware GmbH
3131
*
3232
************************************************************************/
3333
/*___INFO__MARK_END__*/
@@ -59,7 +59,9 @@ typedef struct {
5959
u_long64 timestamp_qmaster_file;
6060
char *ssl_private_key;
6161
char *ssl_certificate;
62+
#ifdef SECURE
6263
sge_csp_path_class_t *csp_path_obj;
64+
#endif
6365
} sge_gdi_ts_t;
6466

6567
// once initializer
@@ -124,7 +126,11 @@ gdi_data_ts_init() {
124126
static void
125127
gdi_data_ts_destroy() {
126128
DENTER(TOP_LAYER);
129+
130+
#ifdef SECURE
127131
sge_csp_path_class_destroy(&ts.csp_path_obj);
132+
#endif
133+
128134
pthread_mutex_destroy(&ts.mutex);
129135

130136
/* @todo CS-591 don't we have to free all the other attributes as well?
@@ -221,6 +227,7 @@ gdi_data_set_last_commlib_error(int last_commlib_error) {
221227
tl->last_commlib_error = last_commlib_error;
222228
}
223229

230+
#ifdef SECURE
224231
const char *
225232
gdi_data_get_ssl_private_key() {
226233
return ts.ssl_private_key;
@@ -250,6 +257,7 @@ void
250257
gdi_data_set_csp_path_obj(sge_csp_path_class_t *csp_path_obj) {
251258
ts.csp_path_obj = csp_path_obj;
252259
}
260+
#endif
253261

254262
// @todo still required?
255263
u_long32

source/libs/gdi/sge_gdi_data.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* All Rights Reserved.
3030
*
31-
* Portions of this software are Copyright (c) 2024 HPC-Gridware GmbH
31+
* Portions of this software are Copyright (c) 2024-2026 HPC-Gridware GmbH
3232
*
3333
************************************************************************/
3434
/*___INFO__MARK_END__*/
@@ -67,6 +67,7 @@ gdi_data_get_last_commlib_error();
6767
void
6868
gdi_data_set_last_commlib_error(int last_commlib_error);
6969

70+
#ifdef SECURE
7071
const char *
7172
gdi_data_get_ssl_private_key();
7273

@@ -84,6 +85,7 @@ gdi_data_get_csp_path_obj();
8485

8586
void
8687
gdi_data_set_csp_path_obj(sge_csp_path_class_t *csp_path_obj);
88+
#endif
8789

8890
u_long32
8991
gdi_data_get_next_request_id();

0 commit comments

Comments
 (0)