mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-02 17:42:18 +00:00
feat(userspace): Add more functions to banned.h
.
These include: * vsprintf() * sprintf() * strcat() * strncat() * strncpy() * swprintf() * vswprintf() This also changes `userspace/falco/logger.cpp` to remove a `sprintf` statement. The statement did not affect the codebase in any form so it was simply removed rather than being substituted. Fixes #1035 Signed-off-by: Vaibhav <vrongmeal@gmail.com>
This commit is contained in:
parent
488e667f46
commit
1c80c1f458
@ -23,3 +23,24 @@ limitations under the License.
|
||||
|
||||
#undef strcpy
|
||||
#define strcpy(a, b) BAN(strcpy)
|
||||
|
||||
#undef vsprintf
|
||||
#define vsprintf(a, b, c) BAN(vsprintf)
|
||||
|
||||
#undef sprintf
|
||||
#define sprintf(a, b, ...) BAN(sprintf)
|
||||
|
||||
#undef strcat
|
||||
#define strcat(a, b) BAN(strcat)
|
||||
|
||||
#undef strncat
|
||||
#define strncat(a, b, c) BAN(strncat)
|
||||
|
||||
#undef strncpy
|
||||
#define strncpy(a, b, c) BAN(strncpy)
|
||||
|
||||
#undef swprintf
|
||||
#define swprintf(a, b, c, ...) BAN(swprintf)
|
||||
|
||||
#undef vswprintf
|
||||
#define vswprintf(a, b, c, d) BAN(vswprintf)
|
||||
|
@ -131,12 +131,8 @@ void falco_logger::log(int priority, const string msg)
|
||||
{
|
||||
char buf[sizeof "YYYY-MM-DDTHH:MM:SS-0000"];
|
||||
struct tm *gtm = std::gmtime(&result);
|
||||
if(gtm == NULL ||
|
||||
(strftime(buf, sizeof(buf), "%FT%T%z", gtm) == 0))
|
||||
{
|
||||
sprintf(buf, "N/A");
|
||||
}
|
||||
else
|
||||
if(gtm != NULL &&
|
||||
(strftime(buf, sizeof(buf), "%FT%T%z", gtm) != 0))
|
||||
{
|
||||
fprintf(stderr, "%s: %s", buf, msg.c_str());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user