42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
|
|
From bbe96f9798451129ae2555f92e2f698f842f7833 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Steve Grubb <sgrubb@redhat.com>
|
||
|
|
Date: Tue, 10 Oct 2023 08:22:49 -0400
|
||
|
|
Subject: [PATCH] Error out if required zos parameters missing
|
||
|
|
|
||
|
|
|
||
|
|
Reference:https://github.com/linux-audit/audit-userspace/commit/bbe96f9798451129ae2555f92e2f698f842f7833
|
||
|
|
Conflict:NA
|
||
|
|
|
||
|
|
---
|
||
|
|
audisp/plugins/zos-remote/zos-remote-ldap.c | 8 ++++++--
|
||
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/audisp/plugins/zos-remote/zos-remote-ldap.c b/audisp/plugins/zos-remote/zos-remote-ldap.c
|
||
|
|
index 7dd1424f..7e27eda4 100644
|
||
|
|
--- a/audisp/plugins/zos-remote/zos-remote-ldap.c
|
||
|
|
+++ b/audisp/plugins/zos-remote/zos-remote-ldap.c
|
||
|
|
@@ -134,14 +134,18 @@ retry:
|
||
|
|
|
||
|
|
int zos_remote_init(ZOS_REMOTE *zos_remote, const char *server, int port,
|
||
|
|
const char *user, const char *password, int timeout)
|
||
|
|
-{
|
||
|
|
+{
|
||
|
|
+ if (server == NULL || user == NULL || password == NULL) {
|
||
|
|
+ log_err("Error: required parameters are not present in config file");
|
||
|
|
+ return ICTX_E_FATAL;
|
||
|
|
+ }
|
||
|
|
zos_remote->server = strdup(server);
|
||
|
|
zos_remote->port = port;
|
||
|
|
zos_remote->user = strdup(user);
|
||
|
|
zos_remote->password = strdup(password);
|
||
|
|
zos_remote->timeout = timeout;
|
||
|
|
zos_remote->connected = 0;
|
||
|
|
-
|
||
|
|
+
|
||
|
|
if (!zos_remote->server || !zos_remote->user || !zos_remote->password) {
|
||
|
|
log_err("Error allocating memory for session members");
|
||
|
|
return ICTX_E_FATAL;
|
||
|
|
--
|
||
|
|
2.33.0
|
||
|
|
|