diff --git a/xCAT-selinux/xcat.fc b/xCAT-selinux/xcat.fc index 26ed9b766a..d69e58c9a5 100644 --- a/xCAT-selinux/xcat.fc +++ b/xCAT-selinux/xcat.fc @@ -3,12 +3,15 @@ /opt/xcat/sbin/xcatd -- gen_context(system_u:object_r:xcatd_exec_t,s0) /opt/xcat/bin/xcatclient -- gen_context(system_u:object_r:xcat_client_exec_t,s0) /opt/xcat/bin/xcatclientnnr -- gen_context(system_u:object_r:xcat_client_exec_t,s0) +/opt/xcat/bin/xcatDBcmds -- gen_context(system_u:object_r:xcat_client_exec_t,s0) +/opt/xcat/bin/genimage -- gen_context(system_u:object_r:xcat_client_exec_t,s0) -# The entrypoints of the image build. The wrapper and the per-OS program are -# both real files; packimage and liteimg are symlinks to xcatclientnnr, so the -# work they ask for runs in xcat_t. -/opt/xcat/bin/genimage -- gen_context(system_u:object_r:xcat_image_exec_t,s0) +# The entrypoints of the image build are the per-OS programs. The geninitrd +# name needs its own line: most are symlinks to their sibling genimage, but +# netboot/fedora12/geninitrd is a real program. packimage and liteimg are +# symlinks to xcatclientnnr, so the work they ask for runs in xcat_t. /opt/xcat/share/xcat/netboot/[^/]+/genimage -- gen_context(system_u:object_r:xcat_image_exec_t,s0) +/opt/xcat/share/xcat/netboot/[^/]+/geninitrd -- gen_context(system_u:object_r:xcat_image_exec_t,s0) /install(/.*)? gen_context(system_u:object_r:public_content_t,s0) diff --git a/xCAT-test/unit/xcat_selinux_package.t b/xCAT-test/unit/xcat_selinux_package.t index d1a9904f76..8758b2e045 100644 --- a/xCAT-test/unit/xcat_selinux_package.t +++ b/xCAT-test/unit/xcat_selinux_package.t @@ -273,8 +273,8 @@ like($te, qr/^\s*role unconfined_r types xcat_image_t;$/m, # (xCAT-client/bin/genimage:453), which transitions on its own. Labelling the # wrapper gave a dispatching client the authority of the image domain. is_deeply([ grep { fc_type($_) eq 'xcat_image_exec_t' } sort keys %fc ], - [ '/opt/xcat/share/xcat/netboot/[^/]+/geninitrd', - '/opt/xcat/share/xcat/netboot/[^/]+/genimage' ], + [ '/opt/xcat/share/xcat/netboot/[^/]+/genimage', + '/opt/xcat/share/xcat/netboot/[^/]+/geninitrd' ], 'only the per-OS build programs carry the image entrypoint'); is(fc_type('/opt/xcat/bin/genimage'), 'xcat_client_exec_t', 'the genimage wrapper is a client, like every other dispatching command');