Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
c6e7baa7
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,发现更多精彩内容 >>
提交
c6e7baa7
编写于
8月 25, 1997
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pg_passwd cleanup
上级
f8fda03d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
207 addition
and
71 deletion
+207
-71
README
README
+0
-69
src/bin/Makefile
src/bin/Makefile
+2
-2
src/bin/pg_passwd/Makefile
src/bin/pg_passwd/Makefile
+20
-0
src/bin/pg_passwd/README
src/bin/pg_passwd/README
+111
-0
src/bin/pg_passwd/pg_passwd.c
src/bin/pg_passwd/pg_passwd.c
+74
-0
未找到文件。
README
浏览文件 @
c6e7baa7
The pathces and a prototype tool to manipulate the ``flat password file
'' functionality of PostgreSQL6.1
1. File
Makefile
pg_passwd.c the source file of the tool.
2. How to specify pasword files and their format.
Specify the password file in the same style of Ident authentication in
$PGDATA/pg_hba.conf
host unv 133.65.96.250 255.255.255.255 password passwd
The above line allows access from 133.65.96.250 using the passwords listed
in $PGDATA/passwd.
The format of the password files follows those of /etc/passwd and
/etc/shadow: the first field is the user name, and the second field
is the encrypted password. The rest is completely ignored. Thus
the following three sample lines specify the same user and password pair:.
pg_guest:/nB7.w5Auq.BY:10031::::::
pg_guest:/nB7.w5Auq.BY:93001:930::/home/guest:/bin/tcsh
pg_guest:/nB7.w5Auq.BY:93001
Note that the original src/backend/libpq/password.c has a bug, which
disallows the first and the second format. If you want to use these
formats, please make sure you've applied the patch accompanied with
this tool.
3. Usage of pg_passwd
Supply the password file to the pg_passwd command. In the case described
above, after ``cd'ing to $PGDATA, the following command execution specify
the new password for pg_guest:
% pg_passwd passwd
Username: pg_guest
Password:
Re-enter password:
where the Password: and Re-enter password: prompts require the same
password input which are not displayed on the terminal.
The original password file is renamed to ``passwd.bk''.
4. How to specify pasasword authentication
You can use the password authentication fro psq, perl, or pg{tcl,tk}sh.
4.1 psql
Use the -u option. Note that the original distribution includes a bug.
Please make sure you've applied the patch distributed with this tool.
The following lines show the sample usage of the option:
% psql -h hyalos -u unv
Username: pg_guest
Password:
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: unv
unv=>
4.2 perl5
Use the new style of the Pg.pm like this
$conn = Pg::connectdb("host=hyalos authtype=password dbname=unv
user=pg_guest password=xxxxxxx");
For more details, the users refer to to ``src/pgsql_perl5/Pg.pm''.
4.3 pg{tcl,tk}sh
Use the pg_connect comamnd with -conninfo option thus
% set conn [pg_connect -conninfo \
"host=hyalos authtype=password dbname=unv \
user=pg_guest password=xxxxxxx "]
Use can list all of the keys for the option by executing the following
command:
% puts [ pg_conndefaults]
5. Acknowledgment
Mr. Ishii, SRA, pointed out the original bugs in the tool. He also
supplied the Makefile for this distribution.
-------------------------------------------------------------------------
July 2, 1997
Yoshihiko Ichikawa, Dept of Info Sci, Fac of Sci, Ochanomizu University
E-mail: ichikawa@is.ocha.ac.jp
PostgreSQL Data Base Management System (formerly known as Postgres, then
as Postgres95).
...
...
src/bin/Makefile
浏览文件 @
c6e7baa7
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.
8 1997/08/25 19:41:39
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/Makefile,v 1.
9 1997/08/25 19:59:52
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -21,7 +21,7 @@
$(MAKE)
-C
pg_version
$@
$(MAKE)
-C
psql
$@
$(MAKE)
-C
pg_dump
$@
$(MAKE)
-C
pg_passwd
$@
$(MAKE)
-C
pg_passwd
$@
#
# Shell scripts
#
...
...
src/bin/pg_passwd/Makefile
0 → 100644
浏览文件 @
c6e7baa7
#-------------------------------------------------------------------------
#
# Makefile
# Makefile for bin/pg_passwd
#-------------------------------------------------------------------------
SRCDIR
=
../..
include
../../Makefile.global
OBJS
=
pg_passwd.o
all
:
pg_passwd
pg_passwd
:
$(OBJS)
$(CC)
-o
pg_passwd
$(OBJS)
$(LDFLAGS)
install
:
pg_passwd
$(INSTALL)
$(INSTL_EXE_OPTS)
pg_passwd
$(DESTDIR)$(BINDIR)/pg_passwd
depend dep
:
$(CC)
-MM
$(INCLUDE_OPT)
*.c
>depend
clean
:
rm
-f
pg_passwd
$(OBJS)
ifeq
(depend,$(wildcard depend))
include
depend
endif
src/bin/pg_passwd/README
0 → 100644
浏览文件 @
c6e7baa7
The pathces and a prototype tool to manipulate the ``flat password file
'' functionality of PostgreSQL6.1
1. File
Makefile
pg_passwd.c the source file of the tool.
2. How to specify pasword files and their format.
Specify the password file in the same style of Ident authentication in
$PGDATA/pg_hba.conf
host unv 133.65.96.250 255.255.255.255 password passwd
The above line allows access from 133.65.96.250 using the passwords listed
in $PGDATA/passwd.
The format of the password files follows those of /etc/passwd and
/etc/shadow: the first field is the user name, and the second field
is the encrypted password. The rest is completely ignored. Thus
the following three sample lines specify the same user and password pair:.
pg_guest:/nB7.w5Auq.BY:10031::::::
pg_guest:/nB7.w5Auq.BY:93001:930::/home/guest:/bin/tcsh
pg_guest:/nB7.w5Auq.BY:93001
Note that the original src/backend/libpq/password.c has a bug, which
disallows the first and the second format. If you want to use these
formats, please make sure you've applied the patch accompanied with
this tool.
3. Usage of pg_passwd
Supply the password file to the pg_passwd command. In the case described
above, after ``cd'ing to $PGDATA, the following command execution specify
the new password for pg_guest:
% pg_passwd passwd
Username: pg_guest
Password:
Re-enter password:
where the Password: and Re-enter password: prompts require the same
password input which are not displayed on the terminal.
The original password file is renamed to ``passwd.bk''.
4. How to specify pasasword authentication
You can use the password authentication fro psq, perl, or pg{tcl,tk}sh.
4.1 psql
Use the -u option. Note that the original distribution includes a bug.
Please make sure you've applied the patch distributed with this tool.
The following lines show the sample usage of the option:
% psql -h hyalos -u unv
Username: pg_guest
Password:
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: unv
unv=>
4.2 perl5
Use the new style of the Pg.pm like this
$conn = Pg::connectdb("host=hyalos authtype=password dbname=unv
user=pg_guest password=xxxxxxx");
For more details, the users refer to to ``src/pgsql_perl5/Pg.pm''.
4.3 pg{tcl,tk}sh
Use the pg_connect comamnd with -conninfo option thus
% set conn [pg_connect -conninfo \
"host=hyalos authtype=password dbname=unv \
user=pg_guest password=xxxxxxx "]
Use can list all of the keys for the option by executing the following
command:
% puts [ pg_conndefaults]
5. Acknowledgment
Mr. Ishii, SRA, pointed out the original bugs in the tool. He also
supplied the Makefile for this distribution.
-------------------------------------------------------------------------
July 2, 1997
Yoshihiko Ichikawa, Dept of Info Sci, Fac of Sci, Ochanomizu University
E-mail: ichikawa@is.ocha.ac.jp
PostgreSQL Data Base Management System (formerly known as Postgres, then
as Postgres95).
This directory contains the version 6.1 release of the PostgreSQL
database server. The server is not ANSI SQL compliant, but it gets
closer with every release. After you unzip and untar the distribution
file, look at file INSTALL for the installation notes and file HISTORY
for the changes.
The latest version of this software may be obtained at
ftp://ftp.postgresql.org/pub/. For more information look at our WWW
home page located at http://www.postgreSQL.org/.
PostgreSQL is not public domain software. It is copyrighted by the
University of California but may be used according to the licensing
terms of the the copyright below:
------------------------------------------------------------------------
POSTGRES95 Data Base Management System (formerly known as Postgres, then
as Postgres95).
Copyright (c) 1994-7 Regents of the University of California
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
src/bin/pg_passwd/pg_passwd.c
0 → 100644
浏览文件 @
c6e7baa7
/*
* @(#) pg_passwd.c 1.8 09:13:16 97/07/02 Y. Ichikawa
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>
#include <ctype.h>
#define issaltchar(c) (isalnum(c) || (c) == '.' || (c) == '/')
#include "postgres.h"
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#else
extern
char
*
crypt
(
const
char
*
,
const
char
*
);
#endif
char
*
comname
;
void
usage
(
FILE
*
stream
);
void
read_pwd_file
(
char
*
filename
);
void
write_pwd_file
(
char
*
filename
,
char
*
bkname
);
void
encrypt_pwd
(
char
key
[
9
],
char
salt
[
3
],
char
passwd
[
14
]);
int
check_pwd
(
char
key
[
9
],
char
passwd
[
14
]);
void
prompt_for_username
(
char
*
username
);
void
prompt_for_password
(
char
*
prompt
,
char
*
password
);
void
usage
(
FILE
*
stream
)
{
fprintf
(
stream
,
"Usage: %s <password file>
\n
"
,
comname
);
}
typedef
struct
{
char
*
uname
;
char
*
pwd
;
char
*
rest
;
}
pg_pwd
;
#define MAXPWDS 1024
pg_pwd
pwds
[
MAXPWDS
];
int
npwds
=
0
;
void
read_pwd_file
(
char
*
filename
)
{
FILE
*
fp
;
static
char
line
[
512
];
static
char
ans
[
128
];
int
i
;
try_again:
fp
=
fopen
(
filename
,
"r"
);
if
(
fp
==
NULL
)
{
if
(
errno
==
ENOENT
)
{
printf
(
"File
\"
%s
\"
does not exist. Create? (y/n): "
,
filename
);
fflush
(
stdout
);
fgets
(
ans
,
128
,
stdin
);
switch
(
ans
[
0
])
{
case
'y'
:
case
'Y'
:
fp
=
fopen
(
filename
,
"w"
);
if
(
fp
==
NULL
)
{
perror
(
filename
);
exit
(
1
);
}
fclose
(
fp
);
goto
try_again
;
default:
/* cannot continue */
exit
(
1
);
}
}
else
{
perror
(
filename
);
exit
(
1
);
}
}
/* read all the entries */
for
(
npwds
=
0
;
npwds
<
MAXPWDS
&&
fgets
(
line
,
512
,
fp
)
!=
NULL
;
++
npwds
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录