0003-change-GetExeDir-to-GetStateDir-in-Cedar-and-Mayaqua.patch
2.71 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
From d68db9f2cee975aad5e07b44485615f3d842ab45 Mon Sep 17 00:00:00 2001
From: Darik Horn <dajhorn@vanadac.com>
Date: Fri, 11 Jul 2014 16:17:18 -0400
Subject: [PATCH] Change GetExeDir to GetStateDir in Cedar and Mayaqua.
Resolve this AppArmor error by ensuring that certificate files files are
written into /var/lib/softether instead of the current working directory:
Profile: /usr/sbin/softetherd
Operation: mkdir
Name: /usr/sbin/chain_certs
Denied: c
Logfile: /var/log/kern.log
type=1400 audit: apparmor="DENIED" operation="mkdir" profile="/usr/sbin/softetherd" name="/usr/sbin/chain_certs/" pid=36448 comm="softetherd" requested_mask="c" denied_mask="c" fsuid=0 ouid=0
Taken from Github
https://github.com/dajhorn/SoftEtherVPN/commit/d68db9f2cee975aad5e07b44485615f3d842ab45.
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
src/Cedar/Protocol.c | 12 ++++++------
src/Mayaqua/Network.c | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
Index: b/src/Cedar/Protocol.c
===================================================================
--- a/src/Cedar/Protocol.c
+++ b/src/Cedar/Protocol.c
@@ -161,10 +161,10 @@
UINT i;
DIRLIST *dir;
wchar_t dirname[MAX_SIZE];
- wchar_t exedir[MAX_SIZE];
+ wchar_t statedir[MAX_SIZE];
- GetExeDirW(exedir, sizeof(exedir));
- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs");
+ GetStateDirW(statedir, sizeof(statedir));
+ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs");
MakeDirExW(dirname);
if (auto_save)
@@ -461,7 +461,7 @@
void AddAllChainCertsToCertList(LIST *o)
{
wchar_t dirname[MAX_SIZE];
- wchar_t exedir[MAX_SIZE];
+ wchar_t statedir[MAX_SIZE];
DIRLIST *dir;
// Validate arguments
if (o == NULL)
@@ -469,9 +469,9 @@
return;
}
- GetExeDirW(exedir, sizeof(exedir));
+ GetStateDirW(statedir, sizeof(statedir));
- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs");
+ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs");
MakeDirExW(dirname);
Index: b/src/Mayaqua/Network.c
===================================================================
--- a/src/Mayaqua/Network.c
+++ b/src/Mayaqua/Network.c
@@ -12588,7 +12588,7 @@
void AddChainSslCertOnDirectory(struct ssl_ctx_st *ctx)
{
wchar_t dirname[MAX_SIZE];
- wchar_t exedir[MAX_SIZE];
+ wchar_t statedir[MAX_SIZE];
wchar_t txtname[MAX_SIZE];
DIRLIST *dir;
LIST *o;
@@ -12602,9 +12602,9 @@
o = NewListFast(NULL);
- GetExeDirW(exedir, sizeof(exedir));
+ GetStateDirW(statedir, sizeof(statedir));
- CombinePathW(dirname, sizeof(dirname), exedir, L"chain_certs");
+ CombinePathW(dirname, sizeof(dirname), statedir, L"chain_certs");
MakeDirExW(dirname);