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

Commitecd0bfa

Browse files
committed
Look Ma, no MAX_PARSE_BUFFER! (At least not in the backend.
pg_dump and interfaces/odbc still need some work.)
1 parent627b5e9 commitecd0bfa

File tree

22 files changed

+127
-182
lines changed

22 files changed

+127
-182
lines changed

‎src/backend/access/common/indextuple.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.38 1999/07/19 07:07:15 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.39 1999/10/23 03:13:20 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -44,10 +44,10 @@ index_formtuple(TupleDesc tupleDescriptor,
4444
uint16tupmask=0;
4545
intnumberOfAttributes=tupleDescriptor->natts;
4646

47-
if (numberOfAttributes>MaxIndexAttributeNumber)
48-
elog(ERROR,"index_formtuple:numberOfAttributesof %d > %d",
49-
numberOfAttributes,MaxIndexAttributeNumber);
50-
47+
/* XXX shouldn't this test be '>' ? */
48+
if (numberOfAttributes>=INDEX_MAX_KEYS)
49+
elog(ERROR,"index_formtuple:numberOfAttributes %d >= %d",
50+
numberOfAttributes,INDEX_MAX_KEYS);
5151

5252
for (i=0;i<numberOfAttributes&& !hasnull;i++)
5353
{

‎src/backend/access/index/istrat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.36 1999/09/18 19:06:04 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.37 1999/10/23 03:13:20 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -544,7 +544,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
544544
StrategyMapmap;
545545
AttrNumberattributeNumber;
546546
intattributeIndex;
547-
OidoperatorClassObjectId[MaxIndexAttributeNumber];
547+
OidoperatorClassObjectId[INDEX_MAX_KEYS];
548548

549549
if (!IsBootstrapProcessingMode())
550550
{

‎src/backend/libpq/auth.c

Lines changed: 17 additions & 15 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.41 1999/09/27 03:12:58 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.42 1999/10/23 03:13:21 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -96,23 +96,25 @@ pg_krb4_recvauth(Port *port)
9696
version);
9797
if (status!=KSUCCESS)
9898
{
99-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
100-
"pg_krb4_recvauth: kerberos error: %s\n",krb_err_txt[status]);
99+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
100+
"pg_krb4_recvauth: kerberos error: %s\n",
101+
krb_err_txt[status]);
101102
fputs(PQerrormsg,stderr);
102103
pqdebug("%s",PQerrormsg);
103104
returnSTATUS_ERROR;
104105
}
105106
if (strncmp(version,PG_KRB4_VERSION,KRB_SENDAUTH_VLEN))
106107
{
107-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
108-
"pg_krb4_recvauth: protocol version != \"%s\"\n",PG_KRB4_VERSION);
108+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
109+
"pg_krb4_recvauth: protocol version != \"%s\"\n",
110+
PG_KRB4_VERSION);
109111
fputs(PQerrormsg,stderr);
110112
pqdebug("%s",PQerrormsg);
111113
returnSTATUS_ERROR;
112114
}
113115
if (strncmp(port->user,auth_data.pname,SM_USER))
114116
{
115-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
117+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
116118
"pg_krb4_recvauth: name \"%s\" != \"%s\"\n",
117119
port->user,auth_data.pname);
118120
fputs(PQerrormsg,stderr);
@@ -126,8 +128,8 @@ pg_krb4_recvauth(Port *port)
126128
staticint
127129
pg_krb4_recvauth(Port*port)
128130
{
129-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
130-
"pg_krb4_recvauth: Kerberos not implemented on this server.\n");
131+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
132+
"pg_krb4_recvauth: Kerberos not implemented on this server.\n");
131133
fputs(PQerrormsg,stderr);
132134
pqdebug("%s",PQerrormsg);
133135

