[systemd-commits] 5 commits - TODO src/core src/shared src/sysusers
Lennart Poettering
lennart at kemper.freedesktop.org
Fri Nov 7 07:36:32 PST 2014
TODO | 4 ++++
src/core/dbus.c | 5 ++---
src/core/manager.c | 17 ++---------------
src/shared/log.c | 2 +-
src/shared/utf8.c | 8 +++++---
src/sysusers/sysusers.c | 3 ++-
6 files changed, 16 insertions(+), 23 deletions(-)
New commits:
commit f06863bde5de49a503cb8028e89d4b30790f2cbf
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Nov 7 16:34:37 2014 +0100
sysusers: be nice and print a warning if futimens() fails
CID# 1251163
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index c133dc5..5f5b49d 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -241,7 +241,8 @@ static int make_backup(const char *target, const char *x) {
ts[0] = st.st_atim;
ts[1] = st.st_mtim;
- futimens(fileno(dst), ts);
+ if (futimens(fileno(dst), ts) < 0)
+ log_warning("Failed to fix access and modification time of %s: %m", backup);
if (rename(temp, backup) < 0)
goto fail;
commit 144b3d9e093dd9310cd9590bec039dc43a7e2ad6
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Nov 7 16:34:00 2014 +0100
utf8: when looking at the next unichar, honour the size parameter, in utf8_is_printable_newline()
diff --git a/src/shared/utf8.c b/src/shared/utf8.c
index 9353559..8702ceb 100644
--- a/src/shared/utf8.c
+++ b/src/shared/utf8.c
@@ -150,10 +150,12 @@ bool utf8_is_printable_newline(const char* str, size_t length, bool newline) {
int encoded_len, val;
encoded_len = utf8_encoded_valid_unichar((const char *) p);
- val = utf8_encoded_to_unichar((const char*) p);
-
if (encoded_len < 0 ||
- val < 0 ||
+ (size_t) encoded_len > length)
+ return false;
+
+ val = utf8_encoded_to_unichar((const char*) p);
+ if (val < 0 ||
is_unicode_control(val) ||
(!newline && val == '\n'))
return false;
commit f9aa5413807e163df49171793eb93a230cd7b955
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Nov 7 16:33:03 2014 +0100
log: explicitly ignore return value of parse_proc_cmdline()
CID# 1251162
diff --git a/src/shared/log.c b/src/shared/log.c
index 26c604a..1c589ac 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -910,7 +910,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
void log_parse_environment(void) {
const char *e;
- parse_proc_cmdline(parse_proc_cmdline_item);
+ (void) parse_proc_cmdline(parse_proc_cmdline_item);
e = secure_getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)
commit f0e62e89970b8c38eb07a9beebd277ce13a5fcc2
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Nov 7 16:32:06 2014 +0100
core: unify how we create the notify and private dbus socket
Use the same robust logic of mkdir + unlink of any existing AF_UNIX
socket, ignoring the return value, right before bind().
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 185057b..9cb198a 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -974,11 +974,10 @@ static int bus_init_private(Manager *m) {
left = strpcpy(&p, left, "/systemd/private");
salen = sizeof(sa.un) - left;
-
- mkdir_parents_label(sa.un.sun_path, 0755);
}
- unlink(sa.un.sun_path);
+ (void) mkdir_parents_label(sa.un.sun_path, 0755);
+ (void) unlink(sa.un.sun_path);
fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (fd < 0) {
diff --git a/src/core/manager.c b/src/core/manager.c
index e596494..350f2f3 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -679,26 +679,13 @@ static int manager_setup_notify(Manager *m) {
return log_oom();
(void) mkdir_parents_label(m->notify_socket, 0755);
+ (void) unlink(m->notify_socket);
strncpy(sa.un.sun_path, m->notify_socket, sizeof(sa.un.sun_path)-1);
r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path));
if (r < 0) {
log_error("bind(%s) failed: %m", sa.un.sun_path);
- if (errno == EADDRINUSE) {
- log_notice("Removing %s socket and trying again.", m->notify_socket);
- r = unlink(m->notify_socket);
- if (r < 0) {
- log_error("Failed to remove %s: %m", m->notify_socket);
- return -EADDRINUSE;
- }
-
- r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path));
- if (r < 0) {
- log_error("bind(%s) failed: %m", sa.un.sun_path);
- return -errno;
- }
- } else
- return -errno;
+ return -errno;
}
r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
commit d48b7bd271b1e70924c8485d2f95c2f5a1ae77cb
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Nov 7 16:31:42 2014 +0100
update TODO
diff --git a/TODO b/TODO
index 5353340..23d5fa5 100644
--- a/TODO
+++ b/TODO
@@ -37,8 +37,12 @@ External:
Features:
+* maybe add support for specifier expansion in user.conf, specifically DefaultEnvironment=
+
* kdbus: set the bus-wide creds sender requirement mask to ANY
+* kdbus: busnames.target should get pulled in by basic.target
+
* code cleanup: retire FOREACH_WORD_QUOTED, port to unquote_first_word() loops instead
* logind: when the power button is pressed short, just popup a logout dialog. If it is pressed for 1s, do the usual shutdown. Inspiration are Macs here.
More information about the systemd-commits
mailing list