Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 393443

Summary: sec-policy/selinux-mutt-2.20110726-r2 fails due to syntax error
Product: Gentoo Linux Reporter: J.C. Wren <jcwren>
Component: HardenedAssignee: Sven Vermeulen (RETIRED) <swift>
Status: VERIFIED FIXED    
Severity: normal CC: selinux
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Build log for sec-policy/selinux-mutt-2.20110726-r3
Build log for sec-policy/selinux-base-policy-2.20110726-r9

Description J.C. Wren 2011-12-06 20:44:47 UTC
sec-policy/selinux-mutt-2.20110726-r2 fails to install due to a syntax error that makes /usr/bin/checkmodule unhappy.

Reproducible: Always

Steps to Reproduce:
1.emerge selinux-mutt
2.
3.
Actual Results:  
 # emerge mutt -q
>>> Verifying ebuild manifests
>>> Starting parallel fetch
>>> Emerging (1 of 2) sec-policy/selinux-mutt-2.20110726-r2
>>> Failed to emerge sec-policy/selinux-mutt-2.20110726-r2, Log file:
>>>  '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/temp/build.log'
 * Package:    sec-policy/selinux-mutt-2.20110726-r2
 * Repository: gentoo
 * Maintainer: selinux@gentoo.org
 * USE:        elibc_glibc kernel_linux selinux userland_GNU x86
 * FEATURES:   sandbox selinux sesandbox
 * Applying SELinux policy updates ... 
 *   0000-fix-roles-staff-r1.patch ...
 [ ok ]
 *   0000-fix-roles-sysadm-r1.patch ...
 [ ok ]
 *   0000-fix-roles-unprivuser-r2.patch ...
 [ ok ]
 *   0001-iptables-support_xtables-multi_context-r1.patch ...
 [ ok ]
 *   0004-udev-support_init_script_hotplugging-r1.patch ...
 [ ok ]
 *   0005-nagios-allow_nrpe_to_read_nrpe_config-r1.patch ...
 [ ok ]
 *   0005-nagios-diskcheck_plugin_needs_getattr_on_mountpoint_directories-r2.patch ...
 [ ok ]
 *   0008-qemu-create_socket_and_request_load_module_for_qemu-r1.patch ...
 [ ok ]
 *   0009-qemu-allow_qemu_to_use_vde-r1.patch ...
 [ ok ]
 *   0009-sysadm-administer_vde_by_sysadm-r1.patch ...
 [ ok ]
 *   0009-vde-introduce_support_for_vde-r1.patch ...
 [ ok ]
 *   0010-consolekit-make_hal_an_optional_dependency-r1.patch ...
 [ ok ]
 *   0013-dbus-use_xdg_locations-r4.patch ...
 [ ok ]
 *   0013-mozilla-use_xdg_locations-r4.patch ...
 [ ok ]
 *   0013-userdomain-users_can_manage_their_xdg_locations-r4.patch ...
 [ ok ]
 *   0013-xdg-introduce_xdg_types-r4.patch ...
 [ ok ]
 *   0014-corecommands-update_contexts_for_xfce4-r2.patch ...
 [ ok ]
 *   0015-unconfined-allow_unconfined_users_to_run_portage_commands-r1.patch ...
 [ ok ]
 *   0016-portage-eselect_support-r4.patch ...
 [ ok ]
 *   0016-selinuxutil-semanage_is_eselect_module_in_gentoo-r1.patch ...
 [ ok ]
 *   0018-init-introduce_gentoo_init_rc_exec_call-r4.patch ...
 [ ok ]
 *   0018-portage-gcc_config_calls_rc_for_some_stupid_color_stuff-r4.patch ...
 [ ok ]
 *   0018-selinuxutil-run_init_calls_rc-r4.patch ...
 [ ok ]
 *   0018-sysadm-system_administrative_commands_call_rc-r4.patch ...
 [ ok ]
 *   0019-portage-introduce_portage_gpg_t_filetype-r4.patch ...
 [ ok ]
 *   0019-portage-support_layman_and_emerge-webrsync_through_portage_fetch_t-r4.patch ...
 [ ok ]
 *   0020-gpg-introduce_gpg_exec_interface-r4.patch ...
 [ ok ]
 *   0020-portage-allow_portage_to_be_called_from_within_cron_jobs-r4.patch ...
 [ ok ]
 *   0020-portage-domtrans_support_to_portage_fetch_t-r4.patch ...
 [ ok ]
 *   0021-gpg-allow_gpg_to_read_write_mutt_prepared_emails-r4.patch ...
 [ ok ]
 *   0021-mutt-introduce_mutt_domain-r3.patch ...
 [ ok ]
 *   0021-staff-allow_staff_to_call_mutt-r1.patch ...
 [ ok ]
 *   0021-sysadm-allow_sysadm_to_use_mutt-r1.patch ...
 [ ok ]
 *   0022-links-introduce_links_t_domain-r1.patch ...
 [ ok ]
 *   0022-staff-allow_staff_to_call_links-r1.patch ...
 [ ok ]
 *   0023-puppet-allow_puppet_to_mount_file_systems-r3.patch ...
 [ ok ]
 *   0024-pan-support_pan_t_domain-r1.patch ...
 [ ok ]
 *   0025-mount-introduce_dontaudits-r1.patch ...
 [ ok ]
 *   0025-portage-introduce_booleans_and_dontaudits-r1.patch ...
 [ ok ]
 *   0025-raid-add_dontaudit_statements-r1.patch ...
 [ ok ]
 *   0026-skype-introduce_skype_domain-r1.patch ...
 [ ok ]
 *   0027-wireshark-01-allow_use_of_terminals_for_commandline_startup-r4.patch ...
 [ ok ]
 *   0027-wireshark-02-use_random_device_next_to_urandom-r4.patch ...
 [ ok ]
 *   0027-wireshark-03-execute_dumpcap_from_wireshark_domain-r4.patch ...
 [ ok ]
 *   0027-wireshark-04-dumpcap_communicates_with_wireshark_through_pipes-r4.patch ...
 [ ok ]
 *   0027-wireshark-05-allow_wireshark_to_read_sysfs_to_capture_packets-r4.patch ...
 [ ok ]
 *   0028-sysnetwork-various_dhcp_client_updates-r1.patch ...
 [ ok ]
 *   0029-raid-allow_bootup_to_succeed-r1.patch ...
 [ ok ]
 *   0030-mount-mount_needs_relabelfrom_as_well_for_nonstandard_mounts-r1.patch ...
 [ ok ]
 *   0031-puppet-various_puppet_fixes-r4.patch ...
 [ ok ]
 *   0032-mozilla-various_mozilla-fixes-r1.patch ...
 [ ok ]
 *   0033-mount-allow_mount_to_write_to_puppet_tmp_so_puppet_can_gather_mount_output-r1.patch ...
 [ ok ]
 *   0034-syslog-allow_syslog_to_create_var_lib_syslog_directory-r1.patch ...
 [ ok ]
 *   0035-init-various_init_fixes-r1.patch ...
 [ ok ]
 *   0036-zabbix-correct_zabbix_agentd_context-r2.patch ...
 [ ok ]
 *   0037-zabbix-call_mysql_over_tcpip-r2.patch ...
 [ ok ]
 *   0038-corecommands-various_context_updates-r2.patch ...
 [ ok ]
 *   0039-courier-various_updates_on_courier-imap-r1.patch ...
 [ ok ]
 *   0040-gorg-introduce_gorg_domain-r1.patch ...
 [ ok ]
 *   0041-ldap-various_openldap_updates-r1.patch ...
 [ ok ]
 *   0042-networkmanager-various_updates_to_support_wpa_cli-r1.patch ...
 [ ok ]
 *   0043-nginx-introduce_nginx_domain-r1.patch ...
 [ ok ]
 *   0044-postfix-various_postfix_updates-r1.patch ...
 [ ok ]
 *   0045-postgresql-various_postgresql-updates-r1.patch ...
 [ ok ]
 *   0046-xserver-various_xserver_updates-r1.patch ...
 [ ok ]
 *   0047-asterisk-allow_asterisk_to_chown_its_own_var_run_directory-r2.patch ...
 [ ok ]
 *   0047-asterisk-allow_asterisk_to_listen_on_its_control_socket-r2.patch ...
 [ ok ]
 *   0047-asterisk-allow_asterisk_to_read_from_dev_random-r2.patch ...
 [ ok ]
 *   0048-sysnetwork-support_LDAPS_for_LDAP_calls-r2.patch ...
 [ ok ]
 *   0049-kernel-dontaudit_on_udp_socket_listen_since_that_does_not_exist_anyhow-r2.patch ...
 [ ok ]
 *   0050-courier-update_courier_fc_for_courier_imap-r2.patch ...
 [ ok ]
 *   0051-asterisk-allow_administrators_to_connect_to_daemon_using_asterisk_binary-r3.patch ...
 [ ok ]
 *   0051-sysadm-make_sysadm_r_an_asterisk_admin-r3.patch ...
 [ ok ]
 *   0052-asterisk-allow_initrc_to_manage_asterisk_log_and_pid_file_attributes-r3.patch ...
 [ ok ]
 *   0052-init-allow_initrc_to_manage_asterisk_log_and_pid_file_attributes-r3.patch ...
 [ ok ]
 *   0053-cron-make_cron_fds_interactive-r3.patch ...

 [ ok ]
 *   0054-portage-introduce_dontaudit_on_leaked_file_descriptors-r3.patch ...
 [ ok ]
 *   0054-selinuxutil-dontaudit_portage_leaked_file_descriptors-r3.patch ...
 [ ok ]
 *   0055-selinuxutil-support_semanage_permissive-r4.patch ...
 [ ok ]
 *   0056-portage-use_separate_interfaces_for_fetch_domain-r4.patch ...
 [ ok ]
 *   0056-puppet-use_separate_interfaces_for_fetch_domain-r4.patch ...
 [ ok ]
 *   0056-sysadm-use_separate_interfaces_for_fetch_domain-r4.patch ...
 [ ok ]
 *   0056-unconfined-use_separate_interfaces_for_fetch_domain-r4.patch ...
 [ ok ]
 * Done with patching
