Merge branch 'principals-with-host'

This commit is contained in:
Jakobus Schürz 2019-10-29 11:25:50 +01:00
commit b005b18e89
3 changed files with 2 additions and 9 deletions

View file

@ -22,7 +22,7 @@ def serve_principal(cfg, sshUser, principals):
+'no-X11-forwarding,no-agent-forwarding,no-pty %(principals)s')
for p in util.getAllowedSSHPrincipals(config=cfg).split() :
print TEMPLATE % dict(user=sshUser, principals=p)
print TEMPLATE % dict(user=sshUser.partition('@')[0], principals=p)
class Main(app.App):
def create_parser(self):
@ -46,10 +46,3 @@ class Main(app.App):
#log.debug('serve_principal: %s', serve_principal(cfg, sshUser, principals))
serve_principal(cfg, sshUser, principals)
log.info('Done.')
#
# if hook == 'post-update':
# log.info('Running hook %s', hook)
# post_update(cfg, git_dir)
# log.info('Done.')
# else:
# log.warning('Ignoring unknown hook: %r', hook)

View file

@ -66,7 +66,6 @@ class Main(app.App):
os.umask(0022)
git_dir = os.environ.get('GIT_DIR')
print type(git_dir)
if git_dir is None:
log.error('Must have GIT_DIR set in enviroment')
sys.exit(1)

View file

@ -62,6 +62,7 @@ def filterAuthorizedKeys(fp):
def writeAuthorizedKeys(path, keydir):
tmp = '%s.%d.tmp' % (path, os.getpid())
log.debug("writeAuthorizedKeys " + str(tmp) )
try:
in_ = file(path)
except IOError, e: