audit_value_needs_encoding - Man Page

check a string to see if it needs encoding

Synopsis

#include <libaudit.h>

int audit_value_needs_encoding(const char *str, unsigned int size);

Description

audit_value_needs_encoding() checks size bytes from str to see if the value must be encoded before it is logged in an audit name/value field. Specifically, this function checks for a double-quote, any byte in the range 0x00 through 0x20, or any byte in the range 0x7F through 0xFF. The 0x00 through 0x20 range includes C0 control bytes and space.

str is the byte string to check. It does not have to be NUL-terminated and may contain embedded NUL bytes. size is the number of bytes to check from str. If str is NULL, encoding is not needed.

Return Value

The return value if encoding is needed is 1. If not needed is 0.

See Also

audit_encode_nv_string(3), audit_encode_value(3).

Author

Steve Grubb

Referenced By

audit_encode_nv_string(3), audit_encode_value(3).

May 2026 Red Hat Linux Audit API