X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fupdate-utmp.c;h=12e4d110425c2050f09edb7e14a5a581b7ee2ec7;hb=7fc2a89a7387db1e5daa4892393c9e9536920c25;hp=e45bee10ceee237699c3b707d8d4271da5398075;hpb=22f4096ca96acd504ac74e7dfad96f07edb6da51;p=elogind.git diff --git a/src/update-utmp.c b/src/update-utmp.c index e45bee10c..12e4d1104 100644 --- a/src/update-utmp.c +++ b/src/update-utmp.c @@ -373,8 +373,13 @@ int main(int argc, char *argv[]) { log_parse_environment(); log_open(); + umask(0022); + #ifdef HAVE_AUDIT - if ((c.audit_fd = audit_open()) < 0) + if ((c.audit_fd = audit_open()) < 0 && + /* If the kernel lacks netlink or audit support, + * don't worry about it. */ + errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT) log_error("Failed to connect to audit log: %m"); #endif @@ -406,8 +411,9 @@ finish: #endif if (c.bus) { - dbus_connection_close(c.bus); - dbus_connection_unref(c.bus); + dbus_connection_flush(c.bus); + dbus_connection_close(c.bus); + dbus_connection_unref(c.bus); } dbus_error_free(&error);