Ejemplo n.º 1
0
def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        # gitolite alike: user.pub = [email protected], but user.pub != [email protected]
        if user.rfind("@") > user.rfind("."):
            user = user.rsplit("@", 1)[0]
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))
Ejemplo n.º 2
0
def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        # gitolite alike: user.pub = [email protected], but user.pub != [email protected]
        if user.rfind('@') > user.rfind('.'):
            user = user.rsplit('@', 1)[0]
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))
Ejemplo n.º 3
0
def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))
Ejemplo n.º 4
0
def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))