]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Merge branch '2.7-maintenance'
authorArmin Ronacher <armin.ronacher@active-4.com>
Fri, 6 Jun 2014 16:51:59 +0000 (22:51 +0600)
committerArmin Ronacher <armin.ronacher@active-4.com>
Fri, 6 Jun 2014 16:51:59 +0000 (22:51 +0600)
1  2 
CHANGES
jinja2/bccache.py
setup.py

diff --cc CHANGES
index b9606f6e8b12e0147e7ee51031b1d4e8b396fad9,0a1022a8d6949a556969800dfb50db12223bb5d6..26bc07e8ea5cc1a7400069676d45cf2e47925a3a
+++ b/CHANGES
@@@ -1,22 -1,13 +1,29 @@@
  Jinja2 Changelog
  ================
  
 +Version 2.8
 +-----------
 +(codename Translation, release date to be decided)
 +
 +- Added `target` parameter to urlize function.
 +- Added support for `followsymlinks` to the file system loader.
 +- The truncate filter now counts the length.
 +- Added equalto filter that helps with select filters.
 +- Changed cache keys to use absolute file names if available
 +  instead of load names.
 +- Fixed loop length calculation for some iterators.
 +- Changed how Jinja2 enforces strings to be native strings in
 +  Python 2 to work when people break their default encoding.
 +- Added :func:`make_logging_undefined` which returns an undefined
 +  object that logs failures into a logger.
 +
+ Version 2.7.3
+ -------------
+ (bugfix release, released on June 6th 2014)
+ - Security issue: Corrected the security fix for the cache folder.  This
+   fix was provided by RedHat.
  Version 2.7.2
  -------------
  (bugfix release, released on January 10th 2014)
index 4c090964eb4518b4973fe5dfda2b8c93105fd962,2d28ab8b24d38a715cf3f4c0efff2c2832fe8b35..2a7df5401b348f5e1247c402f47f9730eb0a514a
@@@ -227,21 -224,19 +227,29 @@@ class FileSystemBytecodeCache(BytecodeC
  
          dirname = '_jinja2-cache-%d' % os.getuid()
          actual_dir = os.path.join(tmpdir, dirname)
 +
 +        try:
 +            os.mkdir(actual_dir, stat.S_IRWXU)
 +        except OSError as e:
 +            if e.errno != errno.EEXIST:
 +                raise
          try:
 -            os.mkdir(actual_dir, stat.S_IRWXU) # 0o700
 +            os.chmod(actual_dir, stat.S_IRWXU)
 +            actual_dir_stat = os.lstat(actual_dir)
 +            if actual_dir_stat.st_uid != os.getuid() \
 +               or not stat.S_ISDIR(actual_dir_stat.st_mode) \
 +               or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:
 +                _unsafe_dir()
-         except OSError:
+         except OSError as e:
+             if e.errno != errno.EEXIST:
+                 raise
+         actual_dir_stat = os.lstat(actual_dir)
+         if actual_dir_stat.st_uid != os.getuid() \
 -                or not stat.S_ISDIR(actual_dir_stat.st_mode) \
 -                or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:
 -            raise RuntimeError('Temporary directory \'%s\' has an incorrect '
 -                             'owner, permissions, or type.' % actual_dir)
++           or not stat.S_ISDIR(actual_dir_stat.st_mode) \
++           or stat.S_IMODE(actual_dir_stat.st_mode) != stat.S_IRWXU:
 +            _unsafe_dir()
          return actual_dir
  
      def _get_cache_filename(self, bucket):
diff --cc setup.py
index 6943f53d0f83a0bf25f573c0cec82f5a8dace48c,b67af19d5223102cb90a0a3852514b8b19bc3d9f..b60bdbbeee325992968d086d63b16961a37dea90
+++ b/setup.py
@@@ -35,8 -35,8 +35,6 @@@ For more informations visit the new `Ji
  .. _Jinja2 webpage: http://jinja.pocoo.org/
  .. _documentation: http://jinja.pocoo.org/2/documentation/
  """
--import sys
--
  from setuptools import setup