Changeset 2666
- Timestamp:
- 04/22/08 13:14:36 (7 months ago)
- Files:
-
- branches/fcglob/Makefile (modified) (2 diffs)
- branches/fcglob/Rules.monolithic (modified) (2 diffs)
- branches/fcglob/support/fcglob/fcglob.py (modified) (7 diffs)
- branches/fcglob/support/fcglob/libselinux (added)
- branches/fcglob/support/fcglob/libselinux/ChangeLog (added)
- branches/fcglob/support/fcglob/libselinux/LICENSE (added)
- branches/fcglob/support/fcglob/libselinux/Makefile (added)
- branches/fcglob/support/fcglob/libselinux/VERSION (added)
- branches/fcglob/support/fcglob/libselinux/include (added)
- branches/fcglob/support/fcglob/libselinux/include/Makefile (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/av_permissions.h (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/avc.h (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/context.h (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/flask.h (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/get_context_list.h (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/get_default_type.h (added)
- branches/fcglob/support/fcglob/libselinux/include/selinux/selinux.h (added)
- branches/fcglob/support/fcglob/libselinux/src (added)
- branches/fcglob/support/fcglob/libselinux/src/Makefile (added)
- branches/fcglob/support/fcglob/libselinux/src/av_inherit.h (added)
- branches/fcglob/support/fcglob/libselinux/src/av_perm_to_string.h (added)
- branches/fcglob/support/fcglob/libselinux/src/avc.c (added)
- branches/fcglob/support/fcglob/libselinux/src/avc_internal.c (added)
- branches/fcglob/support/fcglob/libselinux/src/avc_internal.h (added)
- branches/fcglob/support/fcglob/libselinux/src/avc_sidtab.c (added)
- branches/fcglob/support/fcglob/libselinux/src/avc_sidtab.h (added)
- branches/fcglob/support/fcglob/libselinux/src/booleans.c (added)
- branches/fcglob/support/fcglob/libselinux/src/canonicalize_context.c (added)
- branches/fcglob/support/fcglob/libselinux/src/checkAccess.c (added)
- branches/fcglob/support/fcglob/libselinux/src/check_context.c (added)
- branches/fcglob/support/fcglob/libselinux/src/class_to_string.h (added)
- branches/fcglob/support/fcglob/libselinux/src/common_perm_to_string.h (added)
- branches/fcglob/support/fcglob/libselinux/src/compat_file_path.h (added)
- branches/fcglob/support/fcglob/libselinux/src/compute_av.c (added)
- branches/fcglob/support/fcglob/libselinux/src/compute_create.c (added)
- branches/fcglob/support/fcglob/libselinux/src/compute_member.c (added)
- branches/fcglob/support/fcglob/libselinux/src/compute_relabel.c (added)
- branches/fcglob/support/fcglob/libselinux/src/compute_user.c (added)
- branches/fcglob/support/fcglob/libselinux/src/context.c (added)
- branches/fcglob/support/fcglob/libselinux/src/context_internal.h (added)
- branches/fcglob/support/fcglob/libselinux/src/disable.c (added)
- branches/fcglob/support/fcglob/libselinux/src/dso.h (added)
- branches/fcglob/support/fcglob/libselinux/src/enabled.c (added)
- branches/fcglob/support/fcglob/libselinux/src/fgetfilecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/file_path_suffixes.h (added)
- branches/fcglob/support/fcglob/libselinux/src/freecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/freeconary.c (added)
- branches/fcglob/support/fcglob/libselinux/src/fsetfilecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/get_context_list.c (added)
- branches/fcglob/support/fcglob/libselinux/src/get_context_list_internal.h (added)
- branches/fcglob/support/fcglob/libselinux/src/get_default_type.c (added)
- branches/fcglob/support/fcglob/libselinux/src/get_default_type_internal.h (added)
- branches/fcglob/support/fcglob/libselinux/src/getenforce.c (added)
- branches/fcglob/support/fcglob/libselinux/src/getfilecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/getpeercon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/init.c (added)
- branches/fcglob/support/fcglob/libselinux/src/is_customizable_type.c (added)
- branches/fcglob/support/fcglob/libselinux/src/lgetfilecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/load_policy.c (added)
- branches/fcglob/support/fcglob/libselinux/src/lsetfilecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/matchmediacon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/matchpathcon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/policy.h (added)
- branches/fcglob/support/fcglob/libselinux/src/policyvers.c (added)
- branches/fcglob/support/fcglob/libselinux/src/procattr.c (added)
- branches/fcglob/support/fcglob/libselinux/src/query_user_context.c (added)
- branches/fcglob/support/fcglob/libselinux/src/rpm.c (added)
- branches/fcglob/support/fcglob/libselinux/src/selinux.py (added)
- branches/fcglob/support/fcglob/libselinux/src/selinux_check_securetty_context.c (added)
- branches/fcglob/support/fcglob/libselinux/src/selinux_config.c (added)
- branches/fcglob/support/fcglob/libselinux/src/selinux_internal.h (added)
- branches/fcglob/support/fcglob/libselinux/src/selinux_netlink.h (added)
- branches/fcglob/support/fcglob/libselinux/src/selinuxswig.i (added)
- branches/fcglob/support/fcglob/libselinux/src/selinuxswig_python.i (added)
- branches/fcglob/support/fcglob/libselinux/src/selinuxswig_wrap.c (added)
- branches/fcglob/support/fcglob/libselinux/src/setenforce.c (added)
- branches/fcglob/support/fcglob/libselinux/src/setfilecon.c (added)
- branches/fcglob/support/fcglob/libselinux/src/setrans_client.c (added)
- branches/fcglob/support/fcglob/libselinux/src/setrans_internal.h (added)
- branches/fcglob/support/fcglob/libselinux/src/seusers.c (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/fcglob/Makefile
r2583 r2666 66 66 XMLLINT ?= $(BINDIR)/xmllint 67 67 SECHECK ?= $(BINDIR)/sechecker 68 FCGLOB ?= $(PYTHON) $(support)/fcglob/fcglob.py69 68 70 69 # interpreters and aux tools … … 106 105 # so policycoreutils updates are not required (RHEL4) 107 106 genhomedircon := $(PYTHON) -E $(support)/genhomedircon 107 108 libselinux := $(support)/fcglob/libselinux/src/libselinux.so.1 109 fcglob ?= env LD_LIBRARY_PATH="$(dir $(libselinux))" $(PYTHON) $(support)/fcglob/fcglob.py 108 110 109 111 # documentation paths branches/fcglob/Rules.monolithic
r2607 r2666 193 193 $(homedir_template): $(fc) 194 194 195 $(fct): $(fc) 196 $(CC) support/fcglob/matchpathcon.c -o support/fcglob/matchpathcon -lselinux 197 $(verbose) $(FCGLOB) create $@ $^ 198 199 globtest: $(fct) 200 $(verbose) $(FCGLOB) test $^ file_contexts.orig/file_contexts / 195 $(libselinux): 196 $(verbose) $(MAKE) -C $(@D) 197 198 $(fct): $(fc) $(libselinux) 199 $(verbose) $(fcglob) create $@ $< 200 201 globtest: $(fct) $(libselinux) 202 $(verbose) $(fcglob) test $< file_contexts.orig/file_contexts / 201 203 202 204 ######################################## … … 261 263 rm -f *.res 262 264 rm -fR $(tmpdir) 265 $(MAKE) -C $(dir $(libselinux)) clean 263 266 264 267 .PHONY: default policy install load reload enableaudit checklabels restorelabels relabel check longcheck clean branches/fcglob/support/fcglob/fcglob.py
r2608 r2666 28 28 import fctree 29 29 30 #import selinux 31 import subprocess 30 import selinux 32 31 33 32 class FCException(Exception): … … 1118 1117 tree.unpickle(args[0]) 1119 1118 1120 #selinux.matchpathcon_init(args[1])1119 selinux.matchpathcon_init(args[1]) 1121 1120 1122 1121 for fi in args[2:]: … … 1124 1123 fs = "--" 1125 1124 if not flags.PRETEND: 1126 st = os.stat(fi) 1125 try: 1126 st = os.stat(fi) 1127 except: 1128 debug("os.stat(%s) failed" % fi) 1129 continue 1130 1127 1131 fs = fstype2string(st.st_mode) 1128 1132 … … 1133 1137 1134 1138 match = tree.matchpathcon(fc) 1135 mp = subprocess.Popen(["./support/fcglob/matchpathcon", args[1] , fi], stdout=subprocess.PIPE, close_fds=True)1136 mp.wait() 1137 origmatch = mp.stdout.readline().strip()1138 #origmatch = selinux.matchpathcon(fi, st.st_mode)1139 origmatch = selinux.matchpathcon(fi, st.st_mode)[1] 1140 1141 if origmatch == None: 1142 origmatch = "<<none>>" 1139 1143 1140 1144 # output the matched node … … 1157 1161 1158 1162 gc.set_threshold(20000) 1163 1164 selinux.matchpathcon_init(args[1]) 1159 1165 1160 1166 for root, dirs, files in os.walk(args[2]): … … 1169 1175 st = os.stat(fi) 1170 1176 except: 1177 debug("os.stat(%s) failed" % fi) 1171 1178 continue 1179 1172 1180 fs = fstype2string(st.st_mode) 1173 1181 … … 1178 1186 1179 1187 match = tree.matchpathcon(fc) 1180 mp = subprocess.Popen(["./support/fcglob/matchpathcon", args[1], fi], stdout=subprocess.PIPE, close_fds=True) 1181 mp.wait() 1182 origmatch = mp.stdout.readline().strip() 1188 origmatch = selinux.matchpathcon(fi, st.st_mode)[1] 1189 1190 if origmatch == None: 1191 origmatch = "<<none>>" 1183 1192 1184 1193 if origmatch != match.item.label:
