Todd C. Miller
5768d374cc
libsudo_util: silence most -Wconversion warnings.
2023-07-07 15:07:04 -06:00
Rose
e54ba33ea0
Avoid compiler casting warnings by assigning to the same type where possible
...
This saves instructions that are related to casting as well as compiler warnings.
2023-06-28 17:25:26 -04:00
Todd C. Miller
797cc917a8
Add basic regress for JSON functions.
...
Fix a bug in escaped control character handling.
Roll back changes to buffer if sudo_json_add_value() fails.
2022-12-15 19:49:11 -07:00
Todd C. Miller
e706204f5f
Escape control characters in strings.
2022-12-14 19:08:38 -07:00
Todd C. Miller
f066ff9e01
Eliminate a few harmless dead stores.
...
Quiets warnings from Infer.
2022-11-22 11:18:24 -07:00
Todd C. Miller
57b5ff8e8c
Avoid a -Wshadow warning on Solaris 9.
2022-10-07 11:00:17 -06:00
Todd C. Miller
6bc729aa36
Support "minimal" JSON which skips all non-essention whitespace.
...
This replaces the old "compact" mode which is only used for syslog.
2020-10-27 13:26:22 -06:00
Todd C. Miller
8ef5c4cf9d
Set DEFAULT_TEXT_DOMAIN in lib/util's Makefile not individual .c files.
...
We no longer need to include sudo_gettext.h before sudo_compat.h
2020-05-18 11:19:58 -06:00
Todd C. Miller
446ae3f507
Include string.h unconditionally and only use strings.h for strn?casecmp()
...
In the pre-POSIX days BSD had strings.h, not string.h.
Now strings.h is only used for non-ANSI string functions.
2020-05-18 07:59:24 -06:00
Todd C. Miller
dd88460800
We no longer need to include headers we don't use for sudo*.h files.
...
Previously we needed to include headers required by the various
sudo*h files. Now those files are more self-sufficient and we
should only include headers needed by code in the various .c files.
2020-05-18 06:47:04 -06:00
Todd C. Miller
3cd9cbbadf
Add tests for the simple json parser.
2020-03-29 05:05:08 -06:00
Todd C. Miller
cffda82e20
Do not use JSON_ARRAY with sudo_json_add_value()
2020-03-29 05:05:08 -06:00
Todd C. Miller
982c003b8d
Add support for JSON structured logging using syslog.
...
Note that depending on the system, the default syslog buffer
may not be large enough to store all the logging data.
2020-02-17 16:25:18 -07:00
Todd C. Miller
8ef5b734c4
Rework the JSON API to write to a memory buffer, not a stdio stream.
2020-02-17 16:10:55 -07:00
Todd C. Miller
c92f39ed3d
Use json functions from libsudo_util in cvtsudoers.
2020-02-08 09:11:02 -07:00
Todd C. Miller
88f9f2ba9a
Add a simple API for writing JSON records.
...
To be used by the upcoming JSON audit module.
2020-01-30 13:12:25 -07:00