crypto.py 文件源码

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

项目:batch-shipyard 作者: Azure 项目源码 文件源码
def check_ssh_private_key_filemode(ssh_private_key):
    # type: (pathlib.Path) -> bool
    """Check SSH private key filemode
    :param pathlib.Path ssh_private_key: SSH private key
    :rtype: bool
    :return: private key filemode is ok
    """
    def _mode_check(fstat, flag):
        return bool(fstat & flag)
    if util.on_windows():
        return True
    fstat = ssh_private_key.stat().st_mode
    modes = frozenset((stat.S_IRWXG, stat.S_IRWXO))
    return not any([_mode_check(fstat, x) for x in modes])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号