@@ -220,7 +222,7 @@ pg_krb5_recvauth(Port *port)
220222
*hostp='\0';
221223
if (code=krb5_parse_name(servbuf,&server))
222224
{
223-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
225+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
224226
"pg_krb5_recvauth: Kerberos error %d in krb5_parse_name\n",code);
225227
com_err("pg_krb5_recvauth",code,"in krb5_parse_name");
226228
returnSTATUS_ERROR;
@@ -253,7 +255,7 @@ pg_krb5_recvauth(Port *port)
253255
(krb5_ticket**)NULL,
254256
(krb5_authenticator**)NULL))
255257
{
256-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
258+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
257259
"pg_krb5_recvauth: Kerberos error %d in krb5_recvauth\n",code);
258260
com_err("pg_krb5_recvauth",code,"in krb5_recvauth");
259261
krb5_free_principal(server);
@@ -268,7 +270,7 @@ pg_krb5_recvauth(Port *port)
268270
*/
269271
if ((code=krb5_unparse_name(client,&kusername)))
270272
{
271-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
273+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
272274
"pg_krb5_recvauth: Kerberos error %d in krb5_unparse_name\n",code);
273275
com_err("pg_krb5_recvauth",code,"in krb5_unparse_name");
274276
krb5_free_principal(client);
@@ -277,7 +279,7 @@ pg_krb5_recvauth(Port *port)
277279
krb5_free_principal(client);
278280
if (!kusername)
279281
{
280-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
282+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
281283
"pg_krb5_recvauth: could not decode username\n");
282284
fputs(PQerrormsg,stderr);
283285
pqdebug("%s",PQerrormsg);
@@ -286,7 +288,7 @@ pg_krb5_recvauth(Port *port)
286288
kusername=pg_an_to_ln(kusername);
287289
if (strncmp(username,kusername,SM_USER))
288290
{
289-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
291+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
290292
"pg_krb5_recvauth: name \"%s\" != \"%s\"\n",port->user,kusername);
291293
fputs(PQerrormsg,stderr);
292294
pqdebug("%s",PQerrormsg);
@@ -301,7 +303,7 @@ pg_krb5_recvauth(Port *port)
301303
staticint
302304
pg_krb5_recvauth(Port*port)
303305
{
304-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
306+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
305307
"pg_krb5_recvauth: Kerberos not implemented on this server.\n");
306308
fputs(PQerrormsg,stderr);
307309
pqdebug("%s",PQerrormsg);
@@ -356,7 +358,7 @@ pg_passwordv0_recvauth(void *arg, PacketLen len, void *pkt)
356358

357359
if (user==NULL||password==NULL)
358360
{
359-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
361+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
360362
"pg_password_recvauth: badly formed password packet.\n");
361363
fputs(PQerrormsg,stderr);
362364
pqdebug("%s",PQerrormsg);

‎src/backend/libpq/hba.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* wherein you authenticate a user by seeing what IP address the system
66
* says he comes from and possibly using ident).
77
*
8-
*$Id: hba.c,v 1.48 1999/09/27 03:12:59 momjian Exp $
8+
*$Id: hba.c,v 1.49 1999/10/23 03:13:21 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -19,9 +19,18 @@
1919
#include<unistd.h>
2020

2121
#include"postgres.h"
22+
2223
#include"libpq/libpq.h"
2324
#include"miscadmin.h"
2425

26+
27+
#defineMAX_TOKEN 80
28+
/* Maximum size of one token in the configuration file*/
29+
30+
#defineIDENT_USERNAME_MAX 512
31+
/* Max size of username ident server can return */
32+
33+
2534
/* Some standard C libraries, including GNU, have an isblank() function.
2635
Others, including Solaris, do not. So we have our own.
2736
*/
@@ -32,7 +41,6 @@ isblank(const char c)
3241
}
3342

3443

35-
3644
staticvoid
3745
next_token(FILE*fp,char*buf,constintbufsz)
3846
{
@@ -302,9 +310,8 @@ process_hba_record(FILE *file, hbaPort *port, bool *matches_p, bool *error_p)
302310
return;
303311

304312
syntax:
305-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
313+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
306314
"process_hba_record: invalid syntax in pg_hba.conf file\n");
307-
308315
fputs(PQerrormsg,stderr);
309316
pqdebug("%s",PQerrormsg);
310317

