You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sw...@apache.org on 2016/05/04 14:23:51 UTC
[1/4] git commit: updated refs/heads/master to c7d1b81
Repository: cloudstack
Updated Branches:
refs/heads/master 4d57ec04a -> c7d1b8142
Set default networkDomain to empty instead of username
The 10th field of createUserAccount is 'networkDomain' (AccountService.java) and it is set to a var named 'admin', which is the user name.
So, the first user that is created in a domain that links to LDAP, creates the account within the domain, and sets the 'networkDomain' field to the username. All next users are created in the same account.
Then we have the situation that in domain SBP we have a user 'rbergsma' that logs in first, gets an account created and then (unless you override) all VMs started in the SBP domain will have network domain 'rbergsma'. That is highly confusing and not what is should be.
linkDomainToLdap api call has no 'networkDomain' field, so I propose to make this field empty (set it to null). It's a sting and null / empty is allowed.
One can also specify the networkDomain when creating a VPC and also there it is allowed to be null.
When te networkDomain is needed (and is not set in the domain and not in the VPC) it is constructed by using guest.domain.suffix so there always is a netWork domain to be used.
It makes more sense to manually set it on a domain level, or specify it on the VPC and in the final case end up with something that is clearly generated (like cs342cloud.local) rather than the username of someone else.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9e1859ee
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9e1859ee
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9e1859ee
Branch: refs/heads/master
Commit: 9e1859ee2bbe82ad742c30cd9ca9aa7393d34f36
Parents: ef115ab
Author: Remi Bergsma <gi...@remi.nl>
Authored: Sun Apr 10 19:50:32 2016 +0200
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Sun Apr 10 19:50:32 2016 +0200
----------------------------------------------------------------------
.../src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java | 2 +-
.../ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e1859ee/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java
index 0ffa840..ae3e706 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java
@@ -82,7 +82,7 @@ public class LinkDomainToLdapCmd extends BaseCmd {
if (account == null) {
try {
UserAccount userAccount = _accountService.createUserAccount(admin, "", ldapUser.getFirstname(), ldapUser.getLastname(), ldapUser.getEmail(), null,
- admin, Account.ACCOUNT_TYPE_DOMAIN_ADMIN, domainId, admin, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), User.Source.LDAP);
+ admin, Account.ACCOUNT_TYPE_DOMAIN_ADMIN, domainId, null, null, UUID.randomUUID().toString(), UUID.randomUUID().toString(), User.Source.LDAP);
response.setAdminId(String.valueOf(userAccount.getAccountId()));
s_logger.info("created an account with name " + admin + " in the given domain " + domainId);
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e1859ee/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
index 7921292..5683b50 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
@@ -119,7 +119,7 @@ public class LdapAuthenticator extends AdapterBase implements UserAuthenticator
private void createCloudStackUserAccount(LdapUser user, long domainId, short accountType) {
String username = user.getUsername();
- _accountManager.createUserAccount(username, "", user.getFirstname(), user.getLastname(), user.getEmail(), null, username, accountType, domainId, username, null,
+ _accountManager.createUserAccount(username, "", user.getFirstname(), user.getLastname(), user.getEmail(), null, username, accountType, domainId, null, null,
UUID.randomUUID().toString(), UUID.randomUUID().toString(), User.Source.LDAP);
}
[2/4] git commit: updated refs/heads/master to c7d1b81
Posted by sw...@apache.org.
Merge pull request #1485 from remibergsma/fix-ldap-default-domain
Set default networkDomain to empty instead of usernameThe 10th field of `createUserAccount` is `networkDomain` (See `AccountService.java`) and it is set to a var named `admin`, which is the user name.
So, the first user that is created in a domain that links to LDAP, creates the account within the domain, and sets the `networkDomain` field to the username. All next users are created in the same account.
Then we have the situation that in domain SBP we have a user `rbergsma` that logs in first, gets an account created and then (unless you override) all VMs started in the SBP domain will have network domain `rbergsma`. That is highly confusing and not what is should be.
The `linkDomainToLdap` api call has no `networkDomain` field, so I propose to make this field empty (set it to null). It's a sting and null / empty is allowed.
One can also specify the networkDomain when creating a VPC and also there it is allowed to be null.
When te networkDomain is needed (and is not set in the domain and not in the VPC) it is constructed by using `guest.domain.suffix` so there always is a networkDomain to be used.
It makes more sense to manually set it on a domain level, or specify it on the VPC and in the final case end up with something that is clearly generated (like cs342cloud.local) rather than the username of someone else.
* pr/1485:
Set default networkDomain to empty instead of username
Signed-off-by: Will Stevens <wi...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f434f50a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f434f50a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f434f50a
Branch: refs/heads/master
Commit: f434f50a86c19ed434aea44975e2120689c2b4b6
Parents: 987e800 9e1859e
Author: Will Stevens <wi...@gmail.com>
Authored: Wed May 4 10:19:58 2016 -0400
Committer: Will Stevens <wi...@gmail.com>
Committed: Wed May 4 10:19:58 2016 -0400
----------------------------------------------------------------------
.../src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java | 2 +-
.../ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[3/4] git commit: updated refs/heads/master to c7d1b81
Posted by sw...@apache.org.
Merge release branch 4.7 to 4.8
* 4.7:
Set default networkDomain to empty instead of username
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/234ed9fb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/234ed9fb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/234ed9fb
Branch: refs/heads/master
Commit: 234ed9fb0d64986c4f7235aef762861413bb71be
Parents: 126a039 f434f50
Author: Will Stevens <wi...@gmail.com>
Authored: Wed May 4 10:21:24 2016 -0400
Committer: Will Stevens <wi...@gmail.com>
Committed: Wed May 4 10:21:24 2016 -0400
----------------------------------------------------------------------
.../src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java | 2 +-
.../ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[4/4] git commit: updated refs/heads/master to c7d1b81
Posted by sw...@apache.org.
Merge release branch 4.8 to master
* 4.8:
Set default networkDomain to empty instead of username
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c7d1b814
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c7d1b814
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c7d1b814
Branch: refs/heads/master
Commit: c7d1b8142c2ba02f7ffb726bf18bb098f530885a
Parents: 4d57ec0 234ed9f
Author: Will Stevens <wi...@gmail.com>
Authored: Wed May 4 10:22:16 2016 -0400
Committer: Will Stevens <wi...@gmail.com>
Committed: Wed May 4 10:22:16 2016 -0400
----------------------------------------------------------------------
.../src/org/apache/cloudstack/api/command/LinkDomainToLdapCmd.java | 2 +-
.../ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------