make: Entering directory `/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/work/strict'
Compiling strict mutt module
/usr/bin/checkmodule:  loading policy configuration from tmp/mutt.tmp
mutt.te":87:ERROR 'syntax error' at token 'userdom_manage_xdg_cache_home' on line 9651:

userdom_manage_xdg_cache_home(mutt_t)
/usr/bin/checkmodule:  error(s) encountered while parsing configuration
make: *** [tmp/mutt.mod] Error 1
make: Leaving directory `/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/work/strict'
 * ERROR: sec-policy/selinux-mutt-2.20110726-r2 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of 'emerge --info =sec-policy/selinux-mutt-2.20110726-r2',
 * the complete build log and the output of 'emerge -pqv =sec-policy/selinux-mutt-2.20110726-r2'.
 * The complete build log is located at '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/temp/environment'.
 * S: '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/work/'

 * Messages for package sec-policy/selinux-mutt-2.20110726-r2:

 * ERROR: sec-policy/selinux-mutt-2.20110726-r2 failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of 'emerge --info =sec-policy/selinux-mutt-2.20110726-r2',
 * the complete build log and the output of 'emerge -pqv =sec-policy/selinux-mutt-2.20110726-r2'.
 * The complete build log is located at '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/temp/environment'.
 * S: '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r2/work/'


