X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fshared%2Ffileio.c;h=b81eeb272a4bdc8aa28d89f97fce7d4d5976b977;hb=550a40eceb7d1917152fc9317bf2696708d52bc2;hp=838d1284332793a09c20a11c58dfd3a9fef0b640;hpb=cda7ecb0a3d6cf839ec484a6690c12857a6e8375;p=elogind.git diff --git a/src/shared/fileio.c b/src/shared/fileio.c index 838d12843..b81eeb272 100644 --- a/src/shared/fileio.c +++ b/src/shared/fileio.c @@ -539,15 +539,18 @@ static int parse_env_file_push(const char *filename, unsigned line, va_list aq, *ap = userdata; if (!utf8_is_valid(key)) { - log_error("%s:%u: invalid UTF-8 for key '%s', ignoring.", - filename, line, key); + _cleanup_free_ char *p = utf8_escape_invalid(key); + + log_error("%s:%u: invalid UTF-8 in key '%s', ignoring.", + filename, line, p); return -EINVAL; } if (value && !utf8_is_valid(value)) { - /* FIXME: filter UTF-8 */ + _cleanup_free_ char *p = utf8_escape_invalid(value); + log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.", - filename, line, key, value); + filename, line, key, p); return -EINVAL; }