[systemd-commits] 9 commits - bash-completion/systemd-bash-completion.sh man/logind.conf.xml src/journal src/libudev src/locale src/shared TODO units/console-shell.service.m4.in units/emergency.service.in units/getty at .service.m4 units/serial-getty at .service.m4

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sat Oct 27 17:19:16 PDT 2012


 TODO                                       |    5 +++--
 bash-completion/systemd-bash-completion.sh |    4 ++--
 man/logind.conf.xml                        |    3 ++-
 src/journal/coredumpctl.c                  |    4 ++--
 src/libudev/libudev-hwdb.c                 |    2 +-
 src/locale/localectl.c                     |    7 ++++---
 src/shared/util.c                          |    6 ++++++
 units/console-shell.service.m4.in          |    3 +++
 units/emergency.service.in                 |    2 +-
 units/getty at .service.m4                    |    3 +++
 units/serial-getty at .service.m4             |    3 +++
 11 files changed, 30 insertions(+), 12 deletions(-)

New commits:
commit a8f454e8a387eaf752a64955dcef8cbbae1b77ed
Author: Ramkumar Ramachandra <artagnon at gmail.com>
Date:   Fri Dec 2 22:14:32 2011 +0530

    completion: fix typo in accessing array index
    
    Remove spurious '}'. This error went unnoticed so far because Bash
    doesn't complain.

diff --git a/bash-completion/systemd-bash-completion.sh b/bash-completion/systemd-bash-completion.sh
index d6adfce..38cde3b 100644
--- a/bash-completion/systemd-bash-completion.sh
+++ b/bash-completion/systemd-bash-completion.sh
@@ -122,7 +122,7 @@ _systemctl () {
 
         for ((i=0; $i <= $COMP_CWORD; i++)); do
                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
-                 ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG}]}; then
+                 ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
                         verb=${COMP_WORDS[i]}
                         break
                 fi
@@ -245,7 +245,7 @@ _loginctl () {
 
         for ((i=0; $i <= $COMP_CWORD; i++)); do
                 if __contains_word "${COMP_WORDS[i]}" ${VERBS[*]} &&
-                 ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG}]}; then
+                 ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then
                         verb=${COMP_WORDS[i]}
                         break
                 fi

commit 9c2cd81e0ef9cf45adc6108eaea172d722f39321
Author: Ramkumar Ramachandra <artagnon at gmail.com>
Date:   Fri Dec 2 22:14:31 2011 +0530

    units: teach m4 scripts in units/ about Debian's rc.local
    
    This makes the behaviour wrt. to rc[-.]local consistent between
    various distributions supporting it.

diff --git a/units/console-shell.service.m4.in b/units/console-shell.service.m4.in
index 400f84d..e0fbc61 100644
--- a/units/console-shell.service.m4.in
+++ b/units/console-shell.service.m4.in
@@ -12,6 +12,9 @@ After=systemd-user-sessions.service plymouth-quit-wait.service
 m4_ifdef(`TARGET_FEDORA',
 After=rc-local.service
 )m4_dnl
+m4_ifdef(`TARGET_DEBIAN',
+After=rc.local.service
+)m4_dnl
 m4_ifdef(`TARGET_ARCH',
 After=rc-local.service
 )m4_dnl
diff --git a/units/getty at .service.m4 b/units/getty at .service.m4
index fcf1de1..b5875ce 100644
--- a/units/getty at .service.m4
+++ b/units/getty at .service.m4
@@ -12,6 +12,9 @@ After=systemd-user-sessions.service plymouth-quit-wait.service
 m4_ifdef(`TARGET_FEDORA',
 After=rc-local.service
 )m4_dnl
+m4_ifdef(`TARGET_DEBIAN',
+After=rc.local.service
+)m4_dnl
 m4_ifdef(`TARGET_ARCH',
 After=rc-local.service
 )m4_dnl
diff --git a/units/serial-getty at .service.m4 b/units/serial-getty at .service.m4
index d6a7669..a6bbd71 100644
--- a/units/serial-getty at .service.m4
+++ b/units/serial-getty at .service.m4
@@ -13,6 +13,9 @@ After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
 m4_ifdef(`TARGET_FEDORA',
 After=rc-local.service
 )m4_dnl
+m4_ifdef(`TARGET_DEBIAN',
+After=rc.local.service
+)m4_dnl
 m4_ifdef(`TARGET_ARCH',
 After=rc-local.service
 )m4_dnl

commit f2d433e178df7df01a836e95775261e1d85ec60d
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Oct 28 00:43:44 2012 +0200

    Tweak TODO

diff --git a/TODO b/TODO
index 88cfb4b..270d534 100644
--- a/TODO
+++ b/TODO
@@ -40,9 +40,10 @@ Features:
 
 * link up selected blog stories from man pages?
 
-* journactl: support negative filtering, i.e. FOOBAR!="waldo"
+* journactl: support negative filtering, i.e. FOOBAR!="waldo",
+  and !FOOBAR for events without FOOBAR.
 
-* drop header/footer from systemctl --failed output if there are no entries shown, print nice message instead, and hook that into ExecStartPre of rescue.service/emergency.service
+* print nice message from systemctl --failed if there are no entries shown, and hook that into ExecStartPre of rescue.service/emergency.service
 
 * add libsystemd-password or so to query passwords during boot using the password agent logic
 
diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c
index 92c58b6..a3f815f 100644
--- a/src/libudev/libudev-hwdb.c
+++ b/src/libudev/libudev-hwdb.c
@@ -35,7 +35,7 @@
  * SECTION:libudev-hwdb
  * @short_description: retrieve properties from the hardware database
  *
- * Libuded hardware database interface.
+ * Libudev hardware database interface.
  */
 
 /**

commit 4e84ae7e76a080cb32796912471be1e4285415b1
Author: Thomas Bächler <thomas at archlinux.org>
Date:   Wed Oct 24 21:47:06 2012 +0200

    man/logind.conf.xml: Add missing 'suspend' value for Handle*Key options.

diff --git a/man/logind.conf.xml b/man/logind.conf.xml
index 29469d3..af842b5 100644
--- a/man/logind.conf.xml
+++ b/man/logind.conf.xml
@@ -212,7 +212,8 @@
                                 <literal>reboot</literal>,
                                 <literal>halt</literal>,
                                 <literal>kexec</literal>,
-                                <literal>hibernate</literal> and
+                                <literal>suspend</literal>,
+                                <literal>hibernate</literal>, and
                                 <literal>hybrid-sleep</literal>. If
                                 <literal>ignore</literal> logind will
                                 never handle these keys. Otherwise the

commit 3dd8ee8fa693597663b0338235becbb0b7a9520c
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Thu Oct 25 16:16:17 2012 +0200

    util: fix possible integer overflows

diff --git a/src/shared/util.c b/src/shared/util.c
index 2d4a4c1..e2f8b1f 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -148,6 +148,9 @@ usec_t timespec_load(const struct timespec *ts) {
             ts->tv_nsec == (long) -1)
                 return (usec_t) -1;
 
+        if (USEC_PER_SEC > ((UINT64_MAX - (ts->tv_nsec / NSEC_PER_USEC)) / (usec_t) ts->tv_sec))
+                return (usec_t) -1;
+
         return
                 (usec_t) ts->tv_sec * USEC_PER_SEC +
                 (usec_t) ts->tv_nsec / NSEC_PER_USEC;
@@ -175,6 +178,9 @@ usec_t timeval_load(const struct timeval *tv) {
             tv->tv_usec == (suseconds_t) -1)
                 return (usec_t) -1;
 
+        if (USEC_PER_SEC > (UINT64_MAX - tv->tv_usec) / (usec_t) tv->tv_sec)
+                return (usec_t) -1;
+
         return
                 (usec_t) tv->tv_sec * USEC_PER_SEC +
                 (usec_t) tv->tv_usec;

commit 7ca7021a9e0c443d40d0af5e9a7e1962d8032229
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Fri Oct 26 14:16:18 2012 +0200

    localectl: fix memleak, use _cleanup_strv_free_
    
    l might contain zero strings, however there is still memory
    allocated for NULL terminator, use _cleanup_strv_free_ instead to
    prevent tiny leak in such case.

diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 84feb25..7d3ac0a 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -483,7 +483,8 @@ static int nftw_cb(
 }
 
 static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
-        char **l, **i;
+        char _cleanup_strv_free_ **l = NULL;
+        char **i;
 
         keymaps = set_new(string_hash_func, string_compare_func);
         if (!keymaps)
@@ -513,7 +514,6 @@ static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
         STRV_FOREACH(i, l)
                 puts(*i);
 
-        strv_free(l);
 
         return 0;
 }

commit 2f7a4867babd3fd382e5495f21724358f30fa67d
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Fri Oct 26 14:15:00 2012 +0200

    localectl: fix memleak, jump to finish before returning

diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index c05eba0..84feb25 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -354,7 +354,8 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
             h->locrectab_offset + h->locrectab_size > st.st_size ||
             h->sumhash_offset + h->sumhash_size > st.st_size) {
                 log_error("Invalid archive file.");
-                return -EBADMSG;
+                r = -EBADMSG;
+                goto finish;
         }
 
         e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset);

commit 4a207bb2a5eca181209ca273c76e32bcc90c99c8
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Fri Oct 26 14:11:37 2012 +0200

    journal: fix memleak, call set_free before return

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 5b494e3..311c18b 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -60,7 +60,7 @@ static Set *new_matches(void) {
         tmp = strdup("MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1");
         if (!tmp) {
                 log_oom();
-                set_clear_free(set);
+                set_free(set);
                 return NULL;
         }
 
@@ -68,7 +68,7 @@ static Set *new_matches(void) {
         if (r < 0) {
                 log_error("failed to add to set: %s", strerror(-r));
                 free(tmp);
-                set_clear_free(set);
+                set_free(set);
                 return NULL;
         }
 

commit aa6eba407be2c23882bf41a1beafbbd1352f7ab3
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Oct 23 16:32:12 2012 +0200

    units: reword rescue mode hints
    
    Do not suggest to the user that commands can be issued before
    logging in.
    
    sulogin prints it own message, which mentions ^D, so there's no need
    to repeat it here.

diff --git a/units/emergency.service.in b/units/emergency.service.in
index 1815f9d..129a831 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -16,7 +16,7 @@ Before=shutdown.target
 Environment=HOME=/root
 WorkingDirectory=/root
 ExecStartPre=-/bin/plymouth quit
-ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -b" to view system logs. Type "systemctl reboot" to reboot.'
+ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -b" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
 ExecStart=-/sbin/sulogin
 ExecStopPost=@SYSTEMCTL@ --fail --no-block default
 Type=idle



More information about the systemd-commits mailing list