[systemd-commits] 5 commits - src/99-systemd.rules src/logind-dbus.c src/manager.c src/util.c TODO

Lennart Poettering lennart at kemper.freedesktop.org
Mon Jul 4 18:29:36 PDT 2011


 TODO                 |   13 ++++---------
 src/99-systemd.rules |    5 ++++-
 src/logind-dbus.c    |    2 +-
 src/manager.c        |    2 +-
 src/util.c           |   14 +++++++++-----
 5 files changed, 19 insertions(+), 17 deletions(-)

New commits:
commit 5db35d0672949f2d418b4f5dfad2975c4b7e7691
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jul 5 03:27:14 2011 +0200

    udev: pull in printer.target from all kinds of printers

diff --git a/TODO b/TODO
index 3908311..4367eb1 100644
--- a/TODO
+++ b/TODO
@@ -23,6 +23,8 @@ F15 External:
 
 Features:
 
+* wildcard support for .path units (think CUPS spool directory!)
+
 * kernel: add /proc/sys file exposing CAP_LAST_CAP?
 
 * kernel: add device_type = "fb", "fbcon" to class "graphics"
@@ -39,8 +41,6 @@ Features:
   when we start a service in order to avoid confusion when a user
   assumes starting a service is enough to make it accessible
 
-* drop -lrt req for sd-daemon.[ch]
-
 * Make it possible to set the keymap independently from the font on
   the kernel cmdline. Right now setting one resets also the other.
 
@@ -52,8 +52,6 @@ Features:
 
 * add dbus call to convert snapshot into target
 
-* move /selinux to /sys/fs/selinux
-
 * detect LXC with $container=lxc
 
 * add prefix match to sysctl, tmpfiles, ...
diff --git a/src/99-systemd.rules b/src/99-systemd.rules
index c079c35..d2c41c1 100644
--- a/src/99-systemd.rules
+++ b/src/99-systemd.rules
@@ -32,8 +32,11 @@ SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsyst
 SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/sys/subsystem/bluetooth/devices/%k"
 
 SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}="bluetooth.target"
-SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}="printer.target"
 ENV{ID_SMARTCARD_READER}=="*?", TAG+="systemd", ENV{SYSTEMD_WANTS}="smartcard.target"
 SUBSYSTEM=="sound", KERNEL=="card*", TAG+="systemd", ENV{SYSTEMD_WANTS}="sound.target"
 
+SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}="printer.target"
+SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}="printer.target"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701*:", TAG+="systemd", ENV{SYSTEMD_WANTS}="printer.target"
+
 LABEL="systemd_end"

commit 7862f62de3d5e71a63391e6ce7ecaee080bc6a2d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun Jul 3 23:20:56 2011 +0200

    util: explicitly turn of O_CLOEXEC for stdin/stdout/stderr

diff --git a/src/util.c b/src/util.c
index ca769c2..344b869 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2947,6 +2947,10 @@ int make_stdio(int fd) {
         if (r < 0 || s < 0 || t < 0)
                 return -errno;
 
+        fd_cloexec(STDIN_FILENO, false);
+        fd_cloexec(STDOUT_FILENO, false);
+        fd_cloexec(STDERR_FILENO, false);
+
         return 0;
 }
 

commit ccaa61498c7932cbd5c91540841840266914b10e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun Jul 3 23:20:39 2011 +0200

    add a few O_CLOEXEC where missing

