eas_acls.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:rdiff-backup 作者: sol1 项目源码 文件源码
def clear_rp(self, rp):
        """Delete all the extended attributes in rpath"""
        try:
            for name in rp.conn.xattr.listxattr(encode(rp.path),
                                                rp.issym()):
                try:
                    rp.conn.xattr.removexattr(encode(rp.path),
                                            name, rp.issym())
                except IOError, exc:
                    # SELinux attributes cannot be removed, and we don't want
                    # to bail out or be too noisy at low log levels.
                    if exc[0] == errno.EACCES:
                        log.Log("Warning: unable to remove xattr %s from %s"
                            % (name, repr(rp.path)), 7)
                        continue
                    else: raise
        except IOError, exc:
            if exc[0] == errno.EOPNOTSUPP or exc[0] == errno.EPERM:
                return # if not supported, consider empty
            elif exc[0] == errno.ENOENT: # path is bad
                log.Log("Warning: unable to clear xattrs on %s: %s" %
                        (repr(rp.path), exc), 3)
                return
            else: raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号