Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e789e8

Browse files
committed
From: Phil Thompson <phil@river-bank.demon.co.uk>
Attached is the patch to fix the warning messages from my code. I alsofixed one which wasn't my code. Apart from the usual warnings about thebison/yacc generated code I only have one other warning message. Thisis in gramm.y around line 2234. I wasn't sure of the fix.I've also replaced all the calls to free() in gramm.y to calls topfree(). Without these I was getting backend crashes with GRANT. Thismight already have been fixed.
1 parent2780576 commit8e789e8

File tree

7 files changed

+66
-65
lines changed

7 files changed

+66
-65
lines changed

‎src/backend/libpq/auth.c

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.23 1998/01/27 03:24:54 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.24 1998/01/29 03:23:05 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -390,80 +390,83 @@ void auth_failed(Port *port)
390390
*/
391391
voidbe_recvauth(Port*port)
392392
{
393-
AuthRequestareq;
394-
void (*auth_handler)();
395-
396393
/*
397394
* Get the authentication method to use for this frontend/database
398395
* combination.
399396
*/
400397

401398
if (hba_getauthmethod(&port->raddr,port->database,port->auth_arg,
402399
&port->auth_method)!=STATUS_OK)
403-
{
404400
PacketSendError(&port->pktInfo,"Missing or mis-configured pg_hba.conf file");
405-
return;
406-
}
407401

408-
/* Handle old style authentication. */
409-
410-
if (PG_PROTOCOL_MAJOR(port->proto)==0)
402+
elseif (PG_PROTOCOL_MAJOR(port->proto)==0)
411403
{
404+
/* Handle old style authentication. */
405+
412406
if (old_be_recvauth(port)!=STATUS_OK)
413407
auth_failed(port);
414-
415-
return;
416408
}
417-
418-
/* Handle new style authentication. */
419-
420-
switch (port->auth_method)
409+
else
421410
{
422-
caseuaReject:
423-
auth_failed(port);
424-
return;
425-
426-
caseuaKrb4:
427-
areq=AUTH_REQ_KRB4;
428-
auth_handler=handle_krb4_auth;
429-
break;
411+
AuthRequestareq;
412+
void (*auth_handler)();
430413

431-
caseuaKrb5:
432-
areq=AUTH_REQ_KRB5;
433-
auth_handler=handle_krb5_auth;
434-
break;
414+
/* Keep the compiler quiet. */
435415

436-
caseuaTrust:
437416
areq=AUTH_REQ_OK;
438-
auth_handler=handle_done_auth;
439-
break;
440417

441-
caseuaIdent:
442-
if (authident(&port->raddr.in,&port->laddr.in,port->user,
443-
port->auth_arg)!=STATUS_OK)
418+
/* Handle new style authentication. */
419+
420+
auth_handler=NULL;
421+
422+
switch (port->auth_method)
444423
{
445-
auth_failed(port);
446-
return;
447-
}
424+
caseuaReject:
425+
break;
426+
427+
caseuaKrb4:
428+
areq=AUTH_REQ_KRB4;
429+
auth_handler=handle_krb4_auth;
430+
break;
448431

449-
areq=AUTH_REQ_OK;
450-
auth_handler=handle_done_auth;
451-
break;
432+
caseuaKrb5:
433+
areq=AUTH_REQ_KRB5;
434+
auth_handler=handle_krb5_auth;
435+
break;
452436

453-
caseuaPassword:
454-
areq=AUTH_REQ_PASSWORD;
455-
auth_handler=handle_password_auth;
456-
break;
437+
caseuaTrust:
438+
areq=AUTH_REQ_OK;
439+
auth_handler=handle_done_auth;
440+
break;
457441

458-
caseuaCrypt:
459-
areq=AUTH_REQ_CRYPT;
460-
auth_handler=handle_password_auth;
461-
break;
462-
}
442+
caseuaIdent:
443+
if (authident(&port->raddr.in,&port->laddr.in,
444+
port->user,port->auth_arg)==STATUS_OK)
445+
{
446+
areq=AUTH_REQ_OK;
447+
auth_handler=handle_done_auth;
448+
}
449+
450+
break;
463451

464-
/* Tell the frontend what we want next. */
452+
caseuaPassword:
453+
areq=AUTH_REQ_PASSWORD;
454+
auth_handler=handle_password_auth;
455+
break;
465456

466-
sendAuthRequest(port,areq,auth_handler);
457+
caseuaCrypt:
458+
areq=AUTH_REQ_CRYPT;
459+
auth_handler=handle_password_auth;
460+
break;
461+
}
462+
463+
/* Tell the frontend what we want next. */
464+
465+
if (auth_handler!=NULL)
466+
sendAuthRequest(port,areq,auth_handler);
467+
else
468+
auth_failed(port);
469+
}
467470
}
468471

