Re: Password setting having somewhat bizarre results.

Поиск
Список
Период
Сортировка
От Dinesh Kumar
Тема Re: Password setting having somewhat bizarre results.
Дата
Msg-id CAKWsr7is1Mrq=OxnND9EdrBc5-9s0rb7NPP-ER1hentTfVtjaw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Password setting having somewhat bizarre results.  (Dave Page <dpage@pgadmin.org>)
Ответы Re: Password setting having somewhat bizarre results.
Список pgadmin-support
Hi Dave,

Thanks for your inputs.

On Fri, Aug 30, 2013 at 2:01 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi


On Thu, Aug 29, 2013 at 6:07 PM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote:
H
i Dave,

On Thu, Aug 29, 2013 at 8:32 AM, Dave Page <dpage@pgadmin.org> wrote:



On Thu, Aug 29, 2013 at 4:28 PM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote:
H
i Dave,

On Thu, Aug 29, 2013 at 7:29 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi


On Thu, Aug 29, 2013 at 1:01 PM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote:
Hi Dave,

Sorry for the delay on this issue.

Yes, i am able to reproduce the problem in Linux but not in windows. I am attaching the fix for this issue. After applying this fix, the behaviour in windows and linux are same.

Kindly let me know if i miss anything here.

Still not quite right I'm afraid. If I open a user account with no pre-existing expiry, then the dialogue will try to execute:

ALTER ROLE rolename
   VALID UNTIL 'infinity';

 As I haven't changed anything on the dialogue, it shouldn't try to make any changes (or, enable the OK button). Also, the dialogue itself shows the current date - it should be blank. If I choose a date - then it still tries to set the expiry to infinity!

Tested on Mac.
 
 Thanks for your inputs. In the current implementation, if the "calender control" doesn't have a proper value, then we do add "infinity" to the sql statement. It's the same case, in the edit/creating a role.

I am not sure, whether we need to follow this implementation or not. I mean, adding "infinity" to the end of sql statement if the calender control value is an empty.

But, i have removed this "infinity" condition and attaching the patch.

Infinity is correct, but:

- The SQL to set it should only be generated if the user has opened the dialogue and removed any existing value. If the role is already set to infinite expiration, then it shouldn't be set again.

- Obviously this requires the ability to clear that value, and to display is as a blank value in the event that you create a new role (it should default to infinity) or if opening an existing role that is already set that way.

If the control doesn't allow you to clear the value, then maybe we need to add a checkbox for infinite, and when un-checked, the user is able to select a date and time, otherwise not. 

Thanks.


Thanks for the suggestions. Please find the attached the patch for the same.

Let me know if i miss anything here.

Thanks in advance.

OK, that seems much better, but unfortunately still not quite perfect. I spot two issues:

- Changing the time, but not the date, on an existing expiration datetime, doesn't generate SQL and enable the OK button. Changing just the date does.

Apologies Dave. I am not able to explain you the problem properly. But below are my findings.

Further to my observation, it's not generating the event of

EVT_SPIN(XRCID("timValidUntil"), dlgRole::OnChangeSpin)


which is in pg_Roles.cpp. If the spin event occurs on spin button, then it's directly going to
"EVT_SPIN_x" in timespin.cpp. And also, i have observed that wxTimeSpinCtrl is our custom data type which we have been derived from the wxControl class. That may be the reason the spin control event is directly refering  to  timespin.cpp's EVT_SPIN_x functions. I have fixed this issue by appending an dlgRole's event to timespin.cpp's event and it is working fine.

Kindly let me know if anything is unclear.
 

- If I clear the date and time, SQL is not generated to reset the valid until time to infinity.


If the role's "rolvaliduntil" property is NULL or infinity then there is no password expiration for that user/role. I believe, in your case the "rolvaliduntil" might be the NULL. Hence, it's not generating any "VALID UNTIL 'infinity'" since, NULL ~ infinity and also we haven't changed anything. In the rest of the cases, i believe it will generate as you suggested.

Kindly let me know if i miss anything here.
 
Thanks. 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

K

Dinesh

-- 
Dinesh Kumar
Software Engineer

Ph: +918087463317
Skype ID: dinesh.kumar432
www.enterprisedb.com

Follow us on Twitter

@EnterpriseDB 

Visit EnterpriseDB for tutorials, webinars, whitepapers and more


On Fri, Aug 30, 2013 at 2:01 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi


On Thu, Aug 29, 2013 at 6:07 PM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote:
H
i Dave,

On Thu, Aug 29, 2013 at 8:32 AM, Dave Page <dpage@pgadmin.org> wrote:



On Thu, Aug 29, 2013 at 4:28 PM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote:
H
i Dave,

On Thu, Aug 29, 2013 at 7:29 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi


On Thu, Aug 29, 2013 at 1:01 PM, Dinesh Kumar <dinesh.kumar@enterprisedb.com> wrote:
Hi Dave,

Sorry for the delay on this issue.

Yes, i am able to reproduce the problem in Linux but not in windows. I am attaching the fix for this issue. After applying this fix, the behaviour in windows and linux are same.

Kindly let me know if i miss anything here.

Still not quite right I'm afraid. If I open a user account with no pre-existing expiry, then the dialogue will try to execute:

ALTER ROLE rolename
   VALID UNTIL 'infinity';

 As I haven't changed anything on the dialogue, it shouldn't try to make any changes (or, enable the OK button). Also, the dialogue itself shows the current date - it should be blank. If I choose a date - then it still tries to set the expiry to infinity!

Tested on Mac.
 
 Thanks for your inputs. In the current implementation, if the "calender control" doesn't have a proper value, then we do add "infinity" to the sql statement. It's the same case, in the edit/creating a role.

I am not sure, whether we need to follow this implementation or not. I mean, adding "infinity" to the end of sql statement if the calender control value is an empty.

But, i have removed this "infinity" condition and attaching the patch.

Infinity is correct, but:

- The SQL to set it should only be generated if the user has opened the dialogue and removed any existing value. If the role is already set to infinite expiration, then it shouldn't be set again.

- Obviously this requires the ability to clear that value, and to display is as a blank value in the event that you create a new role (it should default to infinity) or if opening an existing role that is already set that way.

If the control doesn't allow you to clear the value, then maybe we need to add a checkbox for infinite, and when un-checked, the user is able to select a date and time, otherwise not. 

Thanks.


Thanks for the suggestions. Please find the attached the patch for the same.

Let me know if i miss anything here.

Thanks in advance.

OK, that seems much better, but unfortunately still not quite perfect. I spot two issues:

- Changing the time, but not the date, on an existing expiration datetime, doesn't generate SQL and enable the OK button. Changing just the date does.

- If I clear the date and time, SQL is not generated to reset the valid until time to infinity.

Thanks. 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Вложения

В списке pgadmin-support по дате отправления:

Предыдущее
От: Chris Campbell
Дата:
Сообщение: Re: Server Status Activity grid
Следующее
От: Dave Page
Дата:
Сообщение: Re: Password setting having somewhat bizarre results.