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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
slapos.core
Commits
24b2e6e3
Commit
24b2e6e3
authored
6 years ago
by
Guillaume Hervier
Committed by
Rafael Monnerat
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portredir: Don't run socat as root if not needed (port >= 1024)
parent
c53046b3
No related merge requests found
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
()
...
...
This diff is collapsed.
Click to expand it.
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