Revision 41bf4a8f image_creator/bundle_volume.py

b/image_creator/bundle_volume.py
401 401
                for excl in excluded:
402 402
                    dirname = os.path.dirname(excl)
403 403
                    stat = os.stat(dirname)
404
                    os.mkdir(target + excl, stat.st_mode)
404
                    os.mkdir(target + excl)
405
                    os.chmod(target + excl, stat.st_mode)
405 406
                    os.chown(target + excl, stat.st_uid, stat.st_gid)
406 407

  
408
                # /tmp and /var/tmp are special cases. We exclude then even if
409
                # they aren't mountpoints. Restore their permissions.
410
                for excl in ('/tmp', '/var/tmp'):
411
                    if self._is_mpoint(excl):
412
                        os.chmod(target + excl, 041777)
413
                        os.chown(target + excl, 0, 0)
414
                    else:
415
                        stat = os.stat(excl)
416
                        os.chmod(target + excl, stat.st_mode)
417
                        os.chown(target + excl, stat.st_uid, stat.st_gid)
418

  
407 419
                # We need to replace the old UUID referencies with the new
408 420
                # ones in grub configuration files and /etc/fstab for file
409 421
                # systems that have been recreated.

Also available in: Unified diff