From: sven.vermeulen@siphos.be (Sven Vermeulen) Date: Wed, 15 Aug 2012 10:20:39 +0200 Subject: [refpolicy] [PATCH]: clarify the file_contexts.subs_dist configuration file usage In-Reply-To: <502B5A26.5070309@trentalancia.com> References: <50250912.50902@trentalancia.com> <502A3EAE.2060905@tresys.com> <20120815080226.GA32379@siphos.be> <502B5A26.5070309@trentalancia.com> Message-ID: <20120815082038.GA1471@siphos.be> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com 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. Wkr, Sven Vermeulen PS Sorry for mailing you directly the first time, forgot to update the "To" header...