summaryrefslogtreecommitdiffstats
path: root/src/responder/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/common')
-rw-r--r--src/responder/common/responder.h2
-rw-r--r--src/responder/common/responder_common.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 321cedda..1b39fdd5 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -174,4 +174,6 @@ int sss_dp_send_acct_req(struct resp_ctx *rctx, TALLOC_CTX *callback_memctx,
int responder_logrotate(DBusMessage *message,
struct sbus_connection *conn);
+bool sss_utf8_check(const uint8_t *s, size_t n);
+
#endif /* __SSS_RESPONDER_H__ */
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 719f2464..f97ec06f 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -32,6 +32,7 @@
#include <sys/time.h>
#include <errno.h>
#include <popt.h>
+#include <unistr.h>
#include "util/util.h"
#include "db/sysdb.h"
#include "confdb/confdb.h"
@@ -627,3 +628,11 @@ int responder_logrotate(DBusMessage *message,
return monitor_common_pong(message, conn);
}
+
+bool sss_utf8_check(const uint8_t *s, size_t n)
+{
+ if (u8_check(s, n) == NULL) {
+ return true;
+ }
+ return false;
+}