Changeset 2671
- Timestamp:
- 05/05/08 14:39:39
(7 months ago)
- Author:
- pebenito
- Message:
fcglob: add additional globs. add log file for mismatches.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2565 |
r2671 |
|
| 4 | 4 | $1 -- $2 |
|---|
| 5 | 5 | $1.[num_] -- $2 |
|---|
| | 6 | $1.[num_].[num_] -- $2 |
|---|
| | 7 | $1.[num_].[num_].[num_] -- $2 |
|---|
| 6 | 8 | $1.[num_][num_] -- $2 |
|---|
| 7 | 9 | $1.[num_][num_].[num_] -- $2 |
|---|
| | 10 | $1.[num_][num_].[num_].[num_] -- $2 |
|---|
| | 11 | $1.[num_][num_].[num_].[num_][num_] -- $2 |
|---|
| 8 | 12 | $1.[num_][num_].[num_][num_] -- $2 |
|---|
| 9 | 13 | $1.[num_][num_].[num_][num_].[num_] -- $2 |
|---|
| 10 | 14 | $1.[num_][num_].[num_][num_].[num_][num_] -- $2 |
|---|
| | 15 | $1.[num_].[num_][num_] -- $2 |
|---|
| | 16 | $1.[num_].[num_][num_].[num_] -- $2 |
|---|
| | 17 | $1.[num_].[num_][num_].[num_][num_] -- $2 |
|---|
| | 18 | $1.[num_].[num_].[num_][num_] -- $2 |
|---|
| 11 | 19 | ') |
|---|
| 12 | 20 | |
|---|
| … | … | |
| 108 | 116 | /lib(|32|64)/security/pam_poldi.so -- gen_context(system_u:object_r:textrel_shlib_t,s0) |
|---|
| 109 | 117 | |
|---|
| | 118 | libver_expand(/lib(|32|64)/*.so, gen_context(system_u:object_r:shlib_t,s0)) |
|---|
| | 119 | libver_expand(/lib(|32|64)/*/*.so, gen_context(system_u:object_r:shlib_t,s0)) |
|---|
| | 120 | |
|---|
| 110 | 121 | # |
|---|
| 111 | 122 | # /opt |
|---|
| … | … | |
| 208 | 219 | /usr/*/lib(|32|64)/** gen_context(system_u:object_r:lib_t,s0) |
|---|
| 209 | 220 | |
|---|
| | 221 | libver_expand(/usr/lib(|32|64)/*.so, gen_context(system_u:object_r:shlib_t,s0)) |
|---|
| | 222 | libver_expand(/usr/lib(|32|64)/*/*.so, gen_context(system_u:object_r:shlib_t,s0)) |
|---|
| | 223 | libver_expand(/usr/*/lib(|32|64)/*.so, gen_context(system_u:object_r:shlib_t,s0)) |
|---|
| | 224 | |
|---|
| 210 | 225 | #/usr/(.*/)?/HelixPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) |
|---|
| 211 | 226 | libver_expand(/usr/HelixPlayer/*,so, gen_context(system_u:object_r:textrel_shlib_t,s0)) |
|---|
| r2670 |
r2671 |
|
| 1180 | 1180 | selinux.matchpathcon_init(args[1]) |
|---|
| 1181 | 1181 | |
|---|
| | 1182 | print "Outputting mismatches to \"mismatches.log\"" |
|---|
| | 1183 | logfile = open("mismatches.log","w") |
|---|
| | 1184 | |
|---|
| 1182 | 1185 | for root, dirs, files in os.walk(args[2], topdown=True): |
|---|
| 1183 | 1186 | if root in mounts: |
|---|
| … | … | |
| 1196 | 1199 | st = os.stat(fi) |
|---|
| 1197 | 1200 | except: |
|---|
| 1198 | | debug("os.stat(%s) failed" % fi) |
|---|
| | 1201 | debug("os.stat(%s) failed; assuming it is a regular file." % fi) |
|---|
| 1199 | 1202 | continue |
|---|
| 1200 | 1203 | |
|---|
| … | … | |
| 1216 | 1219 | # output the mismatched label |
|---|
| 1217 | 1220 | if fc != None: |
|---|
| 1218 | | sys.stderr.write("mismatch: path: %s \"%s\" glob: %s label: %s orig_label: %s\n" % (fi, fs, match.item.pattern, match.item.label, origmatch)) |
|---|
| | 1221 | logfile.write("mismatch: path: %s \"%s\" glob: %s label: %s orig_label: %s\n" % (fi, fs, match.item.pattern, match.item.label, origmatch)) |
|---|
| 1219 | 1222 | else: |
|---|
| 1220 | | sys.stderr.write("mismatch: path: %s \"%s\" glob: No Match label: orig_label: %s\n" % (fi, fs, origmatch)) |
|---|
| 1221 | | |
|---|
| 1222 | | sys.stderr.write("%s mismatches encountered.\n" % mismatches) |
|---|
| | 1223 | logfile.write("mismatch: path: %s \"%s\" glob: No Match label: orig_label: %s\n" % (fi, fs, origmatch)) |
|---|
| | 1224 | #else: |
|---|
| | 1225 | # print "match: %s %s glob: %s label: %s" % (fi, fs, match.item.pattern, match.item.label) |
|---|
| | 1226 | |
|---|
| | 1227 | logfile.write("%s mismatches encountered.\n" % mismatches) |
|---|
| | 1228 | logfile.close() |
|---|
| 1223 | 1229 | |
|---|
| 1224 | 1230 | def opgraph(args, flags): |
|---|
Download in other formats:
* Generating other formats may take time.