Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
5241a625
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5241a625
编写于
8月 29, 2002
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove support for version-0 FE/BE protocol, per pghackers discussion.
This breaks support for 6.2 or older client libraries.
上级
8a24a55c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
21 addition
and
248 deletion
+21
-248
doc/src/sgml/release.sgml
doc/src/sgml/release.sgml
+2
-1
src/backend/libpq/auth.c
src/backend/libpq/auth.c
+1
-181
src/backend/libpq/pqformat.c
src/backend/libpq/pqformat.c
+5
-42
src/include/libpq/libpq-be.h
src/include/libpq/libpq-be.h
+2
-11
src/include/libpq/pqcomm.h
src/include/libpq/pqcomm.h
+5
-12
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-auth.c
+6
-1
未找到文件。
doc/src/sgml/release.sgml
浏览文件 @
5241a625
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.15
3 2002/08/29 00:17:01
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.15
4 2002/08/29 03:22:00
tgl Exp $
-->
<appendix id="release">
...
...
@@ -24,6 +24,7 @@ CDATA means the content is "SGML-free", so you can write without
worries about funny characters.
-->
<literallayout><![CDATA[
Client libraries older than 6.3 no longer supported (version 0 protocol removed)
PREPARE statement allows caching query plans for interactive statements
Type OPAQUE is now deprecated in favor of pseudo-types cstring, trigger, etc
Standalone composite types can now be created with CREATE TYPE
...
...
src/backend/libpq/auth.c
浏览文件 @
5241a625
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.8
5 2002/08/27 16:21:50 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.8
6 2002/08/29 03:22:01 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -37,11 +37,8 @@
static
void
sendAuthRequest
(
Port
*
port
,
AuthRequest
areq
);
static
int
old_be_recvauth
(
Port
*
port
);
static
int
map_old_to_new
(
Port
*
port
,
UserAuth
old
,
int
status
);
static
void
auth_failed
(
Port
*
port
,
int
status
);
static
int
recv_and_check_password_packet
(
Port
*
port
);
static
int
recv_and_check_passwordv0
(
Port
*
port
);
char
*
pg_krb_server_keyfile
;
...
...
@@ -318,86 +315,6 @@ pg_krb5_recvauth(Port *port)
#endif
/* KRB5 */
/*
* Handle a v0 password packet.
*/
static
int
recv_and_check_passwordv0
(
Port
*
port
)
{
int32
len
;
char
*
buf
;
PasswordPacketV0
*
pp
;
char
*
user
,
*
password
,
*
cp
,
*
start
;
int
status
;
if
(
pq_getint
(
&
len
,
4
)
==
EOF
)
return
STATUS_EOF
;
len
-=
4
;
buf
=
palloc
(
len
);
if
(
pq_getbytes
(
buf
,
len
)
==
EOF
)
{
pfree
(
buf
);
return
STATUS_EOF
;
}
pp
=
(
PasswordPacketV0
*
)
buf
;
/*
* The packet is supposed to comprise the user name and the password
* as C strings. Be careful to check that this is the case.
*/
user
=
password
=
NULL
;
len
-=
sizeof
(
pp
->
unused
);
cp
=
start
=
pp
->
data
;
while
(
len
--
>
0
)
if
(
*
cp
++
==
'\0'
)
{
if
(
user
==
NULL
)
user
=
start
;
else
{
password
=
start
;
break
;
}
start
=
cp
;
}
if
(
user
==
NULL
||
password
==
NULL
)
{
elog
(
LOG
,
"pg_password_recvauth: badly formed password packet"
);
status
=
STATUS_ERROR
;
}
else
{
UserAuth
saved
;
/* Check the password. */
saved
=
port
->
auth_method
;
port
->
auth_method
=
uaPassword
;
status
=
md5_crypt_verify
(
port
,
user
,
password
);
port
->
auth_method
=
saved
;
/* Adjust the result if necessary. */
if
(
map_old_to_new
(
port
,
uaPassword
,
status
)
!=
STATUS_OK
)
status
=
STATUS_ERROR
;
}
pfree
(
buf
);
return
status
;
}
/*
* Tell the user the authentication failed, but not (much about) why.
*
...
...
@@ -481,16 +398,6 @@ ClientAuthentication(Port *port)
if
(
hba_getauthmethod
(
port
)
!=
STATUS_OK
)
elog
(
FATAL
,
"Missing or erroneous pg_hba.conf file, see postmaster log for details"
);
/* Handle old style authentication. */
if
(
PG_PROTOCOL_MAJOR
(
port
->
proto
)
==
0
)
{
status
=
old_be_recvauth
(
port
);
if
(
status
!=
STATUS_OK
)
auth_failed
(
port
,
status
);
return
;
}
/* Handle new style authentication. */
switch
(
port
->
auth_method
)
{
case
uaReject
:
...
...
@@ -828,90 +735,3 @@ recv_and_check_password_packet(Port *port)
pfree
(
buf
.
data
);
return
result
;
}
/*
* Server demux routine for incoming authentication information for protocol
* version 0.
*/
static
int
old_be_recvauth
(
Port
*
port
)
{
int
status
;
MsgType
msgtype
=
(
MsgType
)
port
->
proto
;
/* Handle the authentication that's offered. */
switch
(
msgtype
)
{
case
STARTUP_KRB4_MSG
:
status
=
map_old_to_new
(
port
,
uaKrb4
,
pg_krb4_recvauth
(
port
));
break
;
case
STARTUP_KRB5_MSG
:
status
=
map_old_to_new
(
port
,
uaKrb5
,
pg_krb5_recvauth
(
port
));
break
;
case
STARTUP_MSG
:
status
=
map_old_to_new
(
port
,
uaTrust
,
STATUS_OK
);
break
;
case
STARTUP_PASSWORD_MSG
:
status
=
recv_and_check_passwordv0
(
port
);
break
;
default:
elog
(
LOG
,
"Invalid startup message type: %u"
,
msgtype
);
return
STATUS_ERROR
;
}
return
status
;
}
/*
* The old style authentication has been done. Modify the result of this (eg.
* allow the connection anyway, disallow it anyway, or use the result)
* depending on what authentication we really want to use.
*/
static
int
map_old_to_new
(
Port
*
port
,
UserAuth
old
,
int
status
)
{
switch
(
port
->
auth_method
)
{
case
uaMD5
:
case
uaCrypt
:
case
uaReject
:
#ifdef USE_PAM
case
uaPAM
:
#endif
/* USE_PAM */
status
=
STATUS_ERROR
;
break
;
case
uaKrb4
:
if
(
old
!=
uaKrb4
)
status
=
STATUS_ERROR
;
break
;
case
uaKrb5
:
if
(
old
!=
uaKrb5
)
status
=
STATUS_ERROR
;
break
;
case
uaTrust
:
status
=
STATUS_OK
;
break
;
case
uaIdent
:
status
=
authident
(
port
);
break
;
case
uaPassword
:
if
(
old
!=
uaPassword
)
status
=
STATUS_ERROR
;
break
;
}
return
status
;
}
src/backend/libpq/pqformat.c
浏览文件 @
5241a625
...
...
@@ -16,7 +16,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pqformat.c,v 1.2
2 2002/08/08 06:32:26 ishii
Exp $
* $Id: pqformat.c,v 1.2
3 2002/08/29 03:22:01 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -57,41 +57,6 @@
#include <endian.h>
#endif
#ifndef BYTE_ORDER
#error BYTE_ORDER must be defined as LITTLE_ENDIAN, BIG_ENDIAN or PDP_ENDIAN
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
#define ntoh_s(n) n
#define ntoh_l(n) n
#define hton_s(n) n
#define hton_l(n) n
#else
#if BYTE_ORDER == BIG_ENDIAN
#define ntoh_s(n) (uint16)((((uint16)n & 0x00ff) << 8) | \
(((uint16)n & 0xff00) >> 8))
#define ntoh_l(n) (uint32)((((uint32)n & 0x000000ff) << 24) | \
(((uint32)n & 0x0000ff00) << 8) | \
(((uint32)n & 0x00ff0000) >> 8) | \
(((uint32)n & 0xff000000) >> 24))
#define hton_s(n) (ntoh_s(n))
#define hton_l(n) (ntoh_l(n))
#else
#if BYTE_ORDER == PDP_ENDIAN
#error PDP_ENDIAN macros not written yet
#else
#error BYTE_ORDER not defined as anything understood
#endif
#endif
#endif
/* --------------------------------
* pq_sendbyte - append a raw byte to a StringInfo buffer
...
...
@@ -183,11 +148,11 @@ pq_sendint(StringInfo buf, int i, int b)
appendBinaryStringInfo
(
buf
,
(
char
*
)
&
n8
,
1
);
break
;
case
2
:
n16
=
((
PG_PROTOCOL_MAJOR
(
FrontendProtocol
)
==
0
)
?
hton_s
(
i
)
:
htons
((
uint16
)
i
)
);
n16
=
htons
((
uint16
)
i
);
appendBinaryStringInfo
(
buf
,
(
char
*
)
&
n16
,
2
);
break
;
case
4
:
n32
=
((
PG_PROTOCOL_MAJOR
(
FrontendProtocol
)
==
0
)
?
hton_l
(
i
)
:
htonl
((
uint32
)
i
)
);
n32
=
htonl
((
uint32
)
i
);
appendBinaryStringInfo
(
buf
,
(
char
*
)
&
n32
,
4
);
break
;
default:
...
...
@@ -261,13 +226,11 @@ pq_getint(int *result, int b)
break
;
case
2
:
status
=
pq_getbytes
((
char
*
)
&
n16
,
2
);
*
result
=
(
int
)
((
PG_PROTOCOL_MAJOR
(
FrontendProtocol
)
==
0
)
?
ntoh_s
(
n16
)
:
ntohs
(
n16
));
*
result
=
(
int
)
(
ntohs
(
n16
));
break
;
case
4
:
status
=
pq_getbytes
((
char
*
)
&
n32
,
4
);
*
result
=
(
int
)
((
PG_PROTOCOL_MAJOR
(
FrontendProtocol
)
==
0
)
?
ntoh_l
(
n32
)
:
ntohl
(
n32
));
*
result
=
(
int
)
(
ntohl
(
n32
));
break
;
default:
...
...
src/include/libpq/libpq-be.h
浏览文件 @
5241a625
...
...
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: libpq-be.h,v 1.3
3 2002/08/18 03:03:26 momjian
Exp $
* $Id: libpq-be.h,v 1.3
4 2002/08/29 03:22:01 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -29,17 +29,8 @@
#endif
/* Protocol v0 password packet. */
typedef
struct
PasswordPacketV0
{
uint32
unused
;
char
data
[
288
];
/* User and password as strings. */
}
PasswordPacketV0
;
/*
* This is used by the postmaster in its communication with frontends. It
is
* This is used by the postmaster in its communication with frontends. It
* contains all state information needed during this communication before the
* backend is run.
*/
...
...
src/include/libpq/pqcomm.h
浏览文件 @
5241a625
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.h,v 1.6
8 2002/08/27 16:21:51 momjian
Exp $
* $Id: pqcomm.h,v 1.6
9 2002/08/29 03:22:01 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -93,7 +93,7 @@ typedef union SockAddr
/* The earliest and latest frontend/backend protocol version supported. */
#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(
0
,0)
#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(
1
,0)
#define PG_PROTOCOL_LATEST PG_PROTOCOL(2,0)
/*
...
...
@@ -127,6 +127,9 @@ typedef uint32 PacketLen;
typedef
uint32
ProtocolVersion
;
/* Fe/Be protocol version number */
typedef
ProtocolVersion
MsgType
;
typedef
struct
StartupPacket
{
ProtocolVersion
protoVersion
;
/* Protocol version */
...
...
@@ -153,16 +156,6 @@ extern bool Db_user_namespace;
typedef
uint32
AuthRequest
;
/* This next section is to maintain compatibility with protocol v0.0. */
#define STARTUP_MSG 7
/* Initialise a connection */
#define STARTUP_KRB4_MSG 10
/* krb4 session follows */
#define STARTUP_KRB5_MSG 11
/* krb5 session follows */
#define STARTUP_PASSWORD_MSG 14
/* Password follows */
typedef
ProtocolVersion
MsgType
;
/* A client can also send a cancel-current-operation request to the postmaster.
* This is uglier than sending it directly to the client's backend, but it
* avoids depending on out-of-band communication facilities.
...
...
src/interfaces/libpq/fe-auth.c
浏览文件 @
5241a625
...
...
@@ -10,7 +10,7 @@
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.6
8 2002/07/20 05:43:31 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.6
9 2002/08/29 03:22:01 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -63,6 +63,11 @@
* common definitions for generic fe/be routines
*/
#define STARTUP_MSG 7
/* Initialise a connection */
#define STARTUP_KRB4_MSG 10
/* krb4 session follows */
#define STARTUP_KRB5_MSG 11
/* krb5 session follows */
#define STARTUP_PASSWORD_MSG 14
/* Password follows */
struct
authsvc
{
const
char
*
name
;
/* service nickname (for command line) */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录