userdb-passwd.c revision 00bde9ae9eab9e720462bf6ec9a4dd85e88c3bbf
b9f30617c2c96d54acbc4f85ed17b939c4f28916Timo Sirainen/* Copyright (C) 2002-2003 Timo Sirainen */
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenstatic void passwd_lookup(struct auth_request *auth_request,
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_request_log_debug(auth_request, "passwd", "lookup");
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_request_log_info(auth_request, "passwd", "unknown user");
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen callback(USERDB_RESULT_USER_UNKNOWN, NULL, auth_request);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen if (strcasecmp(pw->pw_name, auth_request->user) != 0) {
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen /* try to catch broken NSS implementations (nss_ldap) */
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen "getpwnam() lookup returned different user than was "
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen "requested (%s != %s).",
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_stream_reply_add(reply, NULL, pw->pw_name);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_stream_reply_add(reply, "system_user", pw->pw_name);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_stream_reply_add(reply, "uid", dec2str(pw->pw_uid));
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_stream_reply_add(reply, "gid", dec2str(pw->pw_gid));
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen auth_stream_reply_add(reply, "home", pw->pw_dir);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainen callback(USERDB_RESULT_OK, reply, auth_request);
9f0f2de10e4ea0c99052bf4b2bef8179f2536228Timo Sirainenstatic void passwd_passwd_init(struct userdb_module *module,