Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6cdba03d
Commit
6cdba03d
authored
Apr 25, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix password code to deal with new quoting code.
parent
39e77dd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
src/backend/libpq/crypt.c
src/backend/libpq/crypt.c
+16
-8
src/backend/libpq/hba.c
src/backend/libpq/hba.c
+5
-5
No files found.
src/backend/libpq/crypt.c
View file @
6cdba03d
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/libpq/crypt.c,v 1.4
5 2002/04/04 04:25:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/crypt.c,v 1.4
6 2002/04/25 00:56:36
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -31,18 +31,26 @@
int
md5_crypt_verify
(
const
Port
*
port
,
const
char
*
user
,
const
char
*
pgpass
)
{
char
*
passwd
,
*
valuntil
,
char
*
passwd
=
NULL
,
*
valuntil
=
NULL
,
*
crypt_pwd
;
int
retval
=
STATUS_ERROR
;
List
**
line
;
List
*
token
;
if
((
line
=
get_user_line
(
user
))
==
NULL
)
return
STATUS_ERROR
;
passwd
=
lfirst
(
lnext
(
lnext
(
*
line
)));
valuntil
=
lfirst
(
lnext
(
lnext
(
lnext
(
*
line
))));
/* Skip over line number and username */
token
=
lnext
(
lnext
(
*
line
));
if
(
token
)
{
passwd
=
lfirst
(
token
);
token
=
lnext
(
token
);
if
(
token
)
valuntil
=
lfirst
(
token
);
}
if
(
passwd
==
NULL
||
*
passwd
==
'\0'
)
{
if
(
passwd
)
...
...
@@ -120,7 +128,7 @@ md5_crypt_verify(const Port *port, const char *user, const char *pgpass)
AbsoluteTime
vuntil
,
current
;
if
(
!
valuntil
||
strcmp
(
valuntil
,
"
\\
N"
)
==
0
)
if
(
!
valuntil
)
vuntil
=
INVALID_ABSTIME
;
else
vuntil
=
DatumGetAbsoluteTime
(
DirectFunctionCall1
(
nabstimein
,
...
...
src/backend/libpq/hba.c
View file @
6cdba03d
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.8
1 2002/04/04 04:25:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.8
2 2002/04/25 00:56:36
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -109,9 +109,6 @@ next_token(FILE *fp, char *buf, const int bufsz)
while
(
c
!=
EOF
&&
c
!=
'\n'
&&
(
!
isblank
(
c
)
||
in_quote
==
true
))
{
if
(
c
==
'"'
)
in_quote
=
!
in_quote
;
/* skip comments to EOL */
if
(
c
==
'#'
&&
!
in_quote
)
{
...
...
@@ -138,11 +135,14 @@ next_token(FILE *fp, char *buf, const int bufsz)
break
;
/* Literal double-quote is two double-quotes */
if
(
c
==
'"'
)
if
(
in_quote
&&
c
==
'"'
)
was_quote
=
!
was_quote
;
else
was_quote
=
false
;
if
(
c
==
'"'
)
in_quote
=
!
in_quote
;
c
=
getc
(
fp
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment