On Wed, 2007-08-15 at 12:11 +1200, John Huttley wrote:
> Hi again,
> I'm trying to use setfiles to relabel my cyrus directories manually.
> 
> my cyrus-imapd.fc file is
> 
> 
> /usr/lib(64)?/cyrus/master    --   
> gen_context(system_u:object_r:cyrus_exec_t,s0)
> /var/imap(/.*)?                gen_context(system_u:object_r:var_imap_t,s0)
> 
> 
> 
> 
> If I try and check the existing labeling.........
> 
> setfiles  -c cyrus-imapd.pp
> libsepol.policydb_read: policydb magic number 0xf97cff8f does not match
> expected magic number 0xf97cff8c or 0xf97cff8d
> libsepol.sepol_set_policydb_from_file: can't read binary policy: Success
> Error reading policy cyrus-imapd.pp: Success

Not valid usage.  I works like:

setfiles -c /etc/selinux/strict/policy/policy.21 
/etc/selinux/scrict/contexts/file/file_contexts

> setfiles  cyrus-imapd.fc /var
> cyrus-imapd.fc:  line 1 has invalid context
> gen_context(system_u:object_r:cyrus_exec_t,s0)
> cyrus-imapd.fc:  line 2 has invalid context
> gen_context(system_u:object_r:var_imap_t,s0)

This dosn't work because the .fc file needs to be processed.  You also
wouldn't want to run it this way because you are not providing a full
system file contexts, so you would get errors for files that don't match
any entry in your .fc file.

> Oddly  enough rlpkg does work..

Thats because it uses the system file context files
in /etc/selinux/{strict,targeted}/contexts/file/

-- 
Chris PeBenito
<[EMAIL PROTECTED]>
Developer,
Hardened Gentoo Linux
 
Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A  CB00 BC8E E42D E6AF 9243

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to