summaryrefslogtreecommitdiff
path: root/debian/patches/better_systemd_detection.patch
blob: 0270075778db30731bf838312e94b17ac8b2ba48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Improved systemd detection for password prompt
Author: Martin Pitt <martinpitt@gnome.org>
Bug-Debian: http://bugs.debian.org/747265
Bug: https://community.openvpn.net/openvpn/ticket/274
Origin: upstream, https://community.openvpn.net/openvpn/attachment/ticket/274/0001-Update-systemd-check-to-current-upstream-version.patch
Index: openvpn/src/openvpn/console.c
===================================================================
--- openvpn.orig/src/openvpn/console.c	2012-11-05 16:29:30.000000000 +0100
+++ openvpn/src/openvpn/console.c	2014-05-14 13:00:24.253185771 +0200
@@ -145,13 +145,8 @@
 {
   struct stat a, b;
 
-  /* We simply test whether the systemd cgroup hierarchy is
-   * mounted */
-
-  return (lstat("/sys/fs/cgroup", &a) == 0)
-	  && (lstat("/sys/fs/cgroup/systemd", &b) == 0)
-	  && (a.st_dev != b.st_dev);
-
+  /* mirror what upstream sd_booted() does */
+  return (access("/run/systemd/system", F_OK) >= 0);
 }
 
 static bool