Mercurial > public > mercurial-scm > hg-stable
diff mercurial/ui.py @ 3098:c27d1e1798a3
Back out trusted hgrc change for now
Backed out changeset 494521a3f1425
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 15 Sep 2006 16:00:16 -0500 |
parents | 494521a3f142 |
children | 09e8aecd8016 |
line wrap: on
line diff
--- a/mercurial/ui.py Tue Aug 22 20:45:03 2006 -0300 +++ b/mercurial/ui.py Fri Sep 15 16:00:16 2006 -0500 @@ -19,8 +19,6 @@ # this is the parent of all ui children self.parentui = None self.readhooks = list(readhooks) - self.trusted_users = {} - self.trusted_groups = {} self.cdata = ConfigParser.SafeConfigParser() self.readconfig(util.rcpath()) @@ -39,8 +37,6 @@ # parentui may point to an ui object which is already a child self.parentui = parentui.parentui or parentui self.readhooks = list(parentui.readhooks or readhooks) - self.trusted_users = parentui.trusted_users.copy() - self.trusted_groups = parentui.trusted_groups.copy() parent_cdata = self.parentui.cdata self.cdata = ConfigParser.SafeConfigParser(parent_cdata.defaults()) # make interpolation work @@ -76,22 +72,7 @@ fn = [fn] for f in fn: try: - fp = open(f) - except IOError: - continue - if ((self.trusted_users or self.trusted_groups) and - '*' not in self.trusted_users and - '*' not in self.trusted_groups): - st = util.fstat(fp) - user = util.username(st.st_uid) - group = util.groupname(st.st_gid) - if (user not in self.trusted_users and - group not in self.trusted_groups): - self.warn(_('not reading file %s from untrusted ' - 'user %s, group %s\n') % (f, user, group)) - continue - try: - self.cdata.readfp(fp, f) + self.cdata.read(f) except ConfigParser.ParsingError, inst: raise util.Abort(_("Failed to parse %s\n%s") % (f, inst)) # translate paths relative to root (or home) into absolute paths @@ -100,13 +81,6 @@ for name, path in self.configitems("paths"): if path and "://" not in path and not os.path.isabs(path): self.cdata.set("paths", name, os.path.join(root, path)) - user = util.username() - if user is not None: - self.trusted_users[user] = 1 - for user in self.configlist('trusted', 'users'): - self.trusted_users[user] = 1 - for group in self.configlist('trusted', 'groups'): - self.trusted_groups[group] = 1 for hook in self.readhooks: hook(self)