From: guido@trentalancia.com (Guido Trentalancia) Date: Wed, 15 Aug 2012 10:38:40 +0200 Subject: [refpolicy] [PATCH]: clarify the file_contexts.subs_dist configuration file usage In-Reply-To: <20120815082038.GA1471@siphos.be> References: <50250912.50902@trentalancia.com> <502A3EAE.2060905@tresys.com> <20120815080226.GA32379@siphos.be> <502B5A26.5070309@trentalancia.com> <20120815082038.GA1471@siphos.be> Message-ID: <502B6010.1060007@trentalancia.com> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com Hello Sven. On 15/08/2012 10:20, Sven Vermeulen wrote: > 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 may have a broken version of the userspace tools. I have just tested again and the copy of semanage that I have runs fine the above mentioned test. The version of semanage I am using should be dated June 2012, if that helps... It's important to keep that note in my opinion, because otherwise it tends to generate confusion due to the somewhat unfortunate name that has been chosen for the file and due to the lack of a specific (userspace) manual page. I'll be on holidays in a few hours, so don't expect much more from this side anytime soon... Regards, Guido