From 90e2bdf15df32403cd0a2b0c0f7e8886c1f785c4 Mon Sep 17 00:00:00 2001 From: shmuels Date: Sun, 25 Apr 2021 18:40:45 +0300 Subject: [PATCH 1/3] Disable the CLI comment feature entirely. --- apps/cli/cli_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cli/cli_main.c b/apps/cli/cli_main.c index a78a128b..cecebfa0 100644 --- a/apps/cli/cli_main.c +++ b/apps/cli/cli_main.c @@ -439,7 +439,7 @@ main(int argc, if (clicon_username_set(h, pw->pw_name) < 0) goto done; - cligen_comment_set(cli_cligen(h), '#'); /* Default to handle #! clicon_cli scripts */ + cligen_comment_set(cli_cligen(h), 0); /* Siklu: disable comments */ cligen_lexicalorder_set(cli_cligen(h), 1); /* From b362d0d5112fd52154d9ff1142795959cc2a060a Mon Sep 17 00:00:00 2001 From: shmuels Date: Mon, 10 May 2021 18:53:21 +0300 Subject: [PATCH 2/3] change localtime to localtime_r which is a thread-safe function --- lib/src/clixon_log.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/clixon_log.c b/lib/src/clixon_log.c index 1d1f1b25..caac71e6 100644 --- a/lib/src/clixon_log.c +++ b/lib/src/clixon_log.c @@ -171,13 +171,13 @@ static int flogtime(FILE *f) { struct timeval tv; - struct tm *tm; + struct tm tm; gettimeofday(&tv, NULL); - tm = localtime((time_t*)&tv.tv_sec); + localtime_r((time_t*)&tv.tv_sec, &tm); fprintf(f, "%s %2d %02d:%02d:%02d: ", - mon2name(tm->tm_mon), tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); + mon2name(tm.tm_mon), tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); return 0; } From e2b4e7097bc774607ccda28b58d953a9ccf138e5 Mon Sep 17 00:00:00 2001 From: shmuels Date: Mon, 10 May 2021 19:02:48 +0300 Subject: [PATCH 3/3] Revert "Disable the CLI comment feature entirely." This reverts commit 90e2bdf15df32403cd0a2b0c0f7e8886c1f785c4. --- apps/cli/cli_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cli/cli_main.c b/apps/cli/cli_main.c index cecebfa0..a78a128b 100644 --- a/apps/cli/cli_main.c +++ b/apps/cli/cli_main.c @@ -439,7 +439,7 @@ main(int argc, if (clicon_username_set(h, pw->pw_name) < 0) goto done; - cligen_comment_set(cli_cligen(h), 0); /* Siklu: disable comments */ + cligen_comment_set(cli_cligen(h), '#'); /* Default to handle #! clicon_cli scripts */ cligen_lexicalorder_set(cli_cligen(h), 1); /*