1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

lib:audit_logging: Add function to return the JSON null object

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-06-15 13:30:45 +12:00 committed by Andrew Bartlett
parent b11ad8b137
commit f9c55b84ef
2 changed files with 18 additions and 0 deletions

View File

@ -1213,6 +1213,23 @@ struct json_object json_get_object(struct json_object *object, const char *name)
return o; return o;
} }
/*
* @brief Return the JSON null object.
*
* @return the JSON null object.
*/
_WARN_UNUSED_RESULT_ struct json_object json_null_object(void)
{
struct json_object object = json_empty_object;
object.root = json_null();
if (object.root != NULL) {
object.valid = true;
}
return object;
}
/* /*
* @brief Create a JSON object from a structure containing audit information. * @brief Create a JSON object from a structure containing audit information.
* *

View File

@ -105,6 +105,7 @@ _WARN_UNUSED_RESULT_ struct json_object json_get_object(
struct json_object *object, const char *name); struct json_object *object, const char *name);
_WARN_UNUSED_RESULT_ char *json_to_string(TALLOC_CTX *mem_ctx, _WARN_UNUSED_RESULT_ char *json_to_string(TALLOC_CTX *mem_ctx,
const struct json_object *object); const struct json_object *object);
_WARN_UNUSED_RESULT_ struct json_object json_null_object(void);
struct authn_audit_info; struct authn_audit_info;
_WARN_UNUSED_RESULT_ struct json_object json_from_audit_info( _WARN_UNUSED_RESULT_ struct json_object json_from_audit_info(
const struct authn_audit_info *audit_info); const struct authn_audit_info *audit_info);