[pypy-commit] pypy py3.6-sandbox-2: hg merge sandbox-2

arigo pypy.commits at gmail.com
Tue Aug 27 06:03:43 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.6-sandbox-2
Changeset: r97299:1c3f982ecaec
Date: 2019-08-27 11:26 +0200
http://bitbucket.org/pypy/pypy/changeset/1c3f982ecaec/

Log:	hg merge sandbox-2

diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -5,7 +5,7 @@
 
 import os, stat, errno, sys
 from rpython.rlib import rposix, rgc
-from rpython.rlib.objectmodel import enforceargs
+from rpython.rlib.objectmodel import enforceargs, sandbox_review
 from rpython.rlib.rarithmetic import intmask
 from rpython.rlib.rstring import StringBuilder
 from rpython.rtyper.lltypesystem import rffi, lltype
@@ -242,6 +242,7 @@
     _newlinetypes = NEWLINE_UNKNOWN
     _skipnextlf = False
 
+    @sandbox_review(check_caller=True)
     def __init__(self, ll_file, mode=None, close2=_fclose2):
         self._ll_file = ll_file
         if mode is not None:
@@ -548,6 +549,7 @@
                 c_ungetc(c, self._ll_file)
         return res
 
+    @sandbox_review(reviewed=True)
     def fileno(self):
         self._check_closed()
         return intmask(c_fileno(self._ll_file))
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -570,6 +570,7 @@
                        save_err=rffi.RFFI_SAVE_ERRNO)
 
     @enforceargs(int, int, None)
+    @sandbox_review(reviewed=True)
     def pread(fd, count, offset):
         if count < 0:
             raise OSError(errno.EINVAL, None)
@@ -578,6 +579,7 @@
             return buf.str(handle_posix_error('pread', c_pread(fd, void_buf, count, offset)))
 
     @enforceargs(int, None, None)
+    @sandbox_review(reviewed=True)
     def pwrite(fd, data, offset):
         count = len(data)
         with rffi.scoped_nonmovingbuffer(data) as buf:
@@ -2343,6 +2345,7 @@
         [rffi.INT, rffi.CCHARP, rffi.CCHARP, rffi.SIZE_T], rffi.SSIZE_T,
         save_err=rffi.RFFI_SAVE_ERRNO)
 
+    @sandbox_review(reviewed=True)
     def readlinkat(pathname, dir_fd=AT_FDCWD):
         pathname = _as_bytes0(pathname)
         bufsize = 1023
@@ -2683,6 +2686,7 @@
             res = c_sendfile(out_fd, in_fd, p_offset, count)
         return handle_posix_error('sendfile', res)
 
+    @sandbox_review(reviewed=True)
     def sendfile_no_offset(out_fd, in_fd, count):
         """Passes offset==NULL; not support on all OSes"""
         res = c_sendfile(out_fd, in_fd, lltype.nullptr(_OFF_PTR_T.TO), count)
diff --git a/rpython/rlib/rposix_scandir.py b/rpython/rlib/rposix_scandir.py
--- a/rpython/rlib/rposix_scandir.py
+++ b/rpython/rlib/rposix_scandir.py
@@ -1,5 +1,5 @@
 from rpython.rlib import rposix, rwin32
-from rpython.rlib.objectmodel import specialize
+from rpython.rlib.objectmodel import specialize, sandbox_review
 from rpython.rtyper.lltypesystem import lltype, rffi
 from rpython.rlib.rarithmetic import intmask
 
@@ -16,11 +16,13 @@
             raise OSError(rposix.get_saved_errno(), "opendir failed")
         return dirp
 
+    @sandbox_review(check_caller=True)
     def closedir(dirp):
         rposix.c_closedir(dirp)
 
     NULL_DIRP = lltype.nullptr(rposix.DIRP.TO)
 
+    @sandbox_review(check_caller=True)
     def nextentry(dirp):
         """Read the next entry and returns an opaque object.
         Use the methods has_xxx() and get_xxx() to read from that
diff --git a/rpython/rlib/rposix_stat.py b/rpython/rlib/rposix_stat.py
--- a/rpython/rlib/rposix_stat.py
+++ b/rpython/rlib/rposix_stat.py
@@ -633,6 +633,7 @@
         compilation_info=compilation_info,
         save_err=rffi.RFFI_SAVE_ERRNO, macro=True)
 
+    @sandbox_review(reviewed=True)
     def fstatat(pathname, dir_fd=AT_FDCWD, follow_symlinks=True):
         if follow_symlinks:
             flags = 0


More information about the pypy-commit mailing list