From: guido@trentalancia.com (Guido Trentalancia) Date: Sat, 18 Aug 2012 14:30:18 +0200 Subject: [refpolicy] [PATCH]: clarify the file_contexts.subs_dist configuration file usage Message-ID: <201208181230.q7ICUI7w024397@vivaldi11.register.it> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com Hello Sven. >On Wed, Aug 15, 2012 at 10:13:26AM +0200, Guido Trentalancia wrote: >> > This seems to break policycoreutils: >> > >> > # semanage fcontext -l >> > /usr/sbin/semanage: too many values to unpack (expected 2) >> > >> > Undoing the comment change fixes things again. >> >> Is semanage using the standard library functions to read the file ? >> Because I had a very quick look through the library and the #-comment >> skipping code seemed to be there... > > fd = open(selinux.selinux_file_context_subs_dist_path(), "r") > for i in fd.readlines(): > target, substitute = i.split() > self.equiv_dist[target] = substitute > fd.close() > >Just opens the file, reads lines and assumes there are always two >values (target & substitute) on each line. This is from seobject.py. You're right, I told you fibbs in my previous message. seobject.py is buggy for it does not skip comments. It needs to be patched, otherwise, as you noted, "semanage fcontext -l" does not work. Regards, Guido