diff --git a/library/files/stat b/library/files/stat index 2839ca8e06f..8c717a395c4 100644 --- a/library/files/stat +++ b/library/files/stat @@ -132,8 +132,9 @@ def main(): if S_ISLNK(mode): d['lnk_source'] = os.path.realpath(path) - if S_ISREG(mode) and get_md5: - d['md5'] = module.md5(path) + if S_ISREG(mode) and get_md5 and os.access(path,os.R_OK): + d['md5'] = module.md5(path) + try: pw = pwd.getpwuid(st.st_uid)