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
74294d76
Unverified
Commit
74294d76
authored
Nov 05, 2020
by
Stéphane Graber
Committed by
GitHub
Nov 05, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3577 from brauner/2020-11-05/bugfixes
attach: silence stdio permission adjust warnings
parents
056b6a60
a2c26bef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
attach.c
src/lxc/attach.c
+1
-1
utils.c
src/lxc/utils.c
+6
-5
No files found.
src/lxc/attach.c
View file @
74294d76
...
...
@@ -883,7 +883,7 @@ static int attach_child_main(struct attach_clone_payload *payload)
/* Make sure that the processes STDIO is correctly owned by the user that we are switching to */
ret
=
fix_stdio_permissions
(
new_uid
);
if
(
ret
)
WARN
(
"Failed to adjust stdio permissions"
);
INFO
(
"Failed to adjust stdio permissions"
);
if
(
!
lxc_switch_uid_gid
(
new_uid
,
new_gid
))
goto
on_error
;
...
...
src/lxc/utils.c
View file @
74294d76
...
...
@@ -1885,11 +1885,11 @@ int fix_stdio_permissions(uid_t uid)
devnull_fd
=
open_devnull
();
if
(
devnull_fd
<
0
)
return
log_
warn
_errno
(
-
1
,
errno
,
"Failed to open
\"
/dev/null
\"
"
);
return
log_
trace
_errno
(
-
1
,
errno
,
"Failed to open
\"
/dev/null
\"
"
);
ret
=
fstat
(
devnull_fd
,
&
st_null
);
if
(
ret
)
return
log_
warn
_errno
(
-
errno
,
errno
,
"Failed to stat
\"
/dev/null
\"
"
);
return
log_
trace
_errno
(
-
errno
,
errno
,
"Failed to stat
\"
/dev/null
\"
"
);
for
(
int
i
=
0
;
i
<
ARRAY_SIZE
(
std_fds
);
i
++
)
{
ret
=
fstat
(
std_fds
[
i
],
&
st
);
...
...
@@ -1904,14 +1904,15 @@ int fix_stdio_permissions(uid_t uid)
ret
=
fchown
(
std_fds
[
i
],
uid
,
st
.
st_gid
);
if
(
ret
)
{
SYSWARN
(
"Failed to chown standard I/O file descriptor %d to uid %d and gid %d"
,
std_fds
[
i
],
uid
,
st
.
st_gid
);
TRACE
(
"Failed to chown standard I/O file descriptor %d to uid %d and gid %d"
,
std_fds
[
i
],
uid
,
st
.
st_gid
);
fret
=
-
1
;
continue
;
}
ret
=
fchmod
(
std_fds
[
i
],
0700
);
if
(
ret
)
{
SYSWARN
(
"Failed to chmod standard I/O file descriptor %d"
,
std_fds
[
i
]);
TRACE
(
"Failed to chmod standard I/O file descriptor %d"
,
std_fds
[
i
]);
fret
=
-
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