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)
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):