semodule -i error
Hi all,
When i m trying to install a module using semodule -i <name of the module> i m geting the following error:
*libsepol.print_missing_requirements: dbus_rpc_example_server's global requirements were not met: type/attribute resmgrd_var_run_t libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed!*
Also when i do "semodule -l" i could not see any module *resmgr*.
I m actually trying to insert a new class gconf (making gconf-daemon an userspace object manager).
For this i have downloaded the refpolicy
*refpolicy-20080702.tar.bz2* from *
http://oss.tresys.com/projects/refpolicy/wiki/DownloadRelease* and installed it.
Then from /etc/selinux/refpolicy/src/policy/policy/flask directory i m editing the security_classes and access_vectors files to add my new gconf class and permissions, then rebuilding and installing the policy. The whenever i m giving the class gconf in my module .te file and trying to install it i m getting this error.I guess i m missing something.PLease help.
Regards,
Shaunak
Quoted 7 lines · shaunak saha
Hi all,
When i m trying to install a module using semodule -i <name of the module> i m geting the following error:
libsepol.print_missing_requirements: dbus_rpc_example_server's global requirements were not met: type/attribute
resmgrd_var_run_t
So your module has a require on that type (presumably by using an interface that depends on it), and you don't have that type defined in your policy.
Quoted 4 lines
libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed!Also when i do "semodule -l" i could not see any module resmgr.
So that's the problem - you didn't install it? Or you didn't include it in your base?
Quoted 8 lines
I m actually trying to insert a new class gconf (making gconf-daemon an userspace object manager).
For this i have downloaded the refpolicyrefpolicy-20080702.tar.bz2 from
http://oss.tresys.com/projects/refpolicy/wiki/DownloadRelease and installed it.
Quoted 7 lines
Then from
/etc/selinux/refpolicy/src/policy/policy/flaskdirectory i m editing thesecurity_classesandaccess_vectorsfiles to add my new gconf class and permissions, then rebuilding and installing the policy.
The whenever i m giving the class gconf in my module .te file and trying to install it i m getting this error.I guess i m missing something.PLease help.
I think we'd have to see your module .te file.
And maybe your modules.conf.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 2 lines
So that's the problem - you didn't install it? Or you didn't include it in your base?
No.I didn't installed it,neither did anything to include it in base.Actually i m not aware what this module is required for.Previouly while inserting any module didn't got this erorr.
Quoted 1 line
I think we'd have to see your module .te file
This is my .te file
policy_module(dbus_exe,1.0.0)
########################################
#
# Declarations
#
require{
type system_dbusd_t;
class dbus acquire_svc;
class dbus send_msg;
class gconf set_value;
}
type dbus_exe_t;
type dbus_exe_exec_t;domain_type(dbus_exe_t) init_daemon_domain(dbus_exe_t, dbus_exe_exec_t) domtrans_pattern(unconfined_t,dbus_exe_exec_t,dbus_exe_t) role unconfined_r types dbus_exe_t;
########################################
#
# dbus_exe local policy
#
# Check in /etc/selinux/refpolicy/include for macros to use instead of allow
rules.
# Some common macros (you might be able to remove some)
files_read_etc_files(dbus_exe_t)
libs_use_ld_so(dbus_exe_t)
libs_use_shared_libs(dbus_exe_t)
miscfiles_read_localization(dbus_exe_t)
dbus_system_bus_client_template(dbus_exe,dbus_exe_t)
## internal communication is often done using fifo and unix sockets.
allow dbus_exe_t self:fifo_file { read write };
allow dbus_exe_t self:unix_stream_socket create_stream_socket_perms;
allow dbus_exe_t system_dbusd_t:dbus { send_msg };
allow dbus_exe_t self:dbus {acquire_svc send_msg};
allow dbus_exe_t self:chr_file {getattr read write};
allow dbus_exe_t devpts_t:chr_file {getattr read write};
allow dbus_exe_t self:process {signal};Quoted 46 lines · Stephen Smalley
Quoted 7 lines · shaunak saha
Hi all,
When i m trying to install a module using semodule -i <name of the module> i m geting the following error:
libsepol.print_missing_requirements: dbus_rpc_example_server's global requirements were not met: type/attribute
resmgrd_var_run_tSo your module has a require on that type (presumably by using an interface that depends on it), and you don't have that type defined in your policy.
Quoted 4 lines
libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed!Also when i do "semodule -l" i could not see any module resmgr.
So that's the problem - you didn't install it? Or you didn't include it in your base?
Quoted 8 lines
I m actually trying to insert a new class gconf (making gconf-daemon an userspace object manager).
For this i have downloaded the refpolicyrefpolicy-20080702.tar.bz2 from
http://oss.tresys.com/projects/refpolicy/wiki/DownloadRelease and installed it.Quoted 7 lines
Then from
/etc/selinux/refpolicy/src/policy/policy/flaskdirectory i m editing thesecurity_classesandaccess_vectorsfiles to add my new gconf class and permissions, then rebuilding and installing the policy.
The whenever i m giving the class gconf in my module .te file and trying to install it i m getting this error.I guess i m missing something.PLease help.I think we'd have to see your module .te file.
And maybe your modules.conf.--
Stephen Smalley
National Security Agency
Quoted 10 lines · shaunak saha
Quoted 2 lines
So that's the problem - you didn't install it? Or you didn't include
it
Quoted 1 line
in your base?
No.I didn't installed it,neither did anything to include it in base.Actually i m not aware what this module is required for.Previouly while inserting any module didn't got this erorr.
Quoted 5 lines
Quoted 1 line
I think we'd have to see your module .te file
This is my .te file
policy_module(dbus_exe,1.0.0)
Wait - the error message you displayed listed "dbus_rpc_example_server" as the module name, not dbus_exe - so you aren't showing the module that is triggering the error. And I'm not sure what the purpose of this module is, given that dbus already has a policy module.
Quoted 28 lines
########################################
#
# Declarations
#
require{
typesystem_dbusd_t;
class dbusacquire_svc;
class dbussend_msg;
class gconfset_value;
}
typedbus_exe_t;
typedbus_exe_exec_t;domain_type(dbus_exe_t)init_daemon_domain(dbus_exe_t, dbus_exe_exec_t)domtrans_pattern(unconfined_t,dbus_exe_exec_t,dbus_exe_t)roleunconfined_rtypesdbus_exe_t;
########################################
## dbus_exe local policy # # Check in /etc/selinux/refpolicy/include for macros to use instead of allow rules. # Some common macros (you might be able to remove some) files_read_etc_files(dbus_exe_t) libs_use_ld_so(dbus_exe_t) libs_use_shared_libs(dbus_exe_t) miscfiles_read_localization(dbus_exe_t) dbus_system_bus_client_template(dbus_exe,dbus_exe_t)
Quoted 8 lines
## internal communication is often done using fifo and unix sockets.
allow dbus_exe_t self:fifo_file { read write };
allow dbus_exe_t self:unix_stream_socket create_stream_socket_perms;
allow dbus_exe_t system_dbusd_t:dbus { send_msg };
allow dbus_exe_t self:dbus {acquire_svc send_msg};
allow dbus_exe_t self:chr_file {getattr read write};
allow dbus_exe_t devpts_t:chr_file {getattr read write};
allow dbus_exe_t self:process {signal};Nothing above seems to have anything to do with resmgrd, and the policy module name doesn't match, so I'm guessing this isn't the right file.
Just in case it isn't clear though - you cannot add new classes/perms in a non-base module; they have to be defined in the base module. A non-base module can only require them, not declare them.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines
Wait - the error message you displayed listed "
dbus_rpc_example_server" as the module name, notdbus_exe- so you aren't showing the module that is triggering the error.
yes.They are different modules but they are giving the same error.This one gives:
*[root@localhost shaunak]# semodule -i dbus_exe.pp libsepol.print_missing_requirements: dbus_exe's global requirements were not
met: type/attribute resmgrd_var_run_t libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed*
I have given the .te file for this as this is comparitively smaller than the other module.I m sorry for that confusion.
Quoted 1 line
And I'm not sure what the purpose of this module
This is a sample program i have written to learn the policy writing.It calls some dbus api's.It is working fine with the dbus.But now i want to test gconf.I m working on making gconf-daemon an userspace object manager.For this i wanted to add gconf class and test it.
Quoted 3 lines
Just in case it isn't clear though - you cannot add new classes/perms in a non-base module; they have to be defined in the base module. A non-base module can only require them, not declare them.
How to declare them in base module?Sorry for the ignorance but dont really know how to do this
Quoted 72 lines · Stephen Smalley
Quoted 10 lines · shaunak saha
Quoted 2 lines
So that's the problem - you didn't install it? Or you didn't include
it
Quoted 1 line
in your base?
No.I didn't installed it,neither did anything to include it in base.Actually i m not aware what this module is required for.Previouly while inserting any module didn't got this erorr.
Quoted 5 lines
Quoted 1 line
I think we'd have to see your module .te file
This is my .te file
policy_module(dbus_exe,1.0.0)Wait - the error message you displayed listed "
dbus_rpc_example_server" as the module name, notdbus_exe- so you aren't showing the module that is triggering the error. And I'm not sure what the purpose of this module is, given that dbus already has a policy module.Quoted 28 lines
########################################
#
# Declarations
#
require{
typesystem_dbusd_t;
class dbusacquire_svc;
class dbussend_msg;
class gconfset_value;
}
typedbus_exe_t;
typedbus_exe_exec_t;domain_type(dbus_exe_t)init_daemon_domain(dbus_exe_t, dbus_exe_exec_t)domtrans_pattern(unconfined_t,dbus_exe_exec_t,dbus_exe_t)roleunconfined_rtypesdbus_exe_t;
########################################
## dbus_exe local policy # # Check in /etc/selinux/refpolicy/include for macros to use instead of allow rules. # Some common macros (you might be able to remove some) files_read_etc_files(dbus_exe_t) libs_use_ld_so(dbus_exe_t) libs_use_shared_libs(dbus_exe_t) miscfiles_read_localization(dbus_exe_t) dbus_system_bus_client_template(dbus_exe,dbus_exe_t)Quoted 8 lines
## internal communication is often done using fifo and unix sockets. allow dbus_exe_t self:fifo_file { read write }; allow dbus_exe_t self:unix_stream_socket create_stream_socket_perms; allow dbus_exe_t system_dbusd_t:dbus { send_msg }; allow dbus_exe_t self:dbus {acquire_svc send_msg}; allow dbus_exe_t self:chr_file {getattr read write}; allow dbus_exe_t devpts_t:chr_file {getattr read write}; allow dbus_exe_t self:process {signal};Nothing above seems to have anything to do with resmgrd, and the policy module name doesn't match, so I'm guessing this isn't the right file.
Just in case it isn't clear though - you cannot add new classes/perms in a non-base module; they have to be defined in the base module. A non-base module can only require them, not declare them.
--
Stephen Smalley
National Security Agency
Quoted 10 lines · shaunak saha
Quoted 2 lines
Wait - the error message you displayed listed
"
dbus_rpc_example_server"Quoted 1 line
as the module name, not
dbus_exe- so you aren't showing the modulethat
Quoted 1 line
is triggering the error.
yes.They are different modules but they are giving the same error.This one gives:
Quoted 6 lines
[root@localhost shaunak]# semodule -i dbus_exe.pp libsepol.print_missing_requirements: dbus_exe's global requirements were not
met: type/attributeresmgrd_var_run_tlibsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed
Hmmm...ok, can you also show the tmp/dbus_exe.tmp file that was generated from your .te file during the build?
Quoted 10 lines
I have given the .te file for this as this is comparitively smaller than the other module.I m sorry for that confusion.
Quoted 1 line
And I'm not sure what the purpose of this module
This is a sample program i have written to learn the policy writing.It calls some dbus api's.It is working fine with the dbus.But now i want to test gconf.I m working on making gconf-daemon an userspace object manager.For this i wanted to add gconf class and test it.
Quoted 7 lines
Quoted 1 line
Just in case it isn't clear though - you cannot add new classes/perms
in
Quoted 2 lines
a non-base module; they have to be defined in the base module. A non-base module can only require them, not declare them.
How to declare them in base module?Sorry for the ignorance but dont really know how to do this
You add the definitions to the policy/flask files and rebuild the entire refpolicy.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 25 lines · shaunak saha
Quoted 2 lines
Hmmm...ok, can you also show the tmp/dbus_exe.tmp file that was generated from your .te file during the build?
Attached is the dbus_exe.tmp file
Quoted 1 line
You add the definitions to the policy/flask files and rebuild the
entire
Quoted 1 line
refpolicy.
I did that i guess.I added this
class gconf
{
set_value
set_scheme
unset_value
remove_dir
}in
/etc/selinux/refpolicy/src/policy/policy/flask/access_vectorsfileand
class gconf
Quoted 8 lines
in
/etc/selinux/refpolicy/src/policy/policy/flask/security_classesfile
and then did amake load
from/etc/selinux/refpolicy/src/policydirectory.Is this the right thing?or i m missing something?
And did you then set SELINUXTYPE=refpolicy in /etc/selinux/config, touch /.autorelabel and reboot the system to bring it up under your newly built policy rather than the targeted one?
Or alternatively when you ran semodule, did you specify -s refpolicy to cause it act on refpolicy rather than the default targeted policy?
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines
And did you then set SELINUXTYPE=refpolicy in
/etc/selinux/config,Quoted 2 lines
touch /.autorelabel and reboot the system to bring it up under your newly built policy rather than the targeted one?
I did that.But with this my system is not booting up.I can send you the bootup logs.
If i go back to the targeterd policy it comes up properly.
one more question i have.If instead of refpolicy i want to use targeted policy only then from where can i get the source packages for that.