@@ -397,7 +404,7 @@ find_hba_entry(hbaPort *port, bool *hba_ok_p)
397404
{
398405
/* Old config file exists.Tell this guy he needs to upgrade. */
399406
close(fd);
400-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
407+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
401408
"A file exists by the name used for host-based authentication "
402409
"in prior releases of Postgres (%s). The name and format of "
403410
"the configuration file have changed, so this file should be "
@@ -421,7 +428,7 @@ find_hba_entry(hbaPort *port, bool *hba_ok_p)
421428
{
422429
/* The open of the config file failed.*/
423430

424-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
431+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
425432
"find_hba_entry: Host-based authentication config file "
426433
"does not exist or permissions are not setup correctly! "
427434
"Unable to open file \"%s\".\n",
@@ -553,7 +560,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
553560
sock_fd=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
554561
if (sock_fd==-1)
555562
{
556-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
563+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
557564
"Failed to create socket on which to talk to Ident server. "
558565
"socket() returned errno = %s (%d)\n",
559566
strerror(errno),errno);
@@ -590,7 +597,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
590597
}
591598
if (rc!=0)
592599
{
593-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
600+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
594601
"Unable to connect to Ident server on the host which is "
595602
"trying to connect to Postgres "
596603
"(IP address %s, Port %d). "
@@ -610,7 +617,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
610617
rc=send(sock_fd,ident_query,strlen(ident_query),0);
611618
if (rc<0)
612619
{
613-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
620+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
614621
"Unable to send query to Ident server on the host which is "
615622
"trying to connect to Postgres (Host %s, Port %d),"
616623
"even though we successfully connected to it. "
@@ -627,7 +634,7 @@ ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
627634
rc=recv(sock_fd,ident_response,sizeof(ident_response)-1,0);
628635
if (rc<0)
629636
{
630-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
637+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
631638
"Unable to receive response from Ident server "
632639
"on the host which is "
633640
"trying to connect to Postgres (Host %s, Port %d),"
@@ -692,7 +699,7 @@ parse_map_record(FILE *file,
692699
return;
693700
}
694701
}
695-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
702+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
696703
"Incomplete line in pg_ident: %s",file_map);
697704
fputs(PQerrormsg,stderr);
698705
pqdebug("%s",PQerrormsg);
@@ -775,7 +782,7 @@ verify_against_usermap(const char *pguser,
775782
if (usermap_name[0]=='\0')
776783
{
777784
*checks_out_p= false;
778-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
785+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
779786
"verify_against_usermap: hba configuration file does not "
780787
"have the usermap field filled in in the entry that pertains "
781788
"to this connection. That field is essential for Ident-based "
@@ -813,7 +820,7 @@ verify_against_usermap(const char *pguser,
813820

814821
*checks_out_p= false;
815822

816-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
823+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
817824
"verify_against_usermap: usermap file for Ident-based "
818825
"authentication "
819826
"does not exist or permissions are not setup correctly! "

‎src/backend/libpq/password.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (c) 1994, Regents of the University of California
33
*
4-
* $Id: password.c,v 1.25 1999/07/17 20:17:02 momjian Exp $
4+
* $Id: password.c,v 1.26 1999/10/23 03:13:21 tgl Exp $
55
*
66
*/
77

@@ -34,7 +34,7 @@ verify_password(char *auth_arg, char *user, char *password)
3434
#endif
3535
if (!pw_file)
3636
{
37-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
37+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
3838
"verify_password: couldn't open password file '%s'\n",
3939
pw_file_fullname);
4040
fputs(PQerrormsg,stderr);
@@ -79,7 +79,7 @@ verify_password(char *auth_arg, char *user, char *password)
7979
returnSTATUS_OK;
8080
}
8181

82-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
82+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
8383
"verify_password: password mismatch for '%s'.\n",
8484
user);
8585
fputs(PQerrormsg,stderr);
@@ -91,7 +91,7 @@ verify_password(char *auth_arg, char *user, char *password)
9191
}
9292
}
9393

94-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
94+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
9595
"verify_password: user '%s' not found in password file.\n",
9696
user);
9797
fputs(PQerrormsg,stderr);

‎src/backend/libpq/portal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
*$Id: portal.c,v 1.27 1999/07/17 20:17:02 momjian Exp $
8+
*$Id: portal.c,v 1.28 1999/10/23 03:13:22 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -66,7 +66,7 @@ in_range(char *msg, int value, int min, int max)
6666
{
6767
if (value<min||value >=max)
6868
{
69-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,
69+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
7070
"FATAL: %s, %d is not in range [%d,%d)\n",msg,value,min,max);
7171
pqdebug("%s",PQerrormsg);
7272
fputs(PQerrormsg,stderr);
@@ -80,7 +80,7 @@ valid_pointer(char *msg, void *ptr)
8080
{
8181
if (!ptr)
8282
{
83-
snprintf(PQerrormsg,ERROR_MSG_LENGTH,"FATAL: %s\n",msg);
83+
snprintf(PQerrormsg,PQERRORMSG_LENGTH,"FATAL: %s\n",msg);
8484
pqdebug("%s",PQerrormsg);
8585
fputs(PQerrormsg,stderr);
8686
return0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp