Skip to content

Commit f637edc

Browse files
committed
Merge branch 'pgmaster' into replica_twophase_II
2 parents 525f714 + 93513d1 commit f637edc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1592
-880
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15022,7 +15022,7 @@ fi
1502215022
if test "$enable_strong_random" = "yes" && test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
1502315023
if test x"$with_openssl" = x"yes" ; then
1502415024
USE_OPENSSL_RANDOM=1
15025-
elif test "$PORTNAME" = x"win32" ; then
15025+
elif test "$PORTNAME" = "win32" ; then
1502615026
USE_WIN32_RANDOM=1
1502715027
else
1502815028
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/urandom" >&5

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ fi
19811981
if test "$enable_strong_random" = "yes" && test x"$USE_OPENSSL_RANDOM" = x"" && test x"$USE_WIN32_RANDOM" = x"" && test x"$USE_DEV_URANDOM" = x"" ; then
19821982
if test x"$with_openssl" = x"yes" ; then
19831983
USE_OPENSSL_RANDOM=1
1984-
elif test "$PORTNAME" = x"win32" ; then
1984+
elif test "$PORTNAME" = "win32" ; then
19851985
USE_WIN32_RANDOM=1
19861986
else
19871987
AC_CHECK_FILE([/dev/urandom], [], [])

contrib/chkpass/chkpass.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#endif
1818

1919
#include "fmgr.h"
20+
#include "utils/backend_random.h"
2021
#include "utils/builtins.h"
2122

2223
PG_MODULE_MAGIC;
@@ -77,8 +78,12 @@ chkpass_in(PG_FUNCTION_ARGS)
7778

7879
result = (chkpass *) palloc0(sizeof(chkpass));
7980

80-
mysalt[0] = salt_chars[random() & 0x3f];
81-
mysalt[1] = salt_chars[random() & 0x3f];
81+
if (!pg_backend_random(mysalt, 2))
82+
ereport(ERROR,
83+
(errmsg("could not generate random salt")));
84+
85+
mysalt[0] = salt_chars[mysalt[0] & 0x3f];
86+
mysalt[1] = salt_chars[mysalt[1] & 0x3f];
8287
mysalt[2] = 0; /* technically the terminator is not necessary
8388
* but I like to play safe */
8489

0 commit comments

Comments
 (0)