[systemd-commits] 2 commits - src/login

David Herrmann dvdhrm at kemper.freedesktop.org
Thu Oct 10 04:14:50 PDT 2013


 src/login/sd-login.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0581dac2c146cef0f55841a4c136dc48409c8eaa
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Thu Oct 10 13:11:27 2013 +0200

    login: make sd_session_get_vt() actually work
    
    We use VTNR, not VTNr as key. Until now sd_session_get_vt() just returns
    an error.

diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index 6c27dfe..7e25041 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -354,7 +354,7 @@ _public_ int sd_session_get_vt(const char *session, unsigned *vtnr) {
         unsigned u;
         int r;
 
-        r = session_get_string(session, "VTNr", &vtnr_string);
+        r = session_get_string(session, "VTNR", &vtnr_string);
         if (r < 0)
                 return r;
 

commit 3f4fee033bf0f623de74f3e8a14c42b8ff81c36e
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Thu Oct 10 13:09:37 2013 +0200

    login: fix invalid free() in sd_session_get_vt()
    
    We need to clear variables markes as _cleanup_free_. Otherwise, our
    error-paths might corrupt random memory.

diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index 71d8c29..6c27dfe 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -350,7 +350,7 @@ _public_ int sd_session_get_tty(const char *session, char **tty) {
 }
 
 _public_ int sd_session_get_vt(const char *session, unsigned *vtnr) {
-        _cleanup_free_ char *vtnr_string;
+        _cleanup_free_ char *vtnr_string = NULL;
         unsigned u;
         int r;
 



More information about the systemd-commits mailing list