469472

‎src/backend/utils/cache/lsyscache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.10 1998/01/20 05:04:32 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.11 1998/01/29 03:23:09 scrappy Exp $
1111
*
1212
* NOTES
1313
* Eventually, the index information should go through here, too.
@@ -173,7 +173,7 @@ get_atttypmod(Oid relid, AttrNumber attnum)
173173
0,0))
174174
returnatt_tup.atttypmod;
175175
else
176-
returnNULL;
176+
return-1;
177177
}
178178

179179
/*---------- INDEX CACHE ---------- */

‎src/backend/utils/init/postinit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.21 1997/12/20 00:10:47 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.22 1998/01/29 03:23:28 scrappy Exp $
1111
*
1212
* NOTES
1313
*InitPostgres() is the function called from PostgresMain
@@ -66,7 +66,7 @@
6666
#include"catalog/catname.h"
6767
#include"catalog/pg_database.h"
6868

69-
#include"libpq/libpq-be.h"
69+
#include"libpq/libpq.h"
7070

7171
staticvoidVerifySystemDatabase(void);
7272
staticvoidVerifyMyDatabase(void);

‎src/interfaces/libpq/fe-auth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.13 1998/01/26 01:42:25 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.14 1998/01/29 03:24:03 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -477,7 +477,7 @@ pg_password_sendauth(PGconn *conn, const char *password, AuthRequest areq)
477477
*/
478478
int
479479
fe_sendauth(AuthRequestareq,PGconn*conn,constchar*hostname,
480-
constchar*password,constchar*PQerrormsg)
480+
constchar*password,char*PQerrormsg)
481481
{
482482
switch (areq)
483483
{

‎src/interfaces/libpq/fe-auth.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: fe-auth.h,v 1.7 1998/01/26 01:42:26 scrappy Exp $
9+
* $Id: fe-auth.h,v 1.8 1998/01/29 03:24:21 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -33,7 +33,7 @@
3333

3434
externint
3535
fe_sendauth(AuthRequestareq,PGconn*conn,constchar*hostname,
36-
constchar*password,constchar*PQerromsg);
36+
constchar*password,char*PQerromsg);
3737
externvoidfe_setauthsvc(constchar*name,char*PQerrormsg);
3838

3939
#definePG_KRB4_VERSION "PGVER4.1"/* at most KRB_SENDAUTH_VLEN chars */

‎src/interfaces/libpq/fe-connect.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.60 1998/01/28 03:42:27 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.61 1998/01/29 03:24:30 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -808,9 +808,7 @@ PQreset(PGconn *conn)
808808
* SIDE_EFFECTS: may block.
809809
*/
810810
int
811-
packetSend(PGconn*conn,
812-
char*buf,
813-
size_tlen)
811+
packetSend(PGconn*conn,constchar*buf,size_tlen)
814812
{
815813
/* Send the total packet size. */
816814

‎src/interfaces/libpq/fe-connect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: fe-connect.h,v 1.6 1998/01/26 01:42:30 scrappy Exp $
9+
* $Id: fe-connect.h,v 1.7 1998/01/29 03:24:36 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -23,6 +23,6 @@
2323
*----------------------------------------------------------------
2424
*/
2525

26-
intpacketSend(PGconn*conn,char*buf,size_tlen);
26+
intpacketSend(PGconn*conn,constchar*buf,size_tlen);
2727

2828
#endif/* FE_CONNECT_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp