dtsession: revise localAuthenticate.

This commit is contained in:
Liang Chang
2021-02-01 08:06:07 +08:00
committed by Jon Trulson
parent 7d8dea61b2
commit e68846d543

View File

@@ -1611,6 +1611,9 @@ localAuthenticate(
char *service;
struct passwd *pwent;
if (!(name && name[0])) name = NULL;
if (uid < 0) uid = 0;
if (!(name || passwd)) return True;
if (!passwd) return False;
if (!(pwent = name ? getpwnam(name) : getpwuid(uid))) return False;