| |
@@ -578,11 +578,11 @@
|
| |
#for compatibility
|
| |
return self.host_id
|
| |
|
| |
- def getUserIdFromKerberos(self, krb_principal):
|
| |
- """Return the user ID associated with a particular Kerberos principal.
|
| |
- If no user with the given princpal if found, return None."""
|
| |
+ def getUserIdFromKerberos(self, username):
|
| |
+ """Return the user ID associated with a particular username or Kerberos
|
| |
+ principal. If no user with the given princpal if found, return None."""
|
| |
c = context.cnx.cursor()
|
| |
- q = """SELECT id FROM users WHERE krb_principal = %(krb_principal)s"""
|
| |
+ q = """SELECT id FROM users WHERE krb_principal = %(username)s or name = %(username)s"""
|
| |
c.execute(q, locals())
|
| |
r = c.fetchone()
|
| |
c.close()
|
| |
Currently, krb would expect a krb principal where ssl expects a username.
This makes krb use the username, but also accept the krb_principal for
backwards compatibility.
Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com