Thread: Ticket 298: bug on pg_hba.conf editor

Ticket 298: bug on pg_hba.conf editor

From
Guillaume Lelarge
Date:
Hi,

I worked a bit this morning on this bug. The editor was made in a way
that invalid configuration lines are not displayed which is wrong
because you can't fix a line if you stored it wrong once.

So I did the change to allow the change of an invalid configuration
line, and that works well.

But I now have many other lines that aren't supposed to appear:

# local      DATABASE  USER  METHOD  [OPTIONS]
# host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# host name, or it is

All are considered comments, and all have a valid first column, so all
are displayed. Which is a bit disturbing because they are part of the
comments in pg_hba.conf, they are not supposed to be "actual" lines.

So, they match our process of identifiying lines, and so they are
displayed. Do you have any idea how we could not display these? I mean,
I can simply add a check on the line string to see if they are equal to
the one of the five strings above, but it seems quite a ugly hack.

Or do we simply choose to not care? we prefer to have the bugfix even if
it means to show some not "actual" config lines?

Another related question: peer, radius are not available in the method.
As we are in beta, I won't add them to 1.14 branch, will I?

PS: current patch attached.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

Attachment

Re: Ticket 298: bug on pg_hba.conf editor

From
Dave Page
Date:
On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Hi,
>
> I worked a bit this morning on this bug. The editor was made in a way
> that invalid configuration lines are not displayed which is wrong
> because you can't fix a line if you stored it wrong once.
>
> So I did the change to allow the change of an invalid configuration
> line, and that works well.
>
> But I now have many other lines that aren't supposed to appear:
>
> # local      DATABASE  USER  METHOD  [OPTIONS]
> # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> # host name, or it is
>
> All are considered comments, and all have a valid first column, so all
> are displayed. Which is a bit disturbing because they are part of the
> comments in pg_hba.conf, they are not supposed to be "actual" lines.
>
> So, they match our process of identifiying lines, and so they are
> displayed. Do you have any idea how we could not display these? I mean,
> I can simply add a check on the line string to see if they are equal to
> the one of the five strings above, but it seems quite a ugly hack.

Why don't we just ignore anything that starts with a # ?

> Or do we simply choose to not care? we prefer to have the bugfix even if
> it means to show some not "actual" config lines?

Not those.

> Another related question: peer, radius are not available in the method.
> As we are in beta, I won't add them to 1.14 branch, will I?

I would consider their omission to be a bug.


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

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

Re: Ticket 298: bug on pg_hba.conf editor

From
Guillaume Lelarge
Date:
On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
> > Hi,
> >
> > I worked a bit this morning on this bug. The editor was made in a way
> > that invalid configuration lines are not displayed which is wrong
> > because you can't fix a line if you stored it wrong once.
> >
> > So I did the change to allow the change of an invalid configuration
> > line, and that works well.
> >
> > But I now have many other lines that aren't supposed to appear:
> >
> > # local      DATABASE  USER  METHOD  [OPTIONS]
> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > # host name, or it is
> >
> > All are considered comments, and all have a valid first column, so all
> > are displayed. Which is a bit disturbing because they are part of the
> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
> >
> > So, they match our process of identifiying lines, and so they are
> > displayed. Do you have any idea how we could not display these? I mean,
> > I can simply add a check on the line string to see if they are equal to
> > the one of the five strings above, but it seems quite a ugly hack.
>
> Why don't we just ignore anything that starts with a # ?
>

Because we need to guess which comment is an actual comment and which
comment is a disabled configuration. That allows us to hide actual
comments, and show disabled configuration. Problem is that our guess is
wrong sometimes.

> > Or do we simply choose to not care? we prefer to have the bugfix even if
> > it means to show some not "actual" config lines?
>
> Not those.
>

I don't get it, sorry :)

What do you mean by "not those"?

