# HG changeset patch # User David Douard # Date 1524134868 -7200 # Node ID 2c582a242b6626b9455d0c4ea045fd84e5ab657d # Parent 547bb96ea2a8f01f8dacbafe9e18a0cde7ebdc49 [web] fix css file generation permission bug (closes #17143773) PropertySheet.process_resource() uses mkstemp which enforce a 0600 mode on the output file, which is not the file permission we want for css files. diff -r 547bb96ea2a8 -r 2c582a242b66 cubicweb/web/propertysheet.py --- a/cubicweb/web/propertysheet.py Thu Apr 19 12:45:24 2018 +0200 +++ b/cubicweb/web/propertysheet.py Thu Apr 19 12:47:48 2018 +0200 @@ -109,6 +109,12 @@ with os.fdopen(tmpfd, 'w') as stream: stream.write(content) try: + mode = os.stat(sourcefile).st_mode + os.chmod(tmpfile, mode) + except IOError: + self.warning('Cannot set access mode for %s; you may encouter ' + 'file permissions issues', cachefile) + try: os.rename(tmpfile, cachefile) except OSError as err: if err.errno != errno.EEXIST: