using hook for client_check_cb
David K. Sayre
dks at lanl.gov
Wed Feb 22 19:13:21 EST 2006
I have another interesting problem. I am authenticating users fine,
but I would like to distinguish between authenticated and non-
authenticated users. Basically I would like to let people log in
without authenticating, but let the users know if they are talking to
an authenticated user.
The initial thought is that I would append something to the end of
the nick. So I am attempting to append a * or a _lanl. The problem I
am getting is that when I rename a user, I start getting error
messages to the clients stating "Server load is temporarily too
heavy. Please wait a while and try again".
Here is an exempt of the code I am using,
void *pam_auth(va_list args)
{
struct Client *source_p = va_arg(args, struct Client *);
const char *username = va_arg(args, const char *);
....
user = source_p->name;
user_auth = (char *)malloc(sizeof(char) * (strlen(user) + 6));
sprintf(user_auth, "%s_lanl", user);
....
if (retval == PAM_SUCCESS) {
ilog(L_INFO, "%s Authenticated\n", user);
change_local_nick(source_p,source_p,user_auth);
} else {
ilog(L_INFO, "%s Not Authenticated\n", user);
}
Are there any ideas out there? Should I not be sending in my source_p
as the client and server?
David Sayre
Los Alamos National Labs
On Feb 22, 2006, at 8:24 AM, David K. Sayre wrote:
> That worked perfectly. I was thinking about doing that, but I was
> trying to call verify_access directly, and then I was thinking
> about redoing a lot of that code in my module, this works perfectly
> and is much easier.
>
> Thank you very much,
> David Sayre
> Los Alamos National Labs
>
> On Feb 22, 2006, at 3:10 AM, Piotr Niżyński wrote:
>
>> David K. Sayre napisał(a):
>>> void *pam_auth(va_list args)
>>> {
>>> struct Client *source_p = va_arg(args, struct Client *);
>>> const char *username = va_arg(args, const char *);
>>> return source_p;
>>> }
>>
>> Most likely the problem is you are not attaching an I-line to the
>> client. The easiest way to solve this would be:
>>
>> return pass_callback(hook, source_p, username);
>>
>> instead of return source_p.
>>
>> As you can see, s_user.c does the following in
>> register_local_user, just after calling client_check_cb:
>>
>> ptr = source_p->localClient->confs.head;
>> aconf = map_to_conf(ptr->data);
>>
>> if (!IsGotId(source_p))
>> [...]
>>
>> so it assumes there IS a conf attached to source_p->localClient-
>> >confs.head. Besides, it can be assumed in various ircd places,
>> and also it is required to have the ping freq/sendq size/limits
>> working.
>>
>> Regards.
>
>
More information about the hybrid
mailing list