Skip to content

Commit

Permalink
Deactivate HTTP Tracing (#752)
Browse files Browse the repository at this point in the history
* Deactivate HTTP tracing

* Deactivate HTTP tracing.
* Fix for the problem of extended OMI uninstallation.
  • Loading branch information
S-Sujith-Kumar committed Nov 14, 2023
1 parent 5406998 commit ffca75c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 28 deletions.
1 change: 0 additions & 1 deletion Unix/base/messagesprint.c
Expand Up @@ -724,7 +724,6 @@ void PamCheckUserReq_Print(
{"tag", FT_UINT32, offsetof(Self, base.tag)},
{"operationId", FT_UINT64, offsetof(Self, base.operationId)},
{"user", FT_STRING, offsetof(Self, user)},
{"password", FT_STRING, offsetof(Self, passwd)},
{"handle", FT_UINT64, offsetof(Self, handle)},
{NULL, 0, 0},
};
Expand Down
47 changes: 25 additions & 22 deletions Unix/http/http.c
Expand Up @@ -405,42 +405,45 @@ static MI_Result _Sock_WriteAux(
return MI_RESULT_FAILED;
}

void _WriteTraceFile(PathID id, const void* data, size_t size)
void _WriteTraceFile(PathID id, const void *data, size_t size)
{
if (FORCE_TRACING)
{
#ifdef CONFIG_POSIX
static pthread_mutex_t s_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t s_mutex = PTHREAD_MUTEX_INITIALIZER;
#else
/* TODO: How to synchronize logging */
/* TODO: How to synchronize logging */
#endif
const char* path;
const char *path;

if (!(path = OMI_GetPath(id)))
return;
if (!(path = OMI_GetPath(id)))
return;

#ifdef CONFIG_POSIX
pthread_mutex_lock(&s_mutex);
pthread_mutex_lock(&s_mutex);
#else
/* TODO: How to synchronize logging */
/* TODO: How to synchronize logging */
#endif
{
FILE* out = fopen(path, "a");

if (out)
{
fwrite(data, 1, size, out);
fwrite("\n", 1, 1, out);
fclose(out);
}
else
{
trace_CannotOpenHttptraceFile(path, errno);
FILE *out = fopen(path, "a");

if (out)
{
fwrite(data, 1, size, out);
fwrite("\n", 1, 1, out);
fclose(out);
}
else
{
trace_CannotOpenHttptraceFile(path, errno);
}
}
}
#ifdef CONFIG_POSIX
pthread_mutex_unlock(&s_mutex);
pthread_mutex_unlock(&s_mutex);
#else
/* TODO: How to synchronize logging */
/* TODO: How to synchronize logging */
#endif
}
}

INLINE MI_Result _Sock_Read(
Expand Down
2 changes: 1 addition & 1 deletion Unix/http/httpclient.c
Expand Up @@ -28,7 +28,7 @@
#include "sessionmap.h"

#define ENABLE_TRACING 1
#define FORCE_TRACING 1
#define FORCE_TRACING 0

#ifndef CONFIG_POSIX
/* ssl not supported in this configuration; just make compiler happy */
Expand Down
2 changes: 1 addition & 1 deletion Unix/http/httpclientauth.c
Expand Up @@ -36,7 +36,7 @@
//#define GSS_USE_IOV 1

#define ENABLE_TRACING 1
#define FORCE_TRACING 1
#define FORCE_TRACING 0

#if GSS_USE_IOV && !defined(macos)
#include "httpkrb5.h"
Expand Down
2 changes: 1 addition & 1 deletion Unix/http/sessionmap.c
Expand Up @@ -4,7 +4,7 @@
#include <common.h>

#define ENABLE_TRACING 1
#define FORCE_TRACING 1
#define FORCE_TRACING 0

#ifdef ENABLE_TRACING
# define TRACING_LEVEL 4
Expand Down
5 changes: 4 additions & 1 deletion Unix/installbuilder/datafiles/Base_OMI.data
Expand Up @@ -561,7 +561,10 @@ chown omi:omi /etc/opt/omi/.creds >/dev/null 2>&1
chown omi:omi /etc/opt/omi/.creds/ntlm >/dev/null 2>&1
chown omi:omi /etc/opt/omi/conf/sockets
chmod 700 /etc/opt/omi/conf/sockets

rm -f /var/opt/omi/log/omiserver-send.trc >/dev/null 2>&1
rm -f /var/opt/omi/log/omiserver-recv.trc >/dev/null 2>&1
rm -f /var/opt/omi/log/omiclient-send.trc >/dev/null 2>&1
rm -f /var/opt/omi/log/omiclient-recv.trc >/dev/null 2>&1

# Fix potential permissons issue on /etc/opt/omi directory
chown root:${{ROOT_GROUP_NAME}} /etc/opt/omi
Expand Down
2 changes: 1 addition & 1 deletion Unix/installbuilder/datafiles/Linux.data
Expand Up @@ -303,7 +303,7 @@ if ${{PERFORMING_UPGRADE_NOT}}; then
egrep -q "^omi:" /etc/passwd
if [ $? -eq 0 ]; then
echo "Deleting omi service account ..."
userdel omi
userdel -f omi
fi
egrep -q "^omi:" /etc/group
if [ $? -eq 0 ]; then
Expand Down

0 comments on commit ffca75c

Please sign in to comment.