diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/logind/Makefile | 2 | ||||
-rw-r--r-- | daemon/logind/logind.c | 15 |
2 files changed, 8 insertions, 9 deletions
diff --git a/daemon/logind/Makefile b/daemon/logind/Makefile index 246b6c5e..7666cf95 100644 --- a/daemon/logind/Makefile +++ b/daemon/logind/Makefile @@ -4,7 +4,7 @@ SRCROOT= ../.. PROGRAMS= logind loginc UTILDIR= $(SRCROOT)/util -UTILOBJ= $(UTILDIR)/util_var.o $(UTILDIR)/util_passwd.o +UTILOBJ= $(UTILDIR)/util_var.o LDLIBS+=$(SRCROOT)/common/bbs/libcmbbs.a \ $(SRCROOT)/common/sys/libcmsys.a \ diff --git a/daemon/logind/logind.c b/daemon/logind/logind.c index 8d7a9e16..4c30a49d 100644 --- a/daemon/logind/logind.c +++ b/daemon/logind/logind.c @@ -832,8 +832,8 @@ auth_user_challenge(login_ctx *ctx) { char *uid = ctx->userid, *passbuf = ctx->passwd; - const char *free_uid = auth_is_free_userid(uid); + userec_t user = {0}; if (free_uid) { @@ -841,18 +841,17 @@ auth_user_challenge(login_ctx *ctx) return AUTH_RESULT_FREEID; } - // reuse cuser - memset(&cuser, 0, sizeof(cuser)); - if( initcuser(uid) < 1 || !cuser.userid[0] || - !checkpasswd(cuser.passwd, passbuf) ) + if (passwd_load_user(uid, &user) < 1 || + !user.userid[0] || + !checkpasswd(user.passwd, passbuf) ) { - if (cuser.userid[0]) - strcpy(uid, cuser.userid); + if (user.userid[0]) + strcpy(uid, user.userid); return AUTH_RESULT_FAIL; } // normalize user id - strcpy(uid, cuser.userid); + strcpy(uid, user.userid); return AUTH_RESULT_OK; } |