Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7258176c
Kaydet (Commit)
7258176c
authored
Nis 12, 2016
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.5 (os.urandom)
üst
328cb1fe
1b80b240
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
NEWS
Misc/NEWS
+4
-0
random.c
Python/random.c
+12
-5
configure
configure
+1
-0
configure.ac
configure.ac
+0
-0
No files found.
Misc/NEWS
Dosyayı görüntüle @
7258176c
...
...
@@ -240,6 +240,10 @@ Core and Builtins
Library
-------
-
Issue
#
26735
:
Fix
:
func
:`
os
.
urandom
`
on
Solaris
11.3
and
newer
when
reading
more
than
1
,
024
bytes
:
call
``
getrandom
()``
multiple
times
with
a
limit
of
1024
bytes
per
call
.
-
Issue
#
26585
:
Eliminate
http
.
server
.
_quote_html
()
and
use
html
.
escape
(
quote
=
False
).
Patch
by
Xiang
Zhang
.
...
...
Python/random.c
Dosyayı görüntüle @
7258176c
...
...
@@ -131,16 +131,23 @@ py_getrandom(void *buffer, Py_ssize_t size, int raise)
return
0
;
while
(
0
<
size
)
{
errno
=
0
;
#ifdef sun
/* Issue #26735: On Solaris, getrandom() is limited to returning up
to 1024 bytes */
n
=
Py_MIN
(
size
,
1024
);
#else
n
=
size
;
#endif
errno
=
0
;
#ifdef HAVE_GETRANDOM
if
(
raise
)
{
Py_BEGIN_ALLOW_THREADS
n
=
getrandom
(
buffer
,
size
,
flags
);
n
=
getrandom
(
buffer
,
n
,
flags
);
Py_END_ALLOW_THREADS
}
else
{
n
=
getrandom
(
buffer
,
size
,
flags
);
n
=
getrandom
(
buffer
,
n
,
flags
);
}
#else
/* On Linux, use the syscall() function because the GNU libc doesn't
...
...
@@ -148,11 +155,11 @@ py_getrandom(void *buffer, Py_ssize_t size, int raise)
* https://sourceware.org/bugzilla/show_bug.cgi?id=17252 */
if
(
raise
)
{
Py_BEGIN_ALLOW_THREADS
n
=
syscall
(
SYS_getrandom
,
buffer
,
size
,
flags
);
n
=
syscall
(
SYS_getrandom
,
buffer
,
n
,
flags
);
Py_END_ALLOW_THREADS
}
else
{
n
=
syscall
(
SYS_getrandom
,
buffer
,
size
,
flags
);
n
=
syscall
(
SYS_getrandom
,
buffer
,
n
,
flags
);
}
#endif
...
...
configure
Dosyayı görüntüle @
7258176c
...
...
@@ -16276,6 +16276,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <unistd.h>
#include <sys/syscall.h>
int main() {
...
...
configure.ac
Dosyayı görüntüle @
7258176c
This diff is collapsed.
Click to expand it.
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