]> git.proxmox.com Git - systemd.git/commitdiff
Cherry-pick upstream fixes to make sd_session_get_vt() actually work.
authorMichael Biebl <biebl@debian.org>
Tue, 24 Jun 2014 15:44:20 +0000 (17:44 +0200)
committerMichael Biebl <biebl@debian.org>
Tue, 24 Jun 2014 15:44:20 +0000 (17:44 +0200)
debian/changelog
debian/patches/login-fix-invalid-free-in-sd_session_get_vt.patch [new file with mode: 0644]
debian/patches/login-make-sd_session_get_vt-actually-work.patch [new file with mode: 0644]
debian/patches/series

index 5fc3f4d04fdafc75dea3e0d0b354c402d5792d1a..66b42bc194d71dca30808381ad6ceac2157cba9b 100644 (file)
@@ -10,6 +10,7 @@ systemd (208-2) UNRELEASED; urgency=medium
 
   [ Michael Biebl ]
   * Merge changes from unstable branch.
+  * Cherry-pick upstream fixes to make sd_session_get_vt() actually work.
 
  -- Sjoerd Simons <sjoerd@debian.org>  Tue, 29 Apr 2014 08:51:39 +0200
 
diff --git a/debian/patches/login-fix-invalid-free-in-sd_session_get_vt.patch b/debian/patches/login-fix-invalid-free-in-sd_session_get_vt.patch
new file mode 100644 (file)
index 0000000..cca4615
--- /dev/null
@@ -0,0 +1,23 @@
+From: David Herrmann <dh.herrmann@gmail.com>
+Date: Thu, 10 Oct 2013 13:09:37 +0200
+Subject: 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.
+---
+ src/login/sd-login.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/login/sd-login.c b/src/login/sd-login.c
+index 9bfe43c..7e25041 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;
diff --git a/debian/patches/login-make-sd_session_get_vt-actually-work.patch b/debian/patches/login-make-sd_session_get_vt-actually-work.patch
new file mode 100644 (file)
index 0000000..8271e2a
--- /dev/null
@@ -0,0 +1,23 @@
+From: David Herrmann <dh.herrmann@gmail.com>
+Date: Thu, 10 Oct 2013 13:11:27 +0200
+Subject: 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.
+---
+ src/login/sd-login.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/login/sd-login.c b/src/login/sd-login.c
+index 71d8c29..9bfe43c 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;
index 24bfa6b5b33e172efb926f647ae07020a96ec871..8ae35cd85cbf3a816d5df458849e71e09d4c9c5b 100644 (file)
@@ -44,3 +44,5 @@ Check-for-kmod-binary.patch
 Adjust-systemd-user-pam-config-file-for-Debian.patch
 login-Don-t-stop-a-running-user-manager-from-garbage.patch
 Add-run-initctl-support-to-SysV-compat-tools.patch
+login-make-sd_session_get_vt-actually-work.patch
+login-fix-invalid-free-in-sd_session_get_vt.patch