Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha File System and Upgraded FTP #382

Merged
merged 26 commits into from Aug 9, 2018
Merged
Changes from 4 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -95,6 +95,7 @@ def setup_logging(log_file, verbose):
root_logger.addHandler(file_log)


# fixme: drop privs need sudo user. Figure alternatives.
def drop_privileges(uid_name=None, gid_name=None):
if uid_name is None:
uid_name = 'nobody'
@@ -187,6 +188,27 @@ def main():
core_interface.config = ConfigParser(os.environ)
config = core_interface.config

if os.getuid() == 0:
if not args.force:
logger.critical("Can't start conpot with root. Please ref user docs for more info.")
sys.exit(3)
else:
logger.warning('Running conpot with root. Running conpot with root isn\'t recommended. ')

try:
# retrieve user to run as
conpot_user = config.get('daemon', 'user')
except (NoSectionError, NoOptionError):
conpot_user = None

try:
# retrieve group to run as
conpot_group = config.get('daemon', 'group')
except (NoSectionError, NoOptionError):
conpot_group = None
# FIXME: drop privs require sudo
# drop_privileges(conpot_user, conpot_group)

if os.getuid() == 0:
logger.critical("Can't start conpot with root. Please ref user docs for more info.")
sys.exit(3)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.