chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nspawn: add new --personality= switch to make it easier to run 32bit containers on...
[elogind.git]
/
src
/
shared
/
fileio.c
diff --git
a/src/shared/fileio.c
b/src/shared/fileio.c
index 838d1284332793a09c20a11c58dfd3a9fef0b640..0d3f2e90c75d639184307d97cd4101dbb5fa1a84 100644
(file)
--- a/
src/shared/fileio.c
+++ b/
src/shared/fileio.c
@@
-130,7
+130,7
@@
ssize_t sendfile_full(int out_fd, const char *fn) {
assert(out_fd > 0);
assert(fn);
assert(out_fd > 0);
assert(fn);
- f = fopen(fn, "r");
+ f = fopen(fn, "r
e
");
if (!f)
return -errno;
if (!f)
return -errno;
@@
-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)) {
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)) {
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.",
log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.",
- filename, line, key,
value
);
+ filename, line, key,
p
);
return -EINVAL;
}
return -EINVAL;
}