chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treat a trailing backslash as an error
[elogind.git]
/
src
/
shared
/
env-util.c
diff --git
a/src/shared/env-util.c
b/src/shared/env-util.c
index b2e45531ab7ec0131e102075bc9b09397dfe0fb1..fbdc73dd2c6459f324d487ba8826d00f8ced4cf4 100644
(file)
--- a/
src/shared/env-util.c
+++ b/
src/shared/env-util.c
@@
-28,6
+28,7
@@
#include "util.h"
#include "env-util.h"
#include "def.h"
#include "util.h"
#include "env-util.h"
#include "def.h"
+#include "unit.h"
#define VALID_CHARS_ENV_NAME \
DIGITS LETTERS \
#define VALID_CHARS_ENV_NAME \
DIGITS LETTERS \
@@
-78,7
+79,9
@@
bool env_value_is_valid(const char *e) {
if (!utf8_is_valid(e))
return false;
if (!utf8_is_valid(e))
return false;
- if (string_has_cc(e))
+ /* bash allows tabs in environment variables, and so should
+ * we */
+ if (string_has_cc(e, "\t"))
return false;
/* POSIX says the overall size of the environment block cannot
return false;
/* POSIX says the overall size of the environment block cannot
@@
-412,7
+415,7
@@
char *strv_env_get(char **l, const char *name) {
return strv_env_get_n(l, name, strlen(name));
}
return strv_env_get_n(l, name, strlen(name));
}
-char **strv_env_clean_log(char **e, const char *message) {
+char **strv_env_clean_log(char **e, const char *
unit_id, const char *
message) {
char **p, **q;
int k = 0;
char **p, **q;
int k = 0;
@@
-422,7
+425,7
@@
char **strv_env_clean_log(char **e, const char *message) {
if (!env_assignment_is_valid(*p)) {
if (message)
if (!env_assignment_is_valid(*p)) {
if (message)
- log_
error(
"Ignoring invalid environment '%s': %s", *p, message);
+ log_
unit_error(unit_id,
"Ignoring invalid environment '%s': %s", *p, message);
free(*p);
continue;
}
free(*p);
continue;
}
@@
-449,5
+452,5
@@
char **strv_env_clean_log(char **e, const char *message) {
}
char **strv_env_clean(char **e) {
}
char **strv_env_clean(char **e) {
- return strv_env_clean_log(e, NULL);
+ return strv_env_clean_log(e, NULL
, NULL
);
}
}