Skip to content

Commit

Permalink
fix: Crash on sudo telepresence
Browse files Browse the repository at this point in the history
this is a fix for telepresenceio#460

Signed-off-by: rohan47 <rohanrgupta1996@gmail.com>
  • Loading branch information
rohan47 committed Aug 30, 2018
1 parent 6344ffd commit d95abbc
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions telepresence/startup.py
Expand Up @@ -14,6 +14,7 @@

import ssl
import sys
import os

import json
from subprocess import CalledProcessError, STDOUT
Expand Down Expand Up @@ -89,11 +90,16 @@ def __init__(self, runner: Runner, args) -> None:
stderr=STDOUT,
)
except CalledProcessError:
raise runner.fail(
"No current-context set. "
"Please use the --context option to explicitly set the "
"context."
)
if os.geteuid() == 0:
raise runner.fail(
"Sudo user detected. Please run without using sudo."
)
else:
raise runner.fail(
"No current-context set. "
"Please use the --context option to explicitly set the "
"context."
)
self.context = args.context

# Figure out explicit namespace if its not specified, and the server
Expand Down

0 comments on commit d95abbc

Please sign in to comment.