[webctl] set uid of file produced by gen-static-datadir (closes #11298794) 3.22
authorDavid Douard <david.douard@logilab.fr>
Tue, 19 Jul 2016 19:30:10 +0200
branch3.22
changeset 11438 828483a88825
parent 11437 dbe73990172b
child 11439 8d22200d174b
[webctl] set uid of file produced by gen-static-datadir (closes #11298794)
web/webctl.py
--- a/web/webctl.py	Tue Jul 19 19:54:59 2016 +0200
+++ b/web/webctl.py	Tue Jul 19 19:30:10 2016 +0200
@@ -78,6 +78,7 @@
             for dirpath, dirnames, filenames in os.walk(datadir):
                 rel_dirpath = dirpath[len(datadir)+1:]
                 resources.update(osp.join(rel_dirpath, f) for f in filenames)
+
         # locate resources and copy them to destination
         for resource in resources:
             dest_resource = osp.join(dest, resource)
@@ -88,6 +89,8 @@
             copy(osp.join(resource_dir, resource_path), dest_resource)
         # handle md5 version subdirectory
         linkdir(dest, osp.join(dest, config.instance_md5_version()))
+        # ensure generated files are owned by configured uid
+        config.ensure_uid_directory(dest)
         print('You can use apache rewrite rule below :\n'
               'RewriteRule ^/data/(.*) %s/$1 [L]' % dest)