Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
24b2e6e3
Commit
24b2e6e3
authored
Jun 15, 2018
by
Guillaume Hervier
Committed by
Rafael Monnerat
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portredir: Don't run socat as root if not needed (port >= 1024)
parent
c53046b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
slapos/manager/portredir.py
slapos/manager/portredir.py
+6
-1
No files found.
slapos/manager/portredir.py
View file @
24b2e6e3
...
...
@@ -103,7 +103,11 @@ class Manager(object):
socat_dest
=
'{}:{}:{}'
.
format
(
socat_dest_type
,
dest_addr
,
dest_port
)
command
.
append
(
socat_dest
)
# If source port >= 1024, we don't need to run as root
as_user
=
source_port
>=
1024
socat_programs
.
append
({
'as_user'
:
as_user
,
'command'
:
' '
.
join
(
command
),
'name'
:
'socat-{}'
.
format
(
source_port
),
})
...
...
@@ -116,7 +120,8 @@ class Manager(object):
for
program
in
socat_programs
])
for
program
in
socat_programs
:
partition
.
addProgramToGroup
(
group_id
,
program
[
'name'
],
program
[
'name'
],
program
[
'command'
],
as_user
=
False
)
program
[
'command'
],
as_user
=
program
[
'as_user'
])
partition
.
writeSupervisorConfigurationFile
()
...
...
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