Merge pull request #668 from skuhl/use-pty-warning

Improve error message when sudo's use_pty option is enabled.
This commit is contained in:
Brian May 2021-07-30 07:54:57 +10:00 committed by GitHub
commit d3fae535cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,14 @@ def setup_daemon():
# ctrl-c shouldn't be passed along to me. When the main sshuttle dies,
# I'll die automatically.
os.setsid()
try:
os.setsid()
except OSError:
raise Fatal("setsid() failed. This may occur if you are using sudo's "
"use_pty option. sshuttle does not currently work with "
"this option. An imperfect workaround: Run the sshuttle "
"command with sudo instead of running it as a regular "
"user and entering the sudo password when prompted.")
# because of limitations of the 'su' command, the *real* stdin/stdout
# are both attached to stdout initially. Clone stdout into stdin so we