Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8e24d035
Commit
8e24d035
authored
Oct 20, 2011
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #9168: now smtpd is able to bind privileged port.
parent
b1ae0ab0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
Lib/smtpd.py
Lib/smtpd.py
+10
-10
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/smtpd.py
View file @
8e24d035
...
...
@@ -524,6 +524,16 @@ def parseargs():
if
__name__
==
'__main__'
:
options
=
parseargs
()
# Become nobody
classname
=
options
.
classname
if
"."
in
classname
:
lastdot
=
classname
.
rfind
(
"."
)
mod
=
__import__
(
classname
[:
lastdot
],
globals
(),
locals
(),
[
""
])
classname
=
classname
[
lastdot
+
1
:]
else
:
import
__main__
as
mod
class_
=
getattr
(
mod
,
classname
)
proxy
=
class_
((
options
.
localhost
,
options
.
localport
),
(
options
.
remotehost
,
options
.
remoteport
))
if
options
.
setuid
:
try
:
import
pwd
...
...
@@ -539,16 +549,6 @@ if __name__ == '__main__':
print
>>
sys
.
stderr
,
\
'Cannot setuid "nobody"; try running with -n option.'
sys
.
exit
(
1
)
classname
=
options
.
classname
if
"."
in
classname
:
lastdot
=
classname
.
rfind
(
"."
)
mod
=
__import__
(
classname
[:
lastdot
],
globals
(),
locals
(),
[
""
])
classname
=
classname
[
lastdot
+
1
:]
else
:
import
__main__
as
mod
class_
=
getattr
(
mod
,
classname
)
proxy
=
class_
((
options
.
localhost
,
options
.
localport
),
(
options
.
remotehost
,
options
.
remoteport
))
try
:
asyncore
.
loop
()
except
KeyboardInterrupt
:
...
...
Misc/NEWS
View file @
8e24d035
...
...
@@ -66,6 +66,8 @@ Core and Builtins
Library
-------
-
Issue
#
9168
:
now
smtpd
is
able
to
bind
privileged
port
.
-
Issue
#
12529
:
fix
cgi
.
parse_header
issue
on
strings
with
double
-
quotes
and
semicolons
together
.
Patch
by
Ben
Darnell
and
Petri
Lehtinen
.
...
...
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