eas_acls.py 文件源码

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

项目:rdiff-backup 作者: sol1 项目源码 文件源码
def set_rp_acl(rp, entry_list = None, default_entry_list = None,
               map_names = 1):
    """Set given rp with ACL that acl_text defines.  rp should be local"""
    assert rp.conn is Globals.local_connection
    if entry_list: acl = list_to_acl(entry_list, map_names)
    else: acl = posix1e.ACL()

    try:
        acl.applyto(encode(rp.path))
    except IOError, exc:
        if exc[0] == errno.EOPNOTSUPP:
            log.Log("Warning: unable to set ACL on %s: %s" % 
                    (repr(rp.path), exc), 4)
            return
        else: raise

    if rp.isdir():
        if default_entry_list:
            def_acl = list_to_acl(default_entry_list, map_names)
        else: def_acl = posix1e.ACL()
        def_acl.applyto(encode(rp.path), posix1e.ACL_TYPE_DEFAULT)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号