fix: SSH transport - log to stderr, use-after-free, systemd scope conflict

This commit is contained in:
2026-07-06 20:15:36 +02:00
parent 3b92501dc7
commit 372c559ef2
3 changed files with 11 additions and 8 deletions
+5 -6
View File
@@ -12,14 +12,13 @@ void log_message(LogLevel log_level, char *format, ...) {
time_t now = time(NULL);
struct tm *t = localtime(&now);
// Print timestamp and log level to the file
printf("%04d-%02d-%02d %02d:%02d:%02d [%s]: ", t->tm_year + 1900,
t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec,
log_level_strings[log_level]);
fprintf(stderr, "%04d-%02d-%02d %02d:%02d:%02d [%s]: ", t->tm_year + 1900,
t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec,
log_level_strings[log_level]);
va_list args;
va_start(args, format);
vprintf(format, args);
vfprintf(stderr, format, args);
va_end(args);
printf("\n");
fprintf(stderr, "\n");
}