ostbuild: Support marking files as setuid
This commit is contained in:
parent
e8dbaa3c07
commit
8e36e80896
|
|
@ -283,13 +283,26 @@ class OstbuildBuild(builtins.Builtin):
|
||||||
else:
|
else:
|
||||||
run_sync_monitor_log_file(chroot_args, log_path, cwd=component_src)
|
run_sync_monitor_log_file(chroot_args, log_path, cwd=component_src)
|
||||||
|
|
||||||
run_sync(['ostree', '--repo=' + self.repo,
|
args = ['ostree', '--repo=' + self.repo,
|
||||||
'commit', '-b', buildname, '-s', 'Build ' + artifact_meta['version'],
|
'commit', '-b', buildname, '-s', 'Build ' + artifact_meta['version'],
|
||||||
'--add-metadata-string=ostbuild-buildroot-version=' + buildroot_version,
|
'--add-metadata-string=ostbuild-buildroot-version=' + buildroot_version,
|
||||||
'--add-metadata-string=ostbuild-artifact-version=' + artifact_meta['version'],
|
'--add-metadata-string=ostbuild-artifact-version=' + artifact_meta['version'],
|
||||||
'--owner-uid=0', '--owner-gid=0', '--no-xattrs',
|
'--owner-uid=0', '--owner-gid=0', '--no-xattrs',
|
||||||
'--skip-if-unchanged'],
|
'--skip-if-unchanged']
|
||||||
cwd=component_resultdir)
|
|
||||||
|
setuid_files = meta.get('setuid', [])
|
||||||
|
statoverride_path = None
|
||||||
|
if len(setuid_files) > 0:
|
||||||
|
(fd, statoverride_path) = tempfile.mkstemp(suffix='.txt', prefix='ostbuild-statoverride-')
|
||||||
|
f = os.fdopen(fd, 'w')
|
||||||
|
for path in setuid_files:
|
||||||
|
f.write('+2048 ' + path)
|
||||||
|
f.close()
|
||||||
|
args.append('--statoverride=' + statoverride_path)
|
||||||
|
|
||||||
|
run_sync(args, cwd=component_resultdir)
|
||||||
|
if statoverride_path is not None:
|
||||||
|
os.unlink(statoverride_path)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _compose(self, target, artifacts):
|
def _compose(self, target, artifacts):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue