Marc Schwartz (via MN) wrote:
On Tue, 2006-06-20 at 09:37 -0400, Stephen Smalley wrote:
On Tue, 2006-06-20 at 08:26 -0500, Marc Schwartz wrote:
Also, note that now I am getting an error when trying to install the
myclam.pp module:
# semodule -i myclam.pp
libsepol.scope_copy_callback: myclam: Duplicate declaration in module:
type/attribute clamscan_tmp_t
libsemanage.semanage_link_sandbox: Link packages failed
semodule: Failed!
So I presume that there is an update in the version 1.0.1 of the new
clamav module that conflicts with the declarations in our new module?
Yes, clamscan_tmp_t is defined in the clamav module now, so your
definition can go away. Unlike allow rules, which are just unioned
together (thus, no harm in duplicates), duplicate type declarations are
treated as an error.
The current myclam.te is:
# cat myclam.te
####### myclam.te #######
policy_module(myclam, 0.1.2)
require {
type clamscan_t;
type procmail_tmp_t;
type postfix_local_t;
};
# temp files
type clamscan_tmp_t;
files_tmp_file(clamscan_tmp_t)
# Allow clamscan to create and use temp files and dirs
allow clamscan_t clamscan_tmp_t:dir create_dir_perms;
allow clamscan_t clamscan_tmp_t:file create_file_perms;
files_type(clamscan_tmp_t)
files_tmp_filetrans(clamscan_t, clamscan_tmp_t, { file dir })
# Allow clamscan to read and write temp files created by procmail
# (needed for clamassassin)
allow clamscan_t procmail_tmp_t:file rw_file_perms;
# Allow clamscan output to be piped back into the
# postfix local delivery process
allow clamscan_t postfix_local_t:fd use;
allow clamscan_t postfix_local_t:fifo_file write;
Thanks Stephen.
So is it sufficient to simply remove the:
type clamscan_tmp_t;
line and retain the rest of the content or are the other changes that
should be made in light of the new clamav module?
Paul, I presume that you will also want to increment the version number?
Try this one:
policy_module(myclamscan, 0.2.0)
require {
type clamscan_t;
type postfix_local_t;
type procmail_tmp_t;
};
# temp files
# Included in selinux-policy-2.2.43-4
#type clamscan_tmp_t;
#files_tmp_file(clamscan_tmp_t)
# Allow clamscan to create and use temp files and dirs
# Included in selinux-policy-2.2.43-4
#allow clamscan_t clamscan_tmp_t:dir create_dir_perms;
#allow clamscan_t clamscan_tmp_t:file create_file_perms;
#files_type(clamscan_tmp_t)
#files_tmp_filetrans(clamscan_t, clamscan_tmp_t, { file dir })
# Allow clamscan to read and write temp files created by procmail
# (needed for clamassassin)
allow clamscan_t procmail_tmp_t:file rw_file_perms;
# Allow clamscan output to be piped back into the
# postfix local delivery process
allow clamscan_t postfix_local_t:fd use;
allow clamscan_t postfix_local_t:fifo_file write;
Also, as an FYI, this is the second time that I have experienced an RPM
related error with the policies. Paul, you may recall a few weeks ago,
there was a partial install of an update RPM, which was not actually
loaded, but rpm reported both versions being installed. Not sure if this
is unique to my system or if others may be having any issues. I have not
checked Bugzilla for any reports on these.
This is not something I've been seeing here. Might be worth peeking
through your logs for the time the update was applied to see if there
was anything strange happening.
Paul.
--
fedora-selinux-list mailing list
fedora-selinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-selinux-list