summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-12 20:22:07 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-12 20:22:07 +0800
commit2f6959aecaaaed4980f7c8740f2fae2c8fc326ca (patch)
treed3d59847cadac9939bc0e9945530cfd1b7a5caeb /daemon
parentc5f8e88cde8ad8120fd5e2bdaddd2f5591502aa8 (diff)
downloadpttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.gz
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.bz2
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.lz
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.xz
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.zst
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.zip
* refine cmbbs: move util_passwd.o to cmbbs/passwd.c.
* note: in order to workaround the buggy/dirty synchronization hacks, changed 'passwd_query' and 'passwd_update' to passwd_sync_*. * util/* and daemon/* use directly passwd_query/update, and mbbsd should use passwd_sync_*. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4574 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'daemon')
-rw-r--r--daemon/logind/Makefile2
-rw-r--r--daemon/logind/logind.c15
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;
}