You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

no-setuid-servers.patch 1.3 kB

123456789101112131415161718192021222324252627282930313233343536
  1. diff -uNr Python-3.9.2/Lib/http/server.py Python-3.9.2.mod/Lib/http/server.py
  2. --- Python-3.9.2/Lib/http/server.py 2021-02-19 14:31:44.000000000 +0200
  3. +++ Python-3.9.2.mod/Lib/http/server.py 2021-03-20 16:08:34.173543081 +0200
  4. @@ -1165,10 +1165,6 @@
  5. return
  6. # Child
  7. try:
  8. - try:
  9. - os.setuid(nobody)
  10. - except OSError:
  11. - pass
  12. os.dup2(self.rfile.fileno(), 0)
  13. os.dup2(self.wfile.fileno(), 1)
  14. os.execve(scriptfile, args, env)
  15. diff -uNr Python-3.9.2/Lib/smtpd.py Python-3.9.2.mod/Lib/smtpd.py
  16. --- Python-3.9.2/Lib/smtpd.py 2021-02-19 14:31:44.000000000 +0200
  17. +++ Python-3.9.2.mod/Lib/smtpd.py 2021-03-20 16:11:48.785629393 +0200
  18. @@ -9,7 +9,8 @@
  19. -n
  20. This program generally tries to setuid `nobody', unless this flag is
  21. set. The setuid call will fail if this program is not run as root (in
  22. - which case, use this flag).
  23. + which case, use this flag). Ignored in Termux as no setuid done on this
  24. + platform.
  25. --version
  26. -V
  27. @@ -863,7 +864,7 @@
  28. class Options:
  29. - setuid = True
  30. + setuid = False
  31. classname = 'PureProxy'
  32. size_limit = None
  33. enable_SMTPUTF8 = False