1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-12-23 00:25:18 +00:00

Fixes for testing server as regular user

This commit is contained in:
Lauri Võsandi 2017-01-26 15:11:04 +02:00
parent dc9e01b4ad
commit ef72cb70cd
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,6 @@
import click import click
import falcon import falcon
import kerberos # If this fails pip install kerberos
import logging import logging
import os import os
import re import re
@ -13,6 +12,7 @@ from certidude import config, const
logger = logging.getLogger("api") logger = logging.getLogger("api")
if "kerberos" in config.AUTHENTICATION_BACKENDS: if "kerberos" in config.AUTHENTICATION_BACKENDS:
import kerberos # If this fails pip install kerberos
ktname = os.getenv("KRB5_KTNAME") ktname = os.getenv("KRB5_KTNAME")
if not ktname: if not ktname:

View File

@ -1174,6 +1174,7 @@ def certidude_serve(port, listen):
from certidude import config from certidude import config
# Fetch UID, GID of certidude user # Fetch UID, GID of certidude user
if os.getuid() == 0:
import pwd import pwd
_, _, uid, gid, gecos, root, shell = pwd.getpwnam("certidude") _, _, uid, gid, gecos, root, shell = pwd.getpwnam("certidude")
restricted_groups = [] restricted_groups = []