提交 de7dc131 编写于 作者: R Rich Felker

halt getspnam[_r] search on error accessing TCB shadow

fallback to /etc/shadow should happen only when the entry is not found
in the TCB shadow. otherwise transient errors or permission errors can
cause inconsistent results.
上级 9db81b86
......@@ -94,6 +94,8 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct
return errno;
}
} else {
if (errno != ENOENT && errno != ENOTDIR)
return errno;
f = fopen("/etc/shadow", "rbe");
if (!f) {
if (errno != ENOENT && errno != ENOTDIR)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册