• Home
  • Raw
  • Download

Lines Matching refs:self

30     def __init__(self, name, reason):  argument
32 self.name = name
33 self.reason = reason
41 def __init__(self): argument
42 self.uid = ""
43 self.gid = []
44 self.need_verified = False
45 self.enabled_critical = False
46 self.loc = ""
47 self.critical = []
48 self.related_item = ProcessItem()
50 def __init__(self, loc): argument
51 self.uid = ""
52 self.gid = []
53 self.need_verified = False
54 self.enabled_critical = False
55 self.loc = loc
56 self.critical = []
57 self.related_item = ProcessItem()
60 def _is_need_verified_uid(self, uid: str): argument
64 def _is_need_verified_gid(self, gid): argument
69 def _is_need_verified_critical(self, critical: list): argument
72 def set_uid(self, uid): argument
78 self.uid = uid
79 self.need_verified = True
81 def append_gid(self, gid): argument
86 if CfgItem._is_need_verified_gid(gid) and gid not in self.gid:
87 self.gid.append(gid)
88 self.need_verified = True
90 def set_critical(self, critical: bool): argument
92 self.critical = critical
93 self.enabled_critical = True
95 def handle_socket(self, socket: dict): argument
101 self.need_verified = True
102 if self.uid != "" and self.uid != i["uid"]:
104 print("Cfg location: {}".format(self.loc))
106 self.uid = i["uid"]
108 if isinstance(i["gid"], str) and i["gid"] not in self.gid:
109 self.append_gid(i["gid"])
112 self.append_gid(item)
115 def record_related_item(self, related_item): argument
120 self.related_item = related_item
127 def __init__(self): argument
128 self.name = ""
129 self.uid = ""
130 self.gid = []
131 self.critical = []
133 def __init__(self, process_item=None): argument
138 self.name = ""
139 self.uid = ""
140 self.gid = []
141 self.critical = []
144 self.name = process_item["name"]
147 self.uid = process_item["uid"]
149 self.uid = ""
152 self.gid = []
153 self.gid.append(process_item["gid"])
155 self.gid = process_item["gid"]
157 self.gid = []
159 self.critical = process_item["critical"]
161 self.critical = []
163 def verify(self, cfg_item): argument
167 if self.uid or self.gid:
168 return self._verify_uid(cfg_item.uid) and self._verify_gid(cfg_item.gid)
169 if self.critical:
170 return self.critical == cfg_item.critical
173 def _verify_uid(self, uid): argument
174 return not ((uid == "root" or uid == "system") and (uid != self.uid))
176 def _verify_gid(self, gid): argument
177 return not ("root" in gid and "root" not in self.gid)