Lines Matching refs:re
25 import re
343 if not re.match(r"^[a-zA-Z0-9-_]+$", name):
520 return re.sub("TEMPLATETYPE", self.name, executable.te_uid_rules)
526 return re.sub("TEMPLATETYPE", self.name, executable.te_syslog_rules)
532 return re.sub("TEMPLATETYPE", self.name, executable.te_resolve_rules)
538 return re.sub("TEMPLATETYPE", self.name, executable.te_kerberos_rules)
544 return re.sub("TEMPLATETYPE", self.name, executable.te_manage_krb5_rcache_rules)
551 newte = re.sub("TEMPLATETYPE", self.name, executable.te_pam_rules)
557 newte = re.sub("TEMPLATETYPE", self.name, executable.te_audit_rules)
563 newte = re.sub("TEMPLATETYPE", self.name, executable.te_etc_rules)
569 newte = re.sub("TEMPLATETYPE", self.name, executable.te_fd_rules)
575 newte = re.sub("TEMPLATETYPE", self.name, executable.te_localization_rules)
581 newte = re.sub("TEMPLATETYPE", self.name, executable.te_dbus_rules)
587 newte = re.sub("TEMPLATETYPE", self.name, executable.te_mail_rules)
639 return re.sub("TEMPLATETYPE", self.name, network.te_types)
689 newte += re.sub("TEMPLATETYPE", self.name, network.te_network)
693 newte += re.sub("TEMPLATETYPE", self.name, network.te_tcp)
696 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_tcp)
699 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_need_port_tcp)
702 newte += re.sub("TEMPLATETYPE", self.name, network.te_out_need_port_tcp)
705 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_all_ports_tcp)
707 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_reserved_ports_tcp)
709 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_unreserved_ports_tcp)
712 newte += re.sub("TEMPLATETYPE", self.name, network.te_out_all_ports_tcp)
714 newte += re.sub("TEMPLATETYPE", self.name, network.te_out_reserved_ports_tcp)
716 newte += re.sub("TEMPLATETYPE", self.name, network.te_out_unreserved_ports_tcp)
723 newte += re.sub("TEMPLATETYPE", self.name, network.te_udp)
726 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_need_port_udp)
728 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_udp)
730 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_all_ports_udp)
732 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_reserved_ports_udp)
734 newte += re.sub("TEMPLATETYPE", self.name, network.te_in_unreserved_ports_udp)
743 tmp = re.sub("TEMPLATETYPE", self.name, user.te_transition_rules)
744 newte += re.sub("APPLICATION", app, tmp)
748 temp = re.sub("TEMPLATETYPE", self.name, executable.te_run_rules)
749 newte += re.sub("USER", u.split("_u")[0], temp)
760 tmp = re.sub("TEMPLATETYPE", name, user.te_admin_domain_rules)
762 tmp = re.sub(role, "system_r", tmp)
764 newte += re.sub("APPLICATION", app, tmp)
769 newte += re.sub("TEMPLATETYPE", self.name, user.te_admin_rules)
772 tmp = re.sub("TEMPLATETYPE", self.name, user.te_admin_domain_rules)
773 newte += re.sub("APPLICATION", app, tmp)
779 tmp = re.sub("TEMPLATETYPE", self.name, user.te_admin_trans_rules)
780 newte += re.sub("USER", role, tmp)
787 newif = re.sub("TEMPLATETYPE", self.name, executable.if_dbus_rules)
794 newif = re.sub("TEMPLATETYPE", self.name, executable.if_sandbox_rules)
801 newtypes += re.sub("TEMPLATETYPE", self.name, executable.if_initscript_admin_types)
802 newif += re.sub("TEMPLATETYPE", self.name, executable.if_initscript_admin)
805 … newtypes += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].if_admin_types)
806 newif += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].if_admin_rules)
809 ret = re.sub("TEMPLATETYPE", self.name, executable.if_begin_admin)
812 ret += re.sub("TEMPLATETYPE", self.name, executable.if_middle_admin)
814 ret += re.sub("TEMPLATETYPE", self.name, executable.if_end_admin)
820 return re.sub("TEMPLATETYPE", self.file_name, executable.te_cgi_types)
823 return re.sub("TEMPLATETYPE", self.file_name, executable.te_sandbox_types)
826 return re.sub("TEMPLATETYPE", self.name, executable.te_userapp_types)
829 return re.sub("TEMPLATETYPE", self.name, executable.te_inetd_types)
832 return re.sub("TEMPLATETYPE", self.name, executable.te_dbusd_types)
835 return re.sub("TEMPLATETYPE", self.name, user.te_min_login_user_types)
838 return re.sub("TEMPLATETYPE", self.name, user.te_login_user_types)
841 return re.sub("TEMPLATETYPE", self.name, user.te_admin_user_types)
846 newte = re.sub("TEMPLATETYPE", self.name, user.te_existing_user_types)
862 return re.sub("TEMPLATETYPE", self.name, user.te_x_login_user_types)
865 return re.sub("TEMPLATETYPE", self.name, user.te_root_user_types)
876 newte += re.sub("TEMPLATETYPE", t[:-len(i)], self.DEFAULT_EXT[i].te_types)
891 newte = re.sub("TEMPLATETYPE", self.name, executable.te_daemon_types)
893 newte += re.sub("TEMPLATETYPE", self.name, executable.te_initscript_types)
898 return re.sub("TEMPLATETYPE", self.name, tmp.te_types)
905 tmp = re.sub("BOOLEAN", b, boolean.te_boolean)
906 newte += re.sub("DESCRIPTION", self.booleans[b], tmp)
912 newte += re.sub("BOOLEAN", b, boolean.te_rules)
916 return re.sub("TEMPLATETYPE", self.name, executable.te_sandbox_types)
919 return re.sub("TEMPLATETYPE", self.name, executable.te_cgi_types)
922 newif = re.sub("TEMPLATETYPE", self.name, executable.te_daemon_rules)
932 newif += re.sub("TEMPLATETYPE", t[:-len(i)], self.DEFAULT_EXT[i].if_rules)
937 return re.sub("TEMPLATETYPE", self.name, user.te_login_user_rules)
940 nerules = re.sub("TEMPLATETYPE", self.name, user.te_existing_user_rules)
944 return re.sub("TEMPLATETYPE", self.name, user.te_x_login_user_rules)
947 newte = re.sub("TEMPLATETYPE", self.name, user.te_root_user_rules)
951 return re.sub("TEMPLATETYPE", self.name, executable.te_userapp_rules)
954 return re.sub("TEMPLATETYPE", self.name, executable.te_inetd_rules)
957 return re.sub("TEMPLATETYPE", self.name, executable.te_dbusd_rules)
961 return re.sub("TEMPLATETYPE", self.name, tmp.te_rules)
967 newte += re.sub("TEMPLATETYPE", self.name, executable.te_cgi_rules)
972 newte += re.sub("TEMPLATETYPE", self.name, executable.te_sandbox_rules)
978 newif = re.sub("TEMPLATETYPE", self.name, executable.if_user_program_rules)
981 newif += re.sub("TEMPLATETYPE", self.name, executable.if_role_change_rules)
986 newif += re.sub("TEMPLATETYPE", self.name, executable.if_heading_rules)
988 newif += re.sub("TEMPLATETYPE", self.name, executable.if_program_rules)
990 newif += re.sub("TEMPLATETYPE", self.name, executable.if_initscript_rules)
994 newif += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].if_rules)
997 … newif += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].if_stream_rules)
1021 newte += re.sub("TEMPLATETYPE", self.name, user.te_sudo_rules)
1022 newte += re.sub("TEMPLATETYPE", self.name, user.te_newrole_rules)
1024 tmp = re.sub("TEMPLATETYPE", self.name, user.te_roles_rules)
1025 newte += re.sub("ROLE", role, tmp)
1034 newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_types)
1056 … newte_tmp += re.sub("TEMPLATETYPE_t", domain[:-2] + "_t", self.DEFAULT_DIRS[d][2].te_rules)
1057 newte += re.sub("TEMPLATETYPE_rw_t", self.name + "_rw_t", newte_tmp)
1059 newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_rules)
1064 … newte += re.sub("TEMPLATETYPE", domain[:-2], self.DEFAULT_DIRS[d][2].te_stream_rules)
1067 … newte += re.sub("TEMPLATETYPE", self.name, self.DEFAULT_DIRS[d][2].te_stream_rules)
1095 t1 = re.sub("TEMPLATETYPE", self.name, self.files[i][2].fc_sock_file)
1097 t1 = re.sub("TEMPLATETYPE", self.name, self.files[i][2].fc_file)
1098 t2 = re.sub("FILENAME", i, t1)
1099 fclist.append(re.sub("FILETYPE", self.files[i][0], t2))
1102 t1 = re.sub("TEMPLATETYPE", self.name, self.dirs[i][2].fc_dir)
1103 t2 = re.sub("FILENAME", i, t1)
1104 fclist.append(re.sub("FILETYPE", self.dirs[i][0], t2))
1114 t1 = re.sub("EXECUTABLE", self.program, executable.fc_program)
1115 fclist.append(re.sub("TEMPLATETYPE", self.name, t1))
1118 t1 = re.sub("EXECUTABLE", self.initscript, executable.fc_initscript)
1119 fclist.append(re.sub("TEMPLATETYPE", self.name, t1))
1135 tmp = re.sub("TEMPLATETYPE", self.name, script.users)
1136 newsh += re.sub("ROLES", roles, tmp)
1140 tmp = re.sub("TEMPLATETYPE", self.name, script.admin_trans)
1141 newsh += re.sub("USER", u, tmp)
1144 newsh += re.sub("TEMPLATETYPE", self.name, script.min_login_user_default_context)
1146 newsh += re.sub("TEMPLATETYPE", self.name, script.x_login_user_default_context)
1151 temp = re.sub("TEMPLATETYPE", self.file_name, script.compile)
1152 temp = re.sub("DOMAINTYPE", self.name, temp)
1154 newsh = re.sub("TEMPLATEFILE", "%s" % self.file_name, temp)
1156 newsh = re.sub("TEMPLATEFILE", self.file_name, temp)
1157 newsh += re.sub("DOMAINTYPE", self.name, script.manpage)
1160 newsh += re.sub("FILENAME", self.program, script.restorecon)
1162 newsh += re.sub("FILENAME", self.initscript, script.restorecon)
1165 newsh += re.sub("FILENAME", i, script.restorecon)
1168 newsh += re.sub("FILENAME", i, script.restorecon)
1172 t1 = re.sub("PORTNUM", "%d" % i, script.tcp_ports)
1173 newsh += re.sub("TEMPLATETYPE", self.name, t1)
1177 t1 = re.sub("PORTNUM", "%d" % i, script.udp_ports)
1178 newsh += re.sub("TEMPLATETYPE", self.name, t1)
1182 newsh += re.sub("TEMPLATEFILE", self.file_name, script.rpm)
1200 newspec += re.sub("FILENAME", self.program, spec.define_relabel_files_end)
1202 newspec += re.sub("FILENAME", self.initscript, spec.define_relabel_files_end)
1204 newspec += re.sub("FILENAME", i, spec.define_relabel_files_end)
1206 newspec += re.sub("FILENAME", i, spec.define_relabel_files_end)
1208 newspec += re.sub("VERSION", selinux_policyver, spec.base_section)
1209 newspec = re.sub("MODULENAME", self.file_name, newspec)
1210 newspec = re.sub("DOMAINNAME", self.name, newspec)
1213 newspec += re.sub("MODULENAME", self.file_name, spec.mid_section)
1214 newspec = re.sub("DOMAINNAME", self.name, newspec)
1215 newspec = re.sub("TODAYSDATE", time.strftime("%a %b %e %Y"), newspec)
1218 newspec = re.sub("%relabel_files", "", newspec)
1222 newspec = re.sub(".*%s_selinux.8.*" % self.name, "", newspec)
1225 newspec = re.sub(".*%s_u.*" % self.name, "", newspec)