equal
deleted
inserted
replaced
94 self.quiet = self.verbose = False |
94 self.quiet = self.verbose = False |
95 |
95 |
96 def _is_trusted(self, fp, f, warn=True): |
96 def _is_trusted(self, fp, f, warn=True): |
97 if not self.check_trusted: |
97 if not self.check_trusted: |
98 return True |
98 return True |
|
99 st = util.fstat(fp) |
|
100 if util.isowner(fp, st): |
|
101 return True |
99 tusers = self.trusted_users |
102 tusers = self.trusted_users |
100 tgroups = self.trusted_groups |
103 tgroups = self.trusted_groups |
101 if (tusers or tgroups) and '*' not in tusers and '*' not in tgroups: |
104 if (tusers or tgroups) and '*' not in tusers and '*' not in tgroups: |
102 st = util.fstat(fp) |
|
103 user = util.username(st.st_uid) |
105 user = util.username(st.st_uid) |
104 group = util.groupname(st.st_gid) |
106 group = util.groupname(st.st_gid) |
105 if user not in tusers and group not in tgroups: |
107 if user not in tusers and group not in tgroups: |
106 if warn and self.report_untrusted: |
108 if warn and self.report_untrusted: |
107 self.warn(_('Not trusting file %s from untrusted ' |
109 self.warn(_('Not trusting file %s from untrusted ' |