Yair Zaslavsky has uploaded a new change for review. Change subject: aaa: Fix KerberosLdapDirectory domain name usage ......................................................................
aaa: Fix KerberosLdapDirectory domain name usage Change-Id: I6ccc8824257d29189377d7dc55facdeca5f20ad5 Topic: AAA Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java M backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/kerberosldap/KerberosLdapDirectory.java 2 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/57/25757/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java index 187ba59..07ce7d3 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/LoginBaseCommand.java @@ -229,7 +229,7 @@ // Check that the user exists in the database, if it doesn't exist then we need to add it now: - dbUser = getDbUserDAO().getByExternalId(directory.getName(), directoryUser.getId()); + dbUser = getDbUserDAO().getByExternalId(directory.getProfileName(), directoryUser.getId()); if (dbUser == null) { dbUser = new DbUser(directoryUser); dbUser.setId(Guid.newGuid()); diff --git a/backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/kerberosldap/KerberosLdapDirectory.java b/backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/kerberosldap/KerberosLdapDirectory.java index a0dbcf3..b77f9f0 100644 --- a/backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/kerberosldap/KerberosLdapDirectory.java +++ b/backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/kerberosldap/KerberosLdapDirectory.java @@ -50,7 +50,7 @@ // Find the user with the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.GetAdUserByUserId, - new LdapSearchByIdParameters(getName(), id) + new LdapSearchByIdParameters(getProfileName(), id) ); LdapUser ldapUser = (LdapUser) ldapResult.getReturnValue(); @@ -63,7 +63,7 @@ // Find the user with the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.GetAdUserByUserName, - new LdapSearchByUserNameParameters(null, getName(), name) + new LdapSearchByUserNameParameters(null, getProfileName(), name) ); LdapUser ldapUser = (LdapUser) ldapResult.getReturnValue(); if (ldapUser == null) { @@ -79,7 +79,7 @@ // Find the users using the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.GetAdUserByUserIdList, - new LdapSearchByUserIdListParameters(getName(), ids, false) + new LdapSearchByUserIdListParameters(getProfileName(), ids, false) ); @SuppressWarnings("unchecked") List<LdapUser> ldapUsers = (List<LdapUser>) ldapResult.getReturnValue(); @@ -97,7 +97,7 @@ // Find the users using the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.SearchUserByQuery, - new LdapSearchByQueryParameters(null, getName(), queryData) + new LdapSearchByQueryParameters(null, getProfileName(), queryData) ); List<LdapUser> ldapUsers = (List<LdapUser>) ldapResult.getReturnValue(); return mapUsers(ldapUsers); @@ -115,7 +115,7 @@ } // Create the directory user and populate the basic attributes: - DirectoryUser directoryUser = new DirectoryUser(this.getName(), ldapUser.getUserId(), name); + DirectoryUser directoryUser = new DirectoryUser(this.getProfileName(), ldapUser.getUserId(), name); directoryUser.setFirstName(ldapUser.getName()); directoryUser.setLastName(ldapUser.getSurName()); directoryUser.setDepartment(ldapUser.getDepartment()); @@ -125,12 +125,12 @@ // Populate the groups of the user (note that as we a calling a method of this directory to do so we should // first locate it using the manager, calling the method directory would bypass any decorator that may put on // top of the directory): - Directory directory = AuthenticationProfileRepository.getInstance().getDirectory(getName()); + Directory directory = AuthenticationProfileRepository.getInstance().getDirectory(getProfileName()); if (directory == null) { log.warnFormat( "Can't find domain \"{0}\" to retrieve groups for user \"{1}\", the groups and related permissions " + "won't be available.", - getName(), + getProfileName(), ldapUser.getUserId() ); } @@ -174,7 +174,7 @@ // Find the group using the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.GetAdGroupByGroupId, - new LdapSearchByIdParameters(getName(), id) + new LdapSearchByIdParameters(getProfileName(), id) ); LdapGroup ldapGroup = (LdapGroup) ldapResult.getReturnValue(); @@ -191,7 +191,7 @@ // Find the users using the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.SearchGroupsByQuery, - new LdapSearchByQueryParameters(null, getName(), queryData) + new LdapSearchByQueryParameters(null, getProfileName(), queryData) ); List<LdapGroup> ldapGroups = (List<LdapGroup>) ldapResult.getReturnValue(); return mapGroups(ldapGroups); @@ -202,7 +202,7 @@ // Find the groups using the old mechanism: LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.SearchGroupsByQuery, - new LdapSearchByQueryParameters(null, getName(), data) + new LdapSearchByQueryParameters(null, getProfileName(), data) ); List<LdapGroup> ldapGroups = (List<LdapGroup>) ldapResult.getReturnValue(); @@ -214,7 +214,7 @@ * Transforms a LDAP group into a directory group. */ private DirectoryGroup mapGroup(LdapGroup ldapGroup) { - return new DirectoryGroup(this.getName(), ldapGroup.getid(), ldapGroup.getname()); + return new DirectoryGroup(this.getProfileName(), ldapGroup.getid(), ldapGroup.getname()); } /** -- To view, visit http://gerrit.ovirt.org/25757 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ccc8824257d29189377d7dc55facdeca5f20ad5 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches