def insecure_inode(path):
"""This particular inode can be altered by someone other than the owner"""
pathstat = os.stat(path).st_mode
# Directories with a sticky bit are always acceptable.
if os.path.isdir(path) and pathstat & stat.S_ISVTX:
return False
# The path is writable by someone who is not us.
elif pathstat & (stat.S_IWGRP | stat.S_IWOTH):
return True
else:
return False
评论列表
文章目录