Expected Results:  
selinux/mutt to install :)

# emerge --info =sec-policy/selinux-mutt-2.20110726-r2
Portage 2.1.10.39 (hardened/linux/x86/selinux, gcc-4.5.3, glibc-2.14.1-r1, 3.1.3-hardened-raid i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.1.3-hardened-raid-i686-Intel-R-_Pentium-R-_4_CPU_2.80GHz-with-gentoo-2.1
Timestamp of tree: Tue, 06 Dec 2011 05:45:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.10.3, 1.11.1-r1
sys-devel/binutils:       2.22
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r1
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://mirror.espri.arizona.edu/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://portage.private.com/gentoo-portage"
USE="aac apache2 ares berkdb bzip2 cli cracklib crypt ctype cups curl cxx dlz dri enscript gd gdbm hardened iconv imagemagick jbig jpeg jpeg2k lame mailwrapper mime modules mp3 mpm-prefork mudflap mysql mysqli ncurses netboot nfsv3 nls nptl nptlonly ogg open_perms openmp pam pax_kernel pcre perl php pic png readline rle sasl selinux sendmail sensord server session ssl subversion svnserve sysfs tcpd tiff truetype twolame unicode unzip urandom usb vhosts vim-syntax vorbis webdav x86 xml xpm zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-11 13:50:21 UTC
In hardened-dev overlay
Comment 2 J.C. Wren 2011-12-14 16:22:59 UTC
(In reply to comment #1)
> In hardened-dev overlay

Not being familiar with how to use overlays reliably, would you mind telling me what I need to do set up the overlay to test this?

Thanks!
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-14 19:23:41 UTC
Certainly. More elaborate information can be found on [1] but in general:

~# emerge layman
--> This installs the overlay manager

~# vim /etc/make.conf
--> Add "source /var/lib/layman/make.conf" on top of the file
--> This ensures that portage is aware of the overlays

~# layman -a hardened-development
--> This will add the hardened development overlay

From that point onward, the packages managed within the hardened overlay are available to portage as well. If you run "emerge -uDN world" or so, these packages will be accounted for too. 

All packages in the overlay are marked as ~arch (in this case, ~amd64 and ~x86) not to push out changes as stable too prematurely of course.

[1] http://www.gentoo.org/proj/en/overlays/userguide.xml
Comment 4 J.C. Wren 2011-12-14 19:48:39 UTC
Hrm, perhaps I'm doing something wrong?

# layman -S
(reports synchronized)
# layman -l
 * hardened-development      [Git       ] (git://git.overlays.gentoo.org/proj/hardened-dev.git                                                                                                                                  
# head /etc/make.conf
source /var/lib/layman/make.conf
ACCEPT_KEYWORDS="~x86"
ACCEPT_LICENSE="*"
# emerge -q --sync
# emerge -uDN world -p

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sec-policy/selinux-mutt-2.20110726-r2 
[ebuild   R    ] mail-client/mutt-1.5.21-r7  USE="(selinux%*)" 
# emerge -uDN world -q

After this point, it fails to compile as if it's not actually picking up the selinux-mutt from the overlay. I see the -r3 version in /var/lib/layman/hardened-development/sec-policy/selinux-mutt, so I'm unclear why it's not picking it up.  I read through the layman book, and I think I've got it right.
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-14 20:26:22 UTC
Weird... 

Check in your /etc/make.conf that you do not override PORTDIR_OVERLAY somewhere (if you do, then use something like PORTDIR_OVERLAY="${PORTDIR_OVERLAY} ..." instead).

Also try "emerge -p =sec-policy/selinux-mutt-2.20110726-r3", what does Portage say then?
Comment 6 J.C. Wren 2011-12-14 21:52:10 UTC
It appears to compile (if that's the right word), although there was a failure in the postinst phase. The /var/tmp/portage/sec-policy isn't there so I can't look at the build log for an error source, but Googling for the error message seems to indicate that it comes from 'semodule' failing to install a module (an error check you added back in May, where otherwise it appears to have failed silently?)

# emerge -av sec-policy/selinux-mutt -q
[ebuild     U ] sec-policy/selinux-base-policy-2.20110726-r8 [2.20110726-r7] USE="open_perms peer_perms ubac -doc" 
[ebuild  N    ] sec-policy/selinux-mutt-2.20110726-r3 

Would you like to merge these packages? [Yes/No] y
>>> Verifying ebuild manifests
>>> Starting parallel fetch
>>> Emerging (1 of 2) sec-policy/selinux-base-policy-2.20110726-r8 from hardened-dev
>>> Installing (1 of 2) sec-policy/selinux-base-policy-2.20110726-r8
>>> Emerging (2 of 2) sec-policy/selinux-mutt-2.20110726-r3 from hardened-dev
>>> Installing (2 of 2) sec-policy/selinux-mutt-2.20110726-r3
>>> Recording sec-policy/selinux-mutt in "world" favorites file...
>>> Jobs: 2 of 2 complete                           Load avg: 0.94, 0.45, 0.20

 * Messages for package sec-policy/selinux-base-policy-2.20110726-r8:

 * ERROR: sec-policy/selinux-base-policy-2.20110726-r8 failed (postinst phase):
 *   Could not load in new base policy
 * 
 * Call stack:
 *     ebuild.sh, line  75:  Called pkg_postinst
 *   environment, line 1988:  Called die
 * The specific snippet of code:
 *           semodule -s "${i}" -b base.pp || die "Could not load in new base policy";
 * 
 * If you need support, post the output of 'emerge --info =sec-policy/selinux-base-policy-2.20110726-r8',
 * the complete build log and the output of 'emerge -pqv =sec-policy/selinux-base-policy-2.20110726-r8'.
 * This ebuild is from an overlay named 'hardened-dev': '/var/lib/layman/hardened-development/'
 * The complete build log is located at '/var/tmp/portage/sec-policy/selinux-base-policy-2.20110726-r8/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sec-policy/selinux-base-policy-2.20110726-r8/temp/environment'.
 * S: '/var/tmp/portage/sec-policy/selinux-base-policy-2.20110726-r8/work/'

 * Messages for package sec-policy/selinux-mutt-2.20110726-r3:

 * ERROR: sec-policy/selinux-mutt-2.20110726-r3 failed (postinst phase):
 *   Failed to load in modules mutt in the strict policy store
 * 
 * Call stack:
 *     ebuild.sh, line   75:  Called pkg_postinst
 *   environment, line 1988:  Called selinux-policy-2_pkg_postinst
 *   environment, line 2052:  Called die
 * The specific snippet of code:
 *           semodule -s ${i} ${COMMAND} || die "Failed to load in modules ${MODS} in the $i policy store";
 * 
 * If you need support, post the output of 'emerge --info =sec-policy/selinux-mutt-2.20110726-r3',
 * the complete build log and the output of 'emerge -pqv =sec-policy/selinux-mutt-2.20110726-r3'.
 * This ebuild is from an overlay named 'hardened-dev': '/var/lib/layman/hardened-development/'
 * The complete build log is located at '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r3/temp/environment'.
 * S: '/var/tmp/portage/sec-policy/selinux-mutt-2.20110726-r3/work/'
# emerge -uDN world -p

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] mail-client/mutt-1.5.21-r7  USE="(selinux%*)" 
#
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-27 19:20:02 UTC
Can you provide the full build log of selinux-base-policy? I guess it has a collision with something, but without the full build log I won't be able to verify this
Comment 8 J.C. Wren 2011-12-28 00:18:33 UTC
Created attachment 297133 [details]
Build log for sec-policy/selinux-mutt-2.20110726-r3

Build log for sec-policy/selinux-mutt-2.20110726-r3
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2011-12-28 08:44:51 UTC
Can you provide the one for the base policy (in your earlier output, base policy rev 8 also failed during the postinstall)? If the base policy fails, we need to focus on that first before looking at specific modules.
Comment 10 J.C. Wren 2011-12-28 09:25:37 UTC
Created attachment 297169 [details]
Build log for sec-policy/selinux-base-policy-2.20110726-r9

Build log for sec-policy/selinux-base-policy-2.20110726-r9
Comment 12 J.C. Wren 2012-01-03 18:09:38 UTC
# eselect profile show
Current /etc/make.profile symlink:
  hardened/linux/x86/selinux
                            
# cd /etc/selinux/strict/modules/active/modules 
etb modules # for MOD in *.pp; do grep -H sysadm_screen_t ${MOD}; done
Binary file screen.pp matches
# 

Not sure what I'm supposed to do after this point, since there's only the one file.
Comment 13 Sven Vermeulen (RETIRED) gentoo-dev 2012-01-03 19:00:56 UTC
Make sure you don't run any screen sessions, remove the screen module:
~# semodule -r screen

Then install the base policy:
~# semodule -b /usr/share/selinux/strict/base.pp

If that works well, try to install the screen module:
~# semodule -i /usr/share/selinux/strict/screen.pp

We need to make sure that the base policy loads in correctly.
Comment 14 J.C. Wren 2012-01-03 19:08:17 UTC
# semodule -r screen
# semodule -b /usr/share/selinux/strict/base.pp
libsepol.print_missing_requirements: ftp's global requirements were not met: type/attribute home_type (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
semodule:  Failed!
# semodule -i /usr/share/selinux/strict/screen.pp
libsepol.permission_copy_callback: Module screen depends on permission nlmsg_tty_audit in class netlink_audit_socket, not satisfied (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
semodule:  Failed!
#

(I ran the third command even though I did know the second failed).
Comment 15 Sven Vermeulen (RETIRED) gentoo-dev 2012-01-03 19:39:01 UTC
Looks like you're running quite old policy modules. 

Can you run "semodule -l | grep ftp" and see what version it returns? The one we offer is 1.13.0. Based on the version, I might even find out how old.

You might need to switch to permissive mode, unload all modules that are currently running (which might mean that quite a few services that are running will need to be shut down as well), then update the base module, load back the modules (in /usr/share/selinux/strict since those should be the latest ones) and give your entire system a good try before going back to enforcing (and perhaps even relabel the entire system).
Comment 16 J.C. Wren 2012-01-03 19:43:35 UTC
# semodule -l | grep ftp
ftp     1.7.1   
tftp    1.7.1   
# 

So it seems I'm down a few levels. But I regularly 'emerge -uDN world', so why would these not be updated as a matter of course?
Comment 17 Sven Vermeulen (RETIRED) gentoo-dev 2012-01-03 20:17:22 UTC
Because, although we do "load" the new modules, we do this in a postinst() phase of the ebuilds. That means that, if the loading fails, we don't fail the entire process (i.e. the package is still installed) even though it dies right there.

If we move this up to the installation phase itself, we might be breaking the rules a bit (since doing this will change the system state beyond what Portage can control).

ftp 1.7.1 is from somewhere first quarter of 2008...
Comment 18 Sven Vermeulen (RETIRED) gentoo-dev 2012-01-14 20:11:06 UTC
The resolution of this bug (selinux-mutt-...-r2 failure) was pushed to main tree (~arch) on december 17th, 2011
Comment 19 Sven Vermeulen (RETIRED) gentoo-dev 2012-01-29 11:26:19 UTC
Stabilized