Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
b3247885
Commit
b3247885
authored
Feb 15, 2004
by
Niels Möller
Browse files
(do_lookup_user): Just ignore shadow database if
getspnam returns NULL. Rev: src/unix_user.c:1.66
parent
77983e93
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/unix_user.c
View file @
b3247885
...
...
@@ -1134,15 +1134,19 @@ do_lookup_user(struct user_db *s,
/* Check for root login */
if
(
!
passwd
->
pw_uid
&&
!
self
->
allow_root
)
goto
fail
;
#if HAVE_GETSPNAM
{
struct
spwd
*
shadowpwd
;
/* FIXME: What's the most portable way to test for shadow
* passwords? For now, we look up shadow database if and only if
* the passwd field equals "x". */
if
(
!
strcmp
(
crypted
,
"x"
))
* the passwd field equals "x". If there's no shadow record, we
* just keep the value from the passwd-database, the user may be
* able to login using a publickey, or the password helper. */
if
(
strcmp
(
crypted
,
"x"
)
==
0
&&
(
shadowpwd
=
getspnam
(
cname
)))
{
struct
spwd
*
shadowpwd
;
/* Current day number since January 1, 1970.
*
* FIXME: Which timezone is used in the /etc/shadow file? */
...
...
@@ -1190,6 +1194,7 @@ do_lookup_user(struct user_db *s,
crypted
=
shadowpwd
->
sp_pwdp
;
}
}
#endif
/* HAVE_GETSPNAM */
/* Check again for empty passwd field (as it may have been
* replaced by the shadow one). */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment