[systemd-commits] 4 commits - man/sd_uid_get_state.xml src/binfmt src/modules-load.c src/sysctl.c TODO

Lennart Poettering lennart at kemper.freedesktop.org
Tue Mar 20 07:31:17 PDT 2012


 TODO                     |    4 ++++
 man/sd_uid_get_state.xml |    8 ++++----
 src/binfmt/binfmt.c      |   25 +++++++++++++++----------
 src/modules-load.c       |   11 ++++++++---
 src/sysctl.c             |   28 +++++++++++++++++-----------
 5 files changed, 48 insertions(+), 28 deletions(-)

New commits:
commit de19ece73860e90a10029fbc4c4f6d3b296f1a1e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 20 15:31:09 2012 +0100

    sysctl: accept multiple passed configuration files

diff --git a/src/sysctl.c b/src/sysctl.c
index 852ec91..17c6719 100644
--- a/src/sysctl.c
+++ b/src/sysctl.c
@@ -219,28 +219,34 @@ int main(int argc, char *argv[]) {
         if (r <= 0)
                 return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 
-        if (argc-optind > 1) {
-                log_error("This program expects one or no arguments.");
-                return EXIT_FAILURE;
-        }
-
         log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
 
         umask(0022);
 
-        if (argc > optind)
-                r = apply_file(argv[optind], false);
-        else {
+        if (argc > optind) {
+                int i;
+
+                for (i = optind; i < argc; i++) {
+                        int k;
+
+                        k = apply_file(argv[i], false);
+                        if (k < 0 && r == 0)
+                                r = k;
+                }
+        } else {
                 char **files, **f;
+                int k;
 
                 r = conf_files_list(&files, ".conf",
                                     "/etc/sysctl.d",
                                     "/run/sysctl.d",
                                     "/usr/local/lib/sysctl.d",
                                     "/usr/lib/sysctl.d",
+#ifdef HAVE_SPLIT_USR
                                     "/lib/sysctl.d",
+#endif
                                     NULL);
                 if (r < 0) {
                         log_error("Failed to enumerate sysctl.d files: %s", strerror(-r));
@@ -248,14 +254,14 @@ int main(int argc, char *argv[]) {
                 }
 
                 STRV_FOREACH(f, files) {
-                        int k;
-
                         k = apply_file(*f, true);
                         if (k < 0 && r == 0)
                                 r = k;
                 }
 
-                apply_file("/etc/sysctl.conf", true);
+                k = apply_file("/etc/sysctl.conf", true);
+                if (k < 0 && r == 0)
+                        r = k;
 
                 strv_free(files);
         }

commit 4e2075ceea72b3e7e753bf5c6c0e8c4a3b68cdd9
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 20 15:30:42 2012 +0100

    modules-load: drop /lib from search path if we don't have it split off

diff --git a/src/modules-load.c b/src/modules-load.c
index 77fe3ea..ff1f690 100644
--- a/src/modules-load.c
+++ b/src/modules-load.c
@@ -58,7 +58,8 @@ int main(int argc, char *argv[]) {
 
         umask(0022);
 
-        if (!(ctx = kmod_new(NULL, NULL))) {
+        ctx = kmod_new(NULL, NULL);
+        if (!ctx) {
                 log_error("Failed to allocate memory for kmod.");
                 goto finish;
         }
@@ -72,7 +73,9 @@ int main(int argc, char *argv[]) {
                             "/run/modules-load.d",
                             "/usr/local/lib/modules-load.d",
                             "/usr/lib/modules-load.d",
+#ifdef HAVE_SPLIT_USR
                             "/lib/modules-load.d",
+#endif
                             NULL) < 0) {
                 log_error("Failed to enumerate modules-load.d files: %s", strerror(-r));
                 goto finish;
@@ -99,7 +102,7 @@ int main(int argc, char *argv[]) {
                         struct kmod_list *itr, *modlist = NULL;
                         int err;
 
-                        if (!(fgets(line, sizeof(line), f)))
+                        if (!fgets(line, sizeof(line), f))
                                 break;
 
                         l = strstrip(line);
@@ -114,7 +117,9 @@ int main(int argc, char *argv[]) {
                         }
 
                         kmod_list_foreach(itr, modlist) {
-                                struct kmod_module *mod = kmod_module_get_module(itr);
+                                struct kmod_module *mod;
+
+                                mod = kmod_module_get_module(itr);
                                 err = kmod_module_probe_insert_module(mod, probe_flags,
                                                                       NULL, NULL, NULL, NULL);
 

commit 133176702a03e5f6264f35c403dd7720d9e05c3f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 20 15:29:49 2012 +0100

    bmfmt: allow passing more than one config file name

diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
index 0e60618..28925ac 100644
--- a/src/binfmt/binfmt.c
+++ b/src/binfmt/binfmt.c
@@ -118,11 +118,6 @@ finish:
 int main(int argc, char *argv[]) {
         int r = 0;
 
-        if (argc > 2) {
-                log_error("This program expects one or no arguments.");
-                return EXIT_FAILURE;
-        }
-
         log_set_target(LOG_TARGET_AUTO);
         log_parse_environment();
         log_open();
@@ -130,25 +125,35 @@ int main(int argc, char *argv[]) {
         umask(0022);
 
         if (argc > 1) {
-                r = apply_file(argv[1], false);
+                int i;
+
+                for (i = 1; i < argc; i++) {
+                        int k;
+
+                        k = apply_file(argv[1], false);
+                        if (k < 0 && r == 0)
+                                r = k;
+                }
         } else {
                 char **files, **f;
 
-                /* Flush out all rules */
-                write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1");
-
                 r = conf_files_list(&files, ".conf",
                                     "/etc/binfmt.d",
                                     "/run/binfmt.d",
                                     "/usr/local/lib/binfmt.d",
                                     "/usr/lib/binfmt.d",
+#ifdef HAVE_SPLIT_USR
+                                    "/lib/binfmt.d",
+#endif
                                     NULL);
-
                 if (r < 0) {
                         log_error("Failed to enumerate binfmt.d files: %s", strerror(-r));
                         goto finish;
                 }
 
+                /* Flush out all rules */
+                write_one_line_file("/proc/sys/fs/binfmt_misc/status", "-1");
+
                 STRV_FOREACH(f, files) {
                         int k;
 

commit bd08f2422491169e92dc0899d5ba848fcae4c15c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Mar 20 15:28:35 2012 +0100

    man: fix parameter name for sd_uid_xxx()

diff --git a/TODO b/TODO
index d33ae7f..3e11f70 100644
--- a/TODO
+++ b/TODO
@@ -18,6 +18,10 @@ Bugfixes:
 
 Features:
 
+* show getty in container mode, not sulogin
+
+* support container_ttys=
+
 * journald: make configurable "store-on-var", "store-on-run", "dont-store", "auto"
   (store-persistent, store-volatile?)
 
diff --git a/man/sd_uid_get_state.xml b/man/sd_uid_get_state.xml
index 6777625..9249021 100644
--- a/man/sd_uid_get_state.xml
+++ b/man/sd_uid_get_state.xml
@@ -56,27 +56,27 @@
 
                         <funcprototype>
                                 <funcdef>int <function>sd_uid_get_state</function></funcdef>
-                                <paramdef>uid_t <parameter>pid</parameter></paramdef>
+                                <paramdef>uid_t <parameter>uid</parameter></paramdef>
                                 <paramdef>char** <parameter>state</parameter></paramdef>
                         </funcprototype>
 
                         <funcprototype>
                                 <funcdef>int <function>sd_uid_is_on_seat</function></funcdef>
-                                <paramdef>uid_t <parameter>pid</parameter></paramdef>
+                                <paramdef>uid_t <parameter>uid</parameter></paramdef>
                                 <paramdef>int <parameter>require_active</parameter></paramdef>
                                 <paramdef>const char* <parameter>seat</parameter></paramdef>
                         </funcprototype>
 
                         <funcprototype>
                                 <funcdef>int <function>sd_uid_get_sessions</function></funcdef>
-                                <paramdef>uid_t <parameter>pid</parameter></paramdef>
+                                <paramdef>uid_t <parameter>uid</parameter></paramdef>
                                 <paramdef>int <parameter>require_active</parameter></paramdef>
                                 <paramdef>char*** <parameter>sessions</parameter></paramdef>
                         </funcprototype>
 
                         <funcprototype>
                                 <funcdef>int <function>sd_uid_get_seats</function></funcdef>
-                                <paramdef>uid_t <parameter>pid</parameter></paramdef>
+                                <paramdef>uid_t <parameter>uid</parameter></paramdef>
                                 <paramdef>int <parameter>require_active</parameter></paramdef>
                                 <paramdef>char*** <parameter>seats</parameter></paramdef>
                         </funcprototype>



More information about the systemd-commits mailing list