> > Another related question: peer, radius are not available in the method.
> > As we are in beta, I won't add them to 1.14 branch, will I?
>
> I would consider their omission to be a bug.
>

Hmmm, OK. Will fix then.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Ticket 298: bug on pg_hba.conf editor

From
Dave Page
Date:
On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
>> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>> > Hi,
>> >
>> > I worked a bit this morning on this bug. The editor was made in a way
>> > that invalid configuration lines are not displayed which is wrong
>> > because you can't fix a line if you stored it wrong once.
>> >
>> > So I did the change to allow the change of an invalid configuration
>> > line, and that works well.
>> >
>> > But I now have many other lines that aren't supposed to appear:
>> >
>> > # local      DATABASE  USER  METHOD  [OPTIONS]
>> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> > # host name, or it is
>> >
>> > All are considered comments, and all have a valid first column, so all
>> > are displayed. Which is a bit disturbing because they are part of the
>> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
>> >
>> > So, they match our process of identifiying lines, and so they are
>> > displayed. Do you have any idea how we could not display these? I mean,
>> > I can simply add a check on the line string to see if they are equal to
>> > the one of the five strings above, but it seems quite a ugly hack.
>>
>> Why don't we just ignore anything that starts with a # ?
>>
>
> Because we need to guess which comment is an actual comment and which
> comment is a disabled configuration. That allows us to hide actual
> comments, and show disabled configuration. Problem is that our guess is
> wrong sometimes.

Sounds like you're trying to be too clever. We don't normally care
about commented lines in configuration files. If you really want to do
so tough, check if a token is wrapped in [ ] - that never happen in a
valid configuration I don't believe.

>> > Or do we simply choose to not care? we prefer to have the bugfix even if
>> > it means to show some not "actual" config lines?
>>
>> Not those.
>>
>
> I don't get it, sorry :)
>
> What do you mean by "not those"?

We don't want to show those lines.

>> > Another related question: peer, radius are not available in the method.
>> > As we are in beta, I won't add them to 1.14 branch, will I?
>>
>> I would consider their omission to be a bug.
>>
>
> Hmmm, OK. Will fix then.

Thanks.

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

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

Re: Ticket 298: bug on pg_hba.conf editor

From
Guillaume Lelarge
Date:
On Sun, 2011-07-17 at 10:12 +0100, Dave Page wrote:
> On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> > On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
> >> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
> >> <guillaume@lelarge.info> wrote:
> >> > Hi,
> >> >
> >> > I worked a bit this morning on this bug. The editor was made in a way
> >> > that invalid configuration lines are not displayed which is wrong
> >> > because you can't fix a line if you stored it wrong once.
> >> >
> >> > So I did the change to allow the change of an invalid configuration
> >> > line, and that works well.
> >> >
> >> > But I now have many other lines that aren't supposed to appear:
> >> >
> >> > # local      DATABASE  USER  METHOD  [OPTIONS]
> >> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> >> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> >> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> >> > # host name, or it is
> >> >
> >> > All are considered comments, and all have a valid first column, so all
> >> > are displayed. Which is a bit disturbing because they are part of the
> >> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
> >> >
> >> > So, they match our process of identifiying lines, and so they are
> >> > displayed. Do you have any idea how we could not display these? I mean,
> >> > I can simply add a check on the line string to see if they are equal to
> >> > the one of the five strings above, but it seems quite a ugly hack.
> >>
> >> Why don't we just ignore anything that starts with a # ?
> >>
> >
> > Because we need to guess which comment is an actual comment and which
> > comment is a disabled configuration. That allows us to hide actual
> > comments, and show disabled configuration. Problem is that our guess is
> > wrong sometimes.
>
> Sounds like you're trying to be too clever.

I'm not. That's what the code already does since quite a long time.
Problem is it doesn't show lines that are enabled and invalid. And if I
try to show invalid lines, it shows even ones I don't want.

Hmmm, thinking now that I could show invalid but enabled lines, and not
invalid and disabled lines.

>  We don't normally care
> about commented lines in configuration files. If you really want to do
> so tough, check if a token is wrapped in [ ] - that never happen in a
> valid configuration I don't believe.
>

Actually, I'm fine with simply ignoring comments.

> >> > Or do we simply choose to not care? we prefer to have the bugfix even if
> >> > it means to show some not "actual" config lines?
> >>
> >> Not those.
> >>
> >
> > I don't get it, sorry :)
> >
> > What do you mean by "not those"?
>
> We don't want to show those lines.
>

OK.

> >> > Another related question: peer, radius are not available in the method.
> >> > As we are in beta, I won't add them to 1.14 branch, will I?
> >>
> >> I would consider their omission to be a bug.
> >>
> >
> > Hmmm, OK. Will fix then.
>
> Thanks.
>

Done.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Ticket 298: bug on pg_hba.conf editor

From
Guillaume Lelarge
Date:
On Sun, 2011-07-17 at 11:30 +0200, Guillaume Lelarge wrote:
> On Sun, 2011-07-17 at 10:12 +0100, Dave Page wrote:
> > On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> > > On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
> > >> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
> > >> <guillaume@lelarge.info> wrote:
> > >> > Hi,
> > >> >
> > >> > I worked a bit this morning on this bug. The editor was made in a way
> > >> > that invalid configuration lines are not displayed which is wrong
> > >> > because you can't fix a line if you stored it wrong once.
> > >> >
> > >> > So I did the change to allow the change of an invalid configuration
> > >> > line, and that works well.
> > >> >
> > >> > But I now have many other lines that aren't supposed to appear:
> > >> >
> > >> > # local      DATABASE  USER  METHOD  [OPTIONS]
> > >> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > >> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > >> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > >> > # host name, or it is
> > >> >
> > >> > All are considered comments, and all have a valid first column, so all
> > >> > are displayed. Which is a bit disturbing because they are part of the
> > >> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
> > >> >
> > >> > So, they match our process of identifiying lines, and so they are
> > >> > displayed. Do you have any idea how we could not display these? I mean,
> > >> > I can simply add a check on the line string to see if they are equal to
> > >> > the one of the five strings above, but it seems quite a ugly hack.
> > >>
> > >> Why don't we just ignore anything that starts with a # ?
> > >>
> > >
> > > Because we need to guess which comment is an actual comment and which
> > > comment is a disabled configuration. That allows us to hide actual
> > > comments, and show disabled configuration. Problem is that our guess is
> > > wrong sometimes.
> >
> > Sounds like you're trying to be too clever.
>
> I'm not. That's what the code already does since quite a long time.
> Problem is it doesn't show lines that are enabled and invalid. And if I
> try to show invalid lines, it shows even ones I don't want.
>
> Hmmm, thinking now that I could show invalid but enabled lines, and not
> invalid and disabled lines.
>

I've commited this one. Seems to work fine.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Ticket 298: bug on pg_hba.conf editor

