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

Commit924123a

Browse files
committed
passwordcheck: Log cracklib diagnostics
When calling cracklib to check the password, the diagnostic fromcracklib was thrown away. This would hide essential information suchas no dictionary being installed. Change this to show the crackliberror message using errdetail_log().Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>Discussion:https://www.postgresql.org/message-id/flat/f7266133-618a-0adc-52ef-f43c78806b0e%402ndquadrant.com
1 parent10564ee commit924123a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎contrib/passwordcheck/passwordcheck.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ check_password(const char *username,
9191
inti;
9292
boolpwd_has_letter,
9393
pwd_has_nonletter;
94+
#ifdefUSE_CRACKLIB
95+
constchar*reason;
96+
#endif
9497

9598
/* enforce minimum length */
9699
if (pwdlen<MIN_PWD_LENGTH)
@@ -125,10 +128,11 @@ check_password(const char *username,
125128

126129
#ifdefUSE_CRACKLIB
127130
/* call cracklib to check password */
128-
if (FascistCheck(password,CRACKLIB_DICTPATH))
131+
if ((reason=FascistCheck(password,CRACKLIB_DICTPATH)))
129132
ereport(ERROR,
130133
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
131-
errmsg("password is easily cracked")));
134+
errmsg("password is easily cracked"),
135+
errdetail_log("cracklib diagnostic: %s",reason)));
132136
#endif
133137
}
134138

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp