cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Creasy <jonathan.cre...@contegix.com>
Subject Re: Review Request 13610: Bugfix CLOUDSTACK-4359: Default username is Admin not admin
Date Thu, 29 Aug 2013 16:03:09 GMT
Our database has "admin" for the user. I can login as "Admin" or "admin" on a freshly minted
system. 

I am not sure what problem I faced originally that led me to think that I had to use "Admin"
in order to login. 

-Jonathan

----- Original Message -----
From: "Marcus Sorensen" <shadowsor@gmail.com>
To: "Jonathan Creasy" <jonathan@ghostlab.net>
Cc: "Radhika Puthiyetath" <radhika.puthiyetath@citrix.com>, dev@cloudstack.apache.org
Sent: Thursday, August 29, 2013 12:14:23 AM
Subject: Re: Review Request 13610: Bugfix CLOUDSTACK-4359: Default username is Admin not admin

Here's where the admin account is created
(server/src/com/cloud/server/ConfigurationServerImpl.java), when
management server is first started after fresh db deploy. Looks like
we intend for it to be "admin", I'm not sure where the "Admin" might
be coming from unless it's a deployment on top of an existing
database, or there's a second user "Admin" in addition to the id=2
"admin" user, or it's some sort of developer setting for a test build.

        // insert admin user, but leave the account disabled until we set a
        // password with the user authenticator
        long id = 2;
        String username = "admin";
        String firstname = "admin";
        String lastname = "cloud";

        // create an account for the admin user first
        insertSql = "INSERT INTO `cloud`.`account` (id, uuid,
account_name, type, domain_id, account.default) VALUES (" + id + ",
UUID(), '" + username + "', '1', '1', 1)";
        txn = Transaction.currentTxn();
        try {
            PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql);
            stmt.executeUpdate();
        } catch (SQLException ex) {
        }

        // now insert the user
        insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username,
password, account_id, firstname, lastname, created, state,
user.default) " +
                "VALUES (" + id + ", UUID(), '" + username + "',
RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled',
1)";



And it seems to work...

[root@devcloud-kvm /]# mysql -e 'drop database cloud'
[root@devcloud-kvm /]# cloudstack-setup-databases
cloud:password@localhost --deploy-as root >/dev/null
[root@devcloud-kvm /]# cloudstack-setup-management
Starting to configure CloudStack Management Server:
Configure sudoers ...         [OK]
Configure Firewall ...        [OK]
Configure CloudStack Management Server ...[OK]
CloudStack Management Server setup is Done!
[root@devcloud-kvm /]# mysql -e 'select username from cloud.user where id=2'
+----------+
| username |
+----------+
| admin    |
+----------+

On Wed, Aug 28, 2013 at 10:54 PM, Marcus Sorensen <shadowsor@gmail.com> wrote:
> I'm just wondering what the actual database says... looking into a
> fresh deploy now. I'm assuming yours was also fresh and not an
> upgrade?
>
> You can run the mysql command 'select username from cloud.user where id=2;'
>
> On Wed, Aug 28, 2013 at 10:32 PM, Jonathan Creasy <jonathan@ghostlab.net> wrote:
>> Pardon my ignorance, and lack of a computer at hand, what specifically would
>> you like me to check? I am happy to help track this down.
>>
>> -Jonathan
>>
>> On Aug 28, 2013 11:14 PM, "Marcus Sorensen" <shadowsor@gmail.com> wrote:
>>>
>>> Does the actual ROOT/Admin user show that? If so, we should probably fix
>>> that rather than the doc. No reason to change an established standard now.
>>>
>>> On Aug 28, 2013 10:10 PM, "Jonathan Creasy" <jonathan@ghostlab.net> wrote:
>>>>
>>>> It's Admin on my boxes, 4.2 branch, CentOS 4.2. Using "admin" doesn't
>>>> work.
>>>>
>>>> I haven't looked at the code to see if it could vary with password
>>>> hashing methods or something.
>>>>
>>>> -Jonathan
>>>>
>>>> On Aug 28, 2013 11:08 PM, "Marcus Sorensen" <shadowsor@gmail.com> wrote:
>>>>>
>>>>> Huh? I've always logged in as 'admin'.
>>>>>
>>>>> On Aug 28, 2013 10:01 PM, "Radhika PC" <radhika.puthiyetath@citrix.com>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> -----------------------------------------------------------
>>>>>> This is an automatically generated e-mail. To reply, visit:
>>>>>> https://reviews.apache.org/r/13610/#review25706
>>>>>> -----------------------------------------------------------
>>>>>>
>>>>>> Ship it!
>>>>>>
>>>>>>
>>>>>> Ship It!
>>>>>>
>>>>>> - Radhika PC
>>>>>>
>>>>>>
>>>>>> On Aug. 16, 2013, midnight, Jonathan Creasy wrote:
>>>>>> >
>>>>>> > -----------------------------------------------------------
>>>>>> > This is an automatically generated e-mail. To reply, visit:
>>>>>> > https://reviews.apache.org/r/13610/
>>>>>> > -----------------------------------------------------------
>>>>>> >
>>>>>> > (Updated Aug. 16, 2013, midnight)
>>>>>> >
>>>>>> >
>>>>>> > Review request for cloudstack.
>>>>>> >
>>>>>> >
>>>>>> > Bugs: CLOUDSTACK-4359
>>>>>> >
>>>>>> >
>>>>>> > Repository: cloudstack-git
>>>>>> >
>>>>>> >
>>>>>> > Description
>>>>>> > -------
>>>>>> >
>>>>>> > 4.2 documentation lists initial user as admin when it should
be Admin
>>>>>> >
>>>>>> > /docs/en-US/html/log-in.html
>>>>>> >
>>>>>> >
>>>>>> > Diffs
>>>>>> > -----
>>>>>> >
>>>>>> >   docs/en-US/log-in.xml 84328ce4d45e7a588acb28063616d9c77e5518d8
>>>>>> >   docs/pot/log-in.pot 2faf14b1738b5f6b7473b35f3b7cf72882c600b2
>>>>>> >
>>>>>> > Diff: https://reviews.apache.org/r/13610/diff/
>>>>>> >
>>>>>> >
>>>>>> > Testing
>>>>>> > -------
>>>>>> >
>>>>>> >
>>>>>> > Thanks,
>>>>>> >
>>>>>> > Jonathan Creasy
>>>>>> >
>>>>>> >
>>>>>>
>>

Mime
View raw message