Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
8d7952fd
Commit
8d7952fd
authored
23 years ago
by
D'Arcy J.M. Cain
Browse files
Options
Downloads
Patches
Plain Diff
Further conversions to Version 1 API. Also, fix boolean return to use
PG_RETURN_BOOL(0) instead of return 0.
parent
d34a5d8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/chkpass/chkpass.c
+7
-7
7 additions, 7 deletions
contrib/chkpass/chkpass.c
with
7 additions
and
7 deletions
contrib/chkpass/chkpass.c
+
7
−
7
View file @
8d7952fd
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* darcy@druid.net
* darcy@druid.net
* http://www.druid.net/darcy/
* http://www.druid.net/darcy/
*
*
* $Id: chkpass.c,v 1.
3
2001/05/
28 15:34:27
darcy Exp $
* $Id: chkpass.c,v 1.
4
2001/05/
30 02:11:46
darcy Exp $
* best viewed with tabs set to 4
* best viewed with tabs set to 4
*/
*/
...
@@ -75,14 +75,14 @@ chkpass_in(PG_FUNCTION_ARGS)
...
@@ -75,14 +75,14 @@ chkpass_in(PG_FUNCTION_ARGS)
result
=
(
chkpass
*
)
palloc
(
sizeof
(
chkpass
));
result
=
(
chkpass
*
)
palloc
(
sizeof
(
chkpass
));
strncpy
(
result
->
password
,
str
+
1
,
13
);
strncpy
(
result
->
password
,
str
+
1
,
13
);
result
->
password
[
13
]
=
0
;
result
->
password
[
13
]
=
0
;
return
PointerGetDatum
(
result
);
PG_RETURN_POINTER
(
result
);
}
}
if
(
verify_pass
(
str
)
!=
0
)
if
(
verify_pass
(
str
)
!=
0
)
{
{
elog
(
ERROR
,
"chkpass_in: purported CHKPASS
\"
%s
\"
is a weak password"
,
elog
(
ERROR
,
"chkpass_in: purported CHKPASS
\"
%s
\"
is a weak password"
,
str
);
str
);
return
PointerGetDatum
(
NULL
);
PG_RETURN_POINTER
(
NULL
);
}
}
result
=
(
chkpass
*
)
palloc
(
sizeof
(
chkpass
));
result
=
(
chkpass
*
)
palloc
(
sizeof
(
chkpass
));
...
@@ -98,7 +98,7 @@ chkpass_in(PG_FUNCTION_ARGS)
...
@@ -98,7 +98,7 @@ chkpass_in(PG_FUNCTION_ARGS)
mysalt
[
2
]
=
0
;
/* technically the terminator is not
mysalt
[
2
]
=
0
;
/* technically the terminator is not
* necessary but I like to play safe */
* necessary but I like to play safe */
strcpy
(
result
->
password
,
crypt
(
str
,
mysalt
));
strcpy
(
result
->
password
,
crypt
(
str
,
mysalt
));
return
PointerGetDatum
(
result
);
PG_RETURN_POINTER
(
result
);
}
}
/*
/*
...
@@ -114,7 +114,7 @@ chkpass_out(PG_FUNCTION_ARGS)
...
@@ -114,7 +114,7 @@ chkpass_out(PG_FUNCTION_ARGS)
char
*
result
;
char
*
result
;
if
(
password
==
NULL
)
if
(
password
==
NULL
)
return
PointerGetDatum
(
NULL
);
PG_RETURN_POINTER
(
NULL
);
if
((
result
=
(
char
*
)
palloc
(
16
))
!=
NULL
)
if
((
result
=
(
char
*
)
palloc
(
16
))
!=
NULL
)
{
{
...
@@ -138,7 +138,7 @@ chkpass_rout(PG_FUNCTION_ARGS)
...
@@ -138,7 +138,7 @@ chkpass_rout(PG_FUNCTION_ARGS)
text
*
result
=
NULL
;
text
*
result
=
NULL
;
if
(
password
==
NULL
)
if
(
password
==
NULL
)
return
PointerGetDatum
(
NULL
);
PG_RETURN_POINTER
(
NULL
);
if
((
result
=
(
text
*
)
palloc
(
VARHDRSZ
+
16
))
!=
NULL
)
if
((
result
=
(
text
*
)
palloc
(
VARHDRSZ
+
16
))
!=
NULL
)
{
{
...
@@ -181,7 +181,7 @@ chkpass_ne(PG_FUNCTION_ARGS)
...
@@ -181,7 +181,7 @@ chkpass_ne(PG_FUNCTION_ARGS)
char
str
[
10
];
char
str
[
10
];
int
sz
=
8
;
int
sz
=
8
;
if
(
!
a1
||
!
a2
)
return
0
;
if
(
!
a1
||
!
a2
)
PG_RETURN_BOOL
(
0
)
;
if
(
a2
->
vl_len
<
12
)
sz
=
a2
->
vl_len
-
4
;
if
(
a2
->
vl_len
<
12
)
sz
=
a2
->
vl_len
-
4
;
strncpy
(
str
,
a2
->
vl_dat
,
sz
);
strncpy
(
str
,
a2
->
vl_dat
,
sz
);
str
[
sz
]
=
0
;
str
[
sz
]
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment