chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
core: don't reset log level to NOTICE if we get quiet on the kernel cmdline
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 891182a35b70d4460aa2082914753090305f6621..c53f9cdb6acb1c3cd055bd7698d18b03a97c7082 100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-4248,6
+4248,11
@@
bool hostname_is_valid(const char *s) {
if (isempty(s))
return false;
if (isempty(s))
return false;
+ /* Doesn't accept empty hostnames, hostnames with trailing or
+ * leading dots, and hostnames with multiple dots in a
+ * sequence. Also ensures that the length stays below
+ * HOST_NAME_MAX. */
+
for (p = s, dot = true; *p; p++) {
if (*p == '.') {
if (dot)
for (p = s, dot = true; *p; p++) {
if (*p == '.') {
if (dot)
@@
-6447,7
+6452,7
@@
int container_get_leader(const char *machine, pid_t *pid) {
assert(machine);
assert(pid);
assert(machine);
assert(pid);
- p = str
append
a("/run/systemd/machines/", machine);
+ p = str
join
a("/run/systemd/machines/", machine);
r = parse_env_file(p, NEWLINE, "LEADER", &s, "CLASS", &class, NULL);
if (r == -ENOENT)
return -EHOSTDOWN;
r = parse_env_file(p, NEWLINE, "LEADER", &s, "CLASS", &class, NULL);
if (r == -ENOENT)
return -EHOSTDOWN;
@@
-6686,7
+6691,7
@@
int open_tmpfile(const char *path, int flags) {
#endif
/* Fall back to unguessable name + unlinking */
#endif
/* Fall back to unguessable name + unlinking */
- p = str
append
a(path, "/systemd-tmp-XXXXXX");
+ p = str
join
a(path, "/systemd-tmp-XXXXXX");
fd = mkostemp_safe(p, flags);
if (fd < 0)
fd = mkostemp_safe(p, flags);
if (fd < 0)
@@
-7215,7
+7220,7
@@
int take_password_lock(const char *root) {
* awfully racy, and thus we just won't do them. */
if (root)
* awfully racy, and thus we just won't do them. */
if (root)
- path = str
append
a(root, "/etc/.pwd.lock");
+ path = str
join
a(root, "/etc/.pwd.lock");
else
path = "/etc/.pwd.lock";
else
path = "/etc/.pwd.lock";