From
Dave Page
Date:
On Sun, Jul 17, 2011 at 4:13 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On Sun, 2011-07-17 at 11:30 +0200, Guillaume Lelarge wrote:
>> On Sun, 2011-07-17 at 10:12 +0100, Dave Page wrote:
>> > On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> > > On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
>> > >> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
>> > >> <guillaume@lelarge.info> wrote:
>> > >> > Hi,
>> > >> >
>> > >> > I worked a bit this morning on this bug. The editor was made in a way
>> > >> > that invalid configuration lines are not displayed which is wrong
>> > >> > because you can't fix a line if you stored it wrong once.
>> > >> >
>> > >> > So I did the change to allow the change of an invalid configuration
>> > >> > line, and that works well.
>> > >> >
>> > >> > But I now have many other lines that aren't supposed to appear:
>> > >> >
>> > >> > # local      DATABASE  USER  METHOD  [OPTIONS]
>> > >> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> > >> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> > >> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> > >> > # host name, or it is
>> > >> >
>> > >> > All are considered comments, and all have a valid first column, so all
>> > >> > are displayed. Which is a bit disturbing because they are part of the
>> > >> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
>> > >> >
>> > >> > So, they match our process of identifiying lines, and so they are
>> > >> > displayed. Do you have any idea how we could not display these? I mean,
>> > >> > I can simply add a check on the line string to see if they are equal to
>> > >> > the one of the five strings above, but it seems quite a ugly hack.
>> > >>
>> > >> Why don't we just ignore anything that starts with a # ?
>> > >>
>> > >
>> > > Because we need to guess which comment is an actual comment and which
>> > > comment is a disabled configuration. That allows us to hide actual
>> > > comments, and show disabled configuration. Problem is that our guess is
>> > > wrong sometimes.
>> >
>> > Sounds like you're trying to be too clever.
>>
>> I'm not. That's what the code already does since quite a long time.
>> Problem is it doesn't show lines that are enabled and invalid. And if I
>> try to show invalid lines, it shows even ones I don't want.
>>
>> Hmmm, thinking now that I could show invalid but enabled lines, and not
>> invalid and disabled lines.
>>
>
> I've commited this one. Seems to work fine.

Seems pretty broken on Windows unfortunately:

1>Generating svnversion.h for revision REL-1_14_0-BETA3-12-gc047d65.
1>Compiling...
1>dlgColumn.cpp
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgcolumn.cpp(595)
: error C2509: 'GetTypeOid' : member function not declared in
'dlgColumn'
1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\dlg\dlgcolumn.h(21)
: see declaration of 'dlgColumn'
1>dlgHbaConfig.cpp
1>dlgProperty.cpp
1>dlgTable.cpp
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgtable.cpp(1894)
: error C2660: 'dlgTypeProperty::GetTypeOid' : function does not take
0 arguments
1>frmHbaConfig.cpp
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
: error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
: see declaration of 'pgHbaConfigLine'
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
: error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
: see declaration of 'pgHbaConfigLine'
1>pgColumn.cpp
1>pgconfig.cpp
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(390)
: error C2065: 'isValid' : undeclared identifier
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(399)
: error C2065: 'isValid' : undeclared identifier
1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(510)
: error C2065: 'isValid' : undeclared identifier

Please fix!

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

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

Re: Ticket 298: bug on pg_hba.conf editor

