Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NetworkManager-l2tp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CeRiAl
NetworkManager-l2tp
Commits
54980923
Commit
54980923
authored
Nov 19, 2014
by
Nathan Dorfman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipsec: secrets shouldn't be world-readable
parent
79fd238a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
nm-l2tp-service.c
src/nm-l2tp-service.c
+7
-1
No files found.
src/nm-l2tp-service.c
View file @
54980923
...
...
@@ -887,6 +887,7 @@ nm_l2tp_start_ipsec(NML2tpPlugin *plugin,
char
cmd1
[
4096
],
cmd11
[
4096
],
cmd2
[
4096
];
char
session_name
[
128
];
guint
sys
=
0
;
int
fd
;
FILE
*
fp
;
if
(
!
(
ipsec_binary
=
nm_find_ipsec
()))
{
...
...
@@ -935,7 +936,11 @@ nm_l2tp_start_ipsec(NML2tpPlugin *plugin,
return
FALSE
;
}
if
(
!
(
fp
=
fopen
(
"/etc/ipsec.secrets"
,
"w"
)))
{
fp
=
NULL
;
if
((
fd
=
open
(
"/etc/ipsec.secrets"
,
O_CREAT
|
O_EXCL
|
O_WRONLY
,
0600
))
>=
0
)
{
if
(
NULL
==
(
fp
=
fdopen
(
fd
,
"w"
)))
close
(
fd
);
}
if
(
NULL
==
fp
)
{
rename
(
tmp_secrets
,
"/etc/ipsec.secrets"
);
g_set_error
(
error
,
NM_VPN_PLUGIN_ERROR
,
...
...
@@ -954,6 +959,7 @@ nm_l2tp_start_ipsec(NML2tpPlugin *plugin,
if
(
!
value
)
value
=
""
;
fprintf
(
fp
,
": PSK
\"
%s
\"\n
"
,
value
);
fclose
(
fp
);
close
(
fd
);
sys
+=
system
(
"PATH=
\"
/sbin:/usr/sbin:/usr/local/sbin:$PATH
\"
ipsec secrets"
);
sys
+=
system
(
cmd11
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment