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
afb9722c
Unverified
Commit
afb9722c
authored
Dec 09, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file_utils: use O_NOCTTY | O_NOFOLLOW
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
1d409427
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
file_utils.c
src/lxc/file_utils.c
+3
-2
No files found.
src/lxc/file_utils.c
View file @
afb9722c
...
@@ -44,7 +44,8 @@ int lxc_writeat(int dirfd, const char *filename, const void *buf, size_t count)
...
@@ -44,7 +44,8 @@ int lxc_writeat(int dirfd, const char *filename, const void *buf, size_t count)
__do_close_prot_errno
int
fd
=
-
EBADF
;
__do_close_prot_errno
int
fd
=
-
EBADF
;
ssize_t
ret
;
ssize_t
ret
;
fd
=
openat
(
dirfd
,
filename
,
O_WRONLY
|
O_CLOEXEC
);
fd
=
openat
(
dirfd
,
filename
,
O_WRONLY
|
O_CLOEXEC
|
O_NOCTTY
|
O_NOFOLLOW
);
if
(
fd
<
0
)
if
(
fd
<
0
)
return
-
1
;
return
-
1
;
...
@@ -60,7 +61,7 @@ int lxc_write_openat(const char *dir, const char *filename, const void *buf,
...
@@ -60,7 +61,7 @@ int lxc_write_openat(const char *dir, const char *filename, const void *buf,
{
{
__do_close_prot_errno
int
dirfd
=
-
EBADF
;
__do_close_prot_errno
int
dirfd
=
-
EBADF
;
dirfd
=
open
(
dir
,
O_DIRECTORY
|
O_RDONLY
|
O_CLOEXEC
);
dirfd
=
open
(
dir
,
O_DIRECTORY
|
O_RDONLY
|
O_CLOEXEC
|
O_NOCTTY
|
O_NOFOLLOW
);
if
(
dirfd
<
0
)
if
(
dirfd
<
0
)
return
-
1
;
return
-
1
;
...
...
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