From
Guillaume Lelarge
Date:
On Mon, 2011-07-18 at 09:41 +0100, Dave Page wrote:
> On Sun, Jul 17, 2011 at 4:13 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
> > On Sun, 2011-07-17 at 11:30 +0200, Guillaume Lelarge wrote:
> >> On Sun, 2011-07-17 at 10:12 +0100, Dave Page wrote:
> >> > On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> >> > > On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
> >> > >> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
> >> > >> <guillaume@lelarge.info> wrote:
> >> > >> > Hi,
> >> > >> >
> >> > >> > I worked a bit this morning on this bug. The editor was made in a way
> >> > >> > that invalid configuration lines are not displayed which is wrong
> >> > >> > because you can't fix a line if you stored it wrong once.
> >> > >> >
> >> > >> > So I did the change to allow the change of an invalid configuration
> >> > >> > line, and that works well.
> >> > >> >
> >> > >> > But I now have many other lines that aren't supposed to appear:
> >> > >> >
> >> > >> > # local      DATABASE  USER  METHOD  [OPTIONS]
> >> > >> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> >> > >> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> >> > >> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> >> > >> > # host name, or it is
> >> > >> >
> >> > >> > All are considered comments, and all have a valid first column, so all
> >> > >> > are displayed. Which is a bit disturbing because they are part of the
> >> > >> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
> >> > >> >
> >> > >> > So, they match our process of identifiying lines, and so they are
> >> > >> > displayed. Do you have any idea how we could not display these? I mean,
> >> > >> > I can simply add a check on the line string to see if they are equal to
> >> > >> > the one of the five strings above, but it seems quite a ugly hack.
> >> > >>
> >> > >> Why don't we just ignore anything that starts with a # ?
> >> > >>
> >> > >
> >> > > Because we need to guess which comment is an actual comment and which
> >> > > comment is a disabled configuration. That allows us to hide actual
> >> > > comments, and show disabled configuration. Problem is that our guess is
> >> > > wrong sometimes.
> >> >
> >> > Sounds like you're trying to be too clever.
> >>
> >> I'm not. That's what the code already does since quite a long time.
> >> Problem is it doesn't show lines that are enabled and invalid. And if I
> >> try to show invalid lines, it shows even ones I don't want.
> >>
> >> Hmmm, thinking now that I could show invalid but enabled lines, and not
> >> invalid and disabled lines.
> >>
> >
> > I've commited this one. Seems to work fine.
>
> Seems pretty broken on Windows unfortunately:
>
> 1>Generating svnversion.h for revision REL-1_14_0-BETA3-12-gc047d65.
> 1>Compiling...
> 1>dlgColumn.cpp
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgcolumn.cpp(595)
> : error C2509: 'GetTypeOid' : member function not declared in
> 'dlgColumn'
> 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\dlg\dlgcolumn.h(21)
> : see declaration of 'dlgColumn'
> 1>dlgHbaConfig.cpp
> 1>dlgProperty.cpp
> 1>dlgTable.cpp
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgtable.cpp(1894)
> : error C2660: 'dlgTypeProperty::GetTypeOid' : function does not take
> 0 arguments
> 1>frmHbaConfig.cpp
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
> : error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
> 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
> : see declaration of 'pgHbaConfigLine'
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
> : error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
> 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
> : see declaration of 'pgHbaConfigLine'
> 1>pgColumn.cpp
> 1>pgconfig.cpp
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(390)
> : error C2065: 'isValid' : undeclared identifier
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(399)
> : error C2065: 'isValid' : undeclared identifier
> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(510)
> : error C2065: 'isValid' : undeclared identifier
>
> Please fix!
>

Will do this evening.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Ticket 298: bug on pg_hba.conf editor

From
Dave Page
Date:
Thanks.

On Mon, Jul 18, 2011 at 1:40 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On Mon, 2011-07-18 at 09:41 +0100, Dave Page wrote:
>> On Sun, Jul 17, 2011 at 4:13 PM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>> > On Sun, 2011-07-17 at 11:30 +0200, Guillaume Lelarge wrote:
>> >> On Sun, 2011-07-17 at 10:12 +0100, Dave Page wrote:
>> >> > On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>> >> > > On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
>> >> > >> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
>> >> > >> <guillaume@lelarge.info> wrote:
>> >> > >> > Hi,
>> >> > >> >
>> >> > >> > I worked a bit this morning on this bug. The editor was made in a way
>> >> > >> > that invalid configuration lines are not displayed which is wrong
>> >> > >> > because you can't fix a line if you stored it wrong once.
>> >> > >> >
>> >> > >> > So I did the change to allow the change of an invalid configuration
>> >> > >> > line, and that works well.
>> >> > >> >
>> >> > >> > But I now have many other lines that aren't supposed to appear:
>> >> > >> >
>> >> > >> > # local      DATABASE  USER  METHOD  [OPTIONS]
>> >> > >> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> >> > >> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> >> > >> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
>> >> > >> > # host name, or it is
>> >> > >> >
>> >> > >> > All are considered comments, and all have a valid first column, so all
>> >> > >> > are displayed. Which is a bit disturbing because they are part of the
>> >> > >> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
>> >> > >> >
>> >> > >> > So, they match our process of identifiying lines, and so they are
>> >> > >> > displayed. Do you have any idea how we could not display these? I mean,
>> >> > >> > I can simply add a check on the line string to see if they are equal to
>> >> > >> > the one of the five strings above, but it seems quite a ugly hack.
>> >> > >>
>> >> > >> Why don't we just ignore anything that starts with a # ?
>> >> > >>
>> >> > >
>> >> > > Because we need to guess which comment is an actual comment and which
>> >> > > comment is a disabled configuration. That allows us to hide actual
>> >> > > comments, and show disabled configuration. Problem is that our guess is
>> >> > > wrong sometimes.
>> >> >
>> >> > Sounds like you're trying to be too clever.
>> >>
>> >> I'm not. That's what the code already does since quite a long time.
>> >> Problem is it doesn't show lines that are enabled and invalid. And if I
>> >> try to show invalid lines, it shows even ones I don't want.
>> >>
>> >> Hmmm, thinking now that I could show invalid but enabled lines, and not
>> >> invalid and disabled lines.
>> >>
>> >
>> > I've commited this one. Seems to work fine.
>>
>> Seems pretty broken on Windows unfortunately:
>>
>> 1>Generating svnversion.h for revision REL-1_14_0-BETA3-12-gc047d65.
>> 1>Compiling...
>> 1>dlgColumn.cpp
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgcolumn.cpp(595)
>> : error C2509: 'GetTypeOid' : member function not declared in
>> 'dlgColumn'
>> 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\dlg\dlgcolumn.h(21)
>> : see declaration of 'dlgColumn'
>> 1>dlgHbaConfig.cpp
>> 1>dlgProperty.cpp
>> 1>dlgTable.cpp
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgtable.cpp(1894)
>> : error C2660: 'dlgTypeProperty::GetTypeOid' : function does not take
>> 0 arguments
>> 1>frmHbaConfig.cpp
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
>> : error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
>> 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
>> : see declaration of 'pgHbaConfigLine'
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
>> : error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
>> 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
>> : see declaration of 'pgHbaConfigLine'
>> 1>pgColumn.cpp
>> 1>pgconfig.cpp
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(390)
>> : error C2065: 'isValid' : undeclared identifier
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(399)
>> : error C2065: 'isValid' : undeclared identifier
>> 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(510)
>> : error C2065: 'isValid' : undeclared identifier
>>
>> Please fix!
>>
>
> Will do this evening.
>
>
> --
> Guillaume
>  http://blog.guillaume.lelarge.info
>  http://www.dalibo.com
>
>



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

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

Re: Ticket 298: bug on pg_hba.conf editor

From
Guillaume Lelarge
Date:
On Mon, 2011-07-18 at 14:40 +0200, Guillaume Lelarge wrote:
> On Mon, 2011-07-18 at 09:41 +0100, Dave Page wrote:
> > On Sun, Jul 17, 2011 at 4:13 PM, Guillaume Lelarge
> > <guillaume@lelarge.info> wrote:
> > > On Sun, 2011-07-17 at 11:30 +0200, Guillaume Lelarge wrote:
> > >> On Sun, 2011-07-17 at 10:12 +0100, Dave Page wrote:
> > >> > On Saturday, July 16, 2011, Guillaume Lelarge <guillaume@lelarge.info> wrote:
> > >> > > On Sat, 2011-07-16 at 21:11 +0100, Dave Page wrote:
> > >> > >> On Sat, Jul 16, 2011 at 1:12 PM, Guillaume Lelarge
> > >> > >> <guillaume@lelarge.info> wrote:
> > >> > >> > Hi,
> > >> > >> >
> > >> > >> > I worked a bit this morning on this bug. The editor was made in a way
> > >> > >> > that invalid configuration lines are not displayed which is wrong
> > >> > >> > because you can't fix a line if you stored it wrong once.
> > >> > >> >
> > >> > >> > So I did the change to allow the change of an invalid configuration
> > >> > >> > line, and that works well.
> > >> > >> >
> > >> > >> > But I now have many other lines that aren't supposed to appear:
> > >> > >> >
> > >> > >> > # local      DATABASE  USER  METHOD  [OPTIONS]
> > >> > >> > # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > >> > >> > # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > >> > >> > # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> > >> > >> > # host name, or it is
> > >> > >> >
> > >> > >> > All are considered comments, and all have a valid first column, so all
> > >> > >> > are displayed. Which is a bit disturbing because they are part of the
> > >> > >> > comments in pg_hba.conf, they are not supposed to be "actual" lines.
> > >> > >> >
> > >> > >> > So, they match our process of identifiying lines, and so they are
> > >> > >> > displayed. Do you have any idea how we could not display these? I mean,
> > >> > >> > I can simply add a check on the line string to see if they are equal to
> > >> > >> > the one of the five strings above, but it seems quite a ugly hack.
> > >> > >>
> > >> > >> Why don't we just ignore anything that starts with a # ?
> > >> > >>
> > >> > >
> > >> > > Because we need to guess which comment is an actual comment and which
> > >> > > comment is a disabled configuration. That allows us to hide actual
> > >> > > comments, and show disabled configuration. Problem is that our guess is
> > >> > > wrong sometimes.
> > >> >
> > >> > Sounds like you're trying to be too clever.
> > >>
> > >> I'm not. That's what the code already does since quite a long time.
> > >> Problem is it doesn't show lines that are enabled and invalid. And if I
> > >> try to show invalid lines, it shows even ones I don't want.
> > >>
> > >> Hmmm, thinking now that I could show invalid but enabled lines, and not
> > >> invalid and disabled lines.
> > >>
> > >
> > > I've commited this one. Seems to work fine.
> >
> > Seems pretty broken on Windows unfortunately:
> >
> > 1>Generating svnversion.h for revision REL-1_14_0-BETA3-12-gc047d65.
> > 1>Compiling...
> > 1>dlgColumn.cpp
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgcolumn.cpp(595)
> > : error C2509: 'GetTypeOid' : member function not declared in
> > 'dlgColumn'
> > 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\dlg\dlgcolumn.h(21)
> > : see declaration of 'dlgColumn'
> > 1>dlgHbaConfig.cpp
> > 1>dlgProperty.cpp
> > 1>dlgTable.cpp
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\dlg\dlgtable.cpp(1894)
> > : error C2660: 'dlgTypeProperty::GetTypeOid' : function does not take
> > 0 arguments
> > 1>frmHbaConfig.cpp
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
> > : error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
> > 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
> > : see declaration of 'pgHbaConfigLine'
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\frm\frmhbaconfig.cpp(175)
> > : error C2039: 'isValid' : is not a member of 'pgHbaConfigLine'
> > 1>        c:\users\dpage\documents\pgadmin3\pgadmin\include\utils\pgconfig.h(59)
> > : see declaration of 'pgHbaConfigLine'
> > 1>pgColumn.cpp
> > 1>pgconfig.cpp
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(390)
> > : error C2065: 'isValid' : undeclared identifier
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(399)
> > : error C2065: 'isValid' : undeclared identifier
> > 1>c:\users\dpage\documents\pgadmin3-1.14\pgadmin\utils\pgconfig.cpp(510)
> > : error C2065: 'isValid' : undeclared identifier
> >
> > Please fix!
> >
>
> Will do this evening.
>

Compiled it with Visual Studio Express 2008, with no error whatsoever.
Debug and Release. 1.14 and master. Have you done any changes?


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Ticket 298: bug on pg_hba.conf editor

From
Dave Page
Date:
On Mon, Jul 18, 2011 at 8:33 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>
> Compiled it with Visual Studio Express 2008, with no error whatsoever.
> Debug and Release. 1.14 and master. Have you done any changes?

Oh crap - my bad. I forgot to clean the build first.

Sorry for the noise.

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

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