Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 3678:7e622c9a9707
Update trusted_users only after we've seen a file not owned by the user
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 18 Nov 2006 23:51:15 -0200 |
parents | 1a0fa3914c46 |
children | 98f2507c5551 |
comparison
equal
deleted
inserted
replaced
3677:1a0fa3914c46 | 3678:7e622c9a9707 |
---|---|
99 st = util.fstat(fp) | 99 st = util.fstat(fp) |
100 if util.isowner(fp, st): | 100 if util.isowner(fp, st): |
101 return True | 101 return True |
102 tusers = self.trusted_users | 102 tusers = self.trusted_users |
103 tgroups = self.trusted_groups | 103 tgroups = self.trusted_groups |
104 if not tusers: | |
105 user = util.username() | |
106 if user is not None: | |
107 self.trusted_users[user] = 1 | |
108 self.fixconfig(section='trusted') | |
104 if (tusers or tgroups) and '*' not in tusers and '*' not in tgroups: | 109 if (tusers or tgroups) and '*' not in tusers and '*' not in tgroups: |
105 user = util.username(st.st_uid) | 110 user = util.username(st.st_uid) |
106 group = util.groupname(st.st_gid) | 111 group = util.groupname(st.st_gid) |
107 if user not in tusers and group not in tgroups: | 112 if user not in tusers and group not in tgroups: |
108 if warn and self.report_untrusted: | 113 if warn and self.report_untrusted: |
201 | 206 |
202 if name is None or name == 'interactive': | 207 if name is None or name == 'interactive': |
203 self.interactive = self.configbool("ui", "interactive", True) | 208 self.interactive = self.configbool("ui", "interactive", True) |
204 | 209 |
205 # update trust information | 210 # update trust information |
206 if section is None or section == 'trusted': | 211 if (section is None or section == 'trusted') and self.trusted_users: |
207 user = util.username() | 212 for user in self.configlist('trusted', 'users'): |
208 if user is not None: | |
209 self.trusted_users[user] = 1 | 213 self.trusted_users[user] = 1 |
210 for user in self.configlist('trusted', 'users'): | 214 for group in self.configlist('trusted', 'groups'): |
211 self.trusted_users[user] = 1 | 215 self.trusted_groups[group] = 1 |
212 for group in self.configlist('trusted', 'groups'): | |
213 self.trusted_groups[group] = 1 | |
214 | 216 |
215 def setconfig(self, section, name, value): | 217 def setconfig(self, section, name, value): |
216 if not self.overlay: | 218 if not self.overlay: |
217 self.overlay = util.configparser() | 219 self.overlay = util.configparser() |
218 for cdata in (self.overlay, self.cdata, self.ucdata): | 220 for cdata in (self.overlay, self.cdata, self.ucdata): |