audit_logging: Remove incorrect check for NT_STATUS_OBJECT_NAME_NOT_FOUND
authorAndrew Bartlett <abartlet@samba.org>
Mon, 25 Jun 2018 02:51:35 +0000 (14:51 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Jun 2018 01:27:20 +0000 (03:27 +0200)
NT_STATUS_OBJECT_NAME_NOT_FOUND is not a case we can ignore, it would mean that event_server
is not initialised.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/audit_logging/audit_logging.c

index 2335fb145813d01b7b00a6b3b8df129a8f2cd6c8..3a27eb6105f8c89044b075379b39c1a7d57d7669 100644 (file)
@@ -248,8 +248,7 @@ void audit_message_send(
         * messages may get lost
         */
        status = get_event_server(msg_ctx, server_name, &event_server);
         * messages may get lost
         */
        status = get_event_server(msg_ctx, server_name, &event_server);
-       if (!NT_STATUS_IS_OK(status) &&
-           !NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+       if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("get_event_server for %s returned (%s)\n",
                        server_name,
                        nt_errstr(status));
                DBG_ERR("get_event_server for %s returned (%s)\n",
                        server_name,
                        nt_errstr(status));
@@ -270,8 +269,7 @@ void audit_message_send(
         */
        if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
                status = get_event_server(msg_ctx, server_name, &event_server);
         */
        if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
                status = get_event_server(msg_ctx, server_name, &event_server);
-               if (!NT_STATUS_IS_OK(status) &&
-                   !NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+               if (!NT_STATUS_IS_OK(status)) {
                        DBG_ERR("get_event_server for %s returned (%s)\n",
                                server_name,
                                nt_errstr(status));
                        DBG_ERR("get_event_server for %s returned (%s)\n",
                                server_name,
                                nt_errstr(status));