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
9f15e86a
Commit
9f15e86a
authored
Feb 28, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-download: Fix in_userns again
The use of a subshell was causing various failures, re-arrange not to use one. Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
b707e368
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lxc-download.in
templates/lxc-download.in
+5
-4
No files found.
templates/lxc-download.in
View file @
9f15e86a
...
@@ -142,10 +142,11 @@ gpg_validate() {
...
@@ -142,10 +142,11 @@ gpg_validate() {
in_userns
()
{
in_userns
()
{
[
-e
/proc/self/uid_map
]
||
{
echo
no
;
return
;
}
[
-e
/proc/self/uid_map
]
||
{
echo
no
;
return
;
}
awk
'{ print $1 " " $2 " " $3 }'
/proc/self/uid_map |
while
read
line
;
do
while
read
line
;
do
[
"
$line
"
=
"0 0 4294967295"
]
&&
{
echo
no
;
return
;
}
||
true
fields
=
$(
echo
$line
|
awk
'{ print $1 " " $2 " " $3 }'
)
echo
$line
|
grep
-q
" 0 1$"
&&
{
echo
userns-root
;
return
;
}
||
true
[
"
$fields
"
=
"0 0 4294967295"
]
&&
{
echo
no
;
return
;
}
||
true
done
echo
$fields
|
grep
-q
" 0 1$"
&&
{
echo
userns-root
;
return
;
}
||
true
done
< /proc/self/uid_map
[
"
$(
cat
/proc/self/uid_map
)
"
=
"
$(
cat
/proc/1/uid_map
)
"
]
&&
\
[
"
$(
cat
/proc/self/uid_map
)
"
=
"
$(
cat
/proc/1/uid_map
)
"
]
&&
\
{
echo
userns-root
;
return
;
}
{
echo
userns-root
;
return
;
}
...
...
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