Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
00dbc43e
Commit
00dbc43e
authored
Jul 20, 2010
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix console overwrite any file
Prevent to specify a file not belonging to us as the output for the console Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
28f602ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
console.c
src/lxc/console.c
+6
-5
No files found.
src/lxc/console.c
View file @
00dbc43e
...
...
@@ -30,10 +30,10 @@
#include <sys/types.h>
#include <sys/un.h>
#include
<lxc/log.h>
#include
<lxc/conf.h>
#include
<lxc/start.h>
/* for struct lxc_handler */
#include
"log.h"
#include
"conf.h"
#include
"start.h"
/* for struct lxc_handler */
#include "caps.h"
#include "commands.h"
#include "mainloop.h"
#include "af_unix.h"
...
...
@@ -192,7 +192,8 @@ int lxc_create_console(struct lxc_conf *conf)
goto
err
;
}
fd
=
open
(
console
->
path
,
O_CLOEXEC
|
O_RDWR
|
O_CREAT
|
O_APPEND
,
0600
);
fd
=
lxc_unpriv
(
open
(
console
->
path
,
O_CLOEXEC
|
O_RDWR
|
O_CREAT
|
O_APPEND
,
0600
));
if
(
fd
<
0
)
{
SYSERROR
(
"failed to open '%s'"
,
console
->
path
);
goto
err
;
...
...
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