Important typo fix for hba.c in 7.4

Started by Bruno Wolff IIIover 23 years ago4 messagesbugs
Jump to latest
#1Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Bruno Wolff III (#2)
Re: Important typo fix for hba.c in 7.4

Patch applied. Thanks.

---------------------------------------------------------------------------

Bruno Wolff III wrote:

A typo in src/backend/libpq/hba.c breaks local ident authentication
in the SO_PEERCRED case. elif is misspelled as elsif for the test.
A patch is attached.

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#2Bruno Wolff III
bruno@wolff.to

A typo in src/backend/libpq/hba.c breaks local ident authentication
in the SO_PEERCRED case. elif is misspelled as elsif for the test.
A patch is attached.

Attachments:

hba.difftext/plain; charset=us-asciiDownload+2-2
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruno Wolff III (#2)
Re: Important typo fix for hba.c in 7.4

Bruno Wolff III <bruno@wolff.to> writes:

[ #elsif should be #elif ]

Yuck. I wonder why gcc doesn't complain about this sort of thing?

regards, tom lane

#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#3)
Re: Important typo fix for hba.c in 7.4

Tom Lane wrote:

Bruno Wolff III <bruno@wolff.to> writes:

[ #elsif should be #elif ]

Yuck. I wonder why gcc doesn't complain about this sort of thing?

I don't think gcc every sees it. I think cpp should complain, but cpp
skips right over it because it is not in a block of code it has to worry
about. In this example:

#ifdef SDF
#asdfasf
#endif
#lkjasdf

the first one doesn't generate a warning, while the second does.

This code got in there as part of the OpenBSD support for local ident,
either from the patch or my sloppy fingers.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073