diff --git a/src/manager.c b/src/manager.c
index 258b3ca..7b725e3 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -136,7 +136,7 @@ static int enable_special_signals(Manager *m) {
         if (reboot(RB_DISABLE_CAD) < 0)
                 log_warning("Failed to enable ctrl-alt-del handling: %m");
 
-        if ((fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY)) < 0)
+        if ((fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC)) < 0)
                 log_warning("Failed to open /dev/tty0: %m");
         else {
                 /* Enable that we get SIGWINCH on kbrequest */
diff --git a/src/util.c b/src/util.c
index f75df7b..ca769c2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -490,7 +490,7 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
         assert_se(snprintf(fn, sizeof(fn)-1, "/proc/%lu/stat", (unsigned long) pid) < (int) (sizeof(fn)-1));
         char_array_0(fn);
 
-        if (!(f = fopen(fn, "r")))
+        if (!(f = fopen(fn, "re")))
                 return -errno;
 
         if (!(fgets(line, sizeof(line), f))) {
@@ -535,7 +535,7 @@ int get_starttime_of_pid(pid_t pid, unsigned long long *st) {
         assert_se(snprintf(fn, sizeof(fn)-1, "/proc/%lu/stat", (unsigned long) pid) < (int) (sizeof(fn)-1));
         char_array_0(fn);
 
-        if (!(f = fopen(fn, "r")))
+        if (!(f = fopen(fn, "re")))
                 return -errno;
 
         if (!(fgets(line, sizeof(line), f))) {
@@ -1010,7 +1010,7 @@ int get_process_cmdline(pid_t pid, size_t max_length, char **line) {
         if (asprintf(&p, "/proc/%lu/cmdline", (unsigned long) pid) < 0)
                 return -ENOMEM;
 
-        f = fopen(p, "r");
+        f = fopen(p, "re");
         free(p);
 
         if (!f)
@@ -2656,7 +2656,7 @@ int release_terminal(void) {
         int r = 0, fd;
         struct sigaction sa_old, sa_new;
 
-        if ((fd = open("/dev/tty", O_RDWR|O_NOCTTY|O_NDELAY)) < 0)
+        if ((fd = open("/dev/tty", O_RDWR|O_NOCTTY|O_NDELAY|O_CLOEXEC)) < 0)
                 return -errno;
 
         /* Temporarily ignore SIGHUP, so that we don't get SIGHUP'ed
@@ -4272,7 +4272,7 @@ int detect_container(const char **id) {
                 return 1;
         }
 
-        if ((f = fopen("/proc/self/cgroup", "r"))) {
+        if ((f = fopen("/proc/self/cgroup", "re"))) {
 
                 for (;;) {
                         char line[LINE_MAX], *p;

commit b5ef5549e9889eea1c66c4ed88667b5922cd9f76
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun Jul 3 23:19:55 2011 +0200

    logind: write rules files atomically

diff --git a/TODO b/TODO
index f494b05..3908311 100644
--- a/TODO
+++ b/TODO
@@ -25,19 +25,14 @@ Features:
 
 * kernel: add /proc/sys file exposing CAP_LAST_CAP?
 
-* understand https://bugzilla.redhat.com/show_bug.cgi?id=672194
-
-* possibly set timezone offset from systemd at init instead
-  of calling hwclock
-
 * kernel: add device_type = "fb", "fbcon" to class "graphics"
 
+* understand https://bugzilla.redhat.com/show_bug.cgi?id=672194
+
 * readahead: use BTRFS_IOC_DEFRAG_RANGE instead of BTRFS_IOC_DEFRAG ioctl, with START_IO
 
 * readahead: check whether a btrfs volume includes ssd by checking mount flag "ssd"
 
-* hostnamed: make file updates atomic
-
 * support sd_notify() style notificatio when reload is finished (RELOADED=1)
 
 * verify that the AF_UNIX sockets of a service in the fs still exist
diff --git a/src/logind-dbus.c b/src/logind-dbus.c
index 96216e4..95bb07a 100644
--- a/src/logind-dbus.c
+++ b/src/logind-dbus.c
@@ -634,7 +634,7 @@ static int attach_device(Manager *m, const char *seat, const char *sysfs) {
         }
 
         mkdir_p("/etc/udev/rules.d", 0755);
-        r = write_one_line_file(file, rule);
+        r = write_one_line_file_atomic(file, rule);
         if (r < 0)
                 goto finish;
 

commit 0a31730e3ba16085bb1676cb31a97f0200a271c0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sun Jul 3 16:09:56 2011 +0200

    update todo

diff --git a/TODO b/TODO
index b999ce1..f494b05 100644
--- a/TODO
+++ b/TODO
@@ -23,6 +23,8 @@ F15 External:
 
 Features:
 
+* kernel: add /proc/sys file exposing CAP_LAST_CAP?
+
 * understand https://bugzilla.redhat.com/show_bug.cgi?id=672194
 
 * possibly set timezone offset from systemd at init instead



More information about the systemd-commits mailing list