[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "K-lined"-comment patch
I think a better solution would be to pass a pointer to find_kill()...
instead of creating any more lame global variables. This
is the solution I used in 2.8.x
- Chris
On Mon, 21 Apr 1997, Kaspar Landsberg wrote:
> Hi,
>
> the following patch replaces the string "K-lined", which is shown when a
> user tries to connect to a server that has a k-line for him, by the k-line
> comment from the 'K:'-field in the ircd.conf file - if there's any.
> I hadn't had any good solution handy which would have made the format look
> like "K-lined (reason)", so it's just "reason"... :-|
>
> It's a rather quick hack and it seems to work.
>
> Bye, Kasi
>
> --- cut here ---
> *** old/h.h Mon Apr 21 19:07:07 1997
> --- h.h Mon Apr 21 19:48:39 1997
> ***************
> *** 41,46 ****
> --- 41,47 ----
> extern anUser *usrtop;
> extern istat_t istat;
> extern FdAry fdas, fdall, fdaa;
> + extern char *kline_reason;
> #endif
>
> extern void setup_server_channels __P((aClient *));
> *** old/s_conf.c Mon Apr 21 18:46:58 1997
> --- s_conf.c Mon Apr 21 20:04:07 1997
> ***************
> *** 77,82 ****
> --- 77,84 ----
> static int check_time_interval __P((char *, char *));
> static int lookup_confhost __P((aConfItem *));
>
> + char *kline_reason;
> +
> aConfItem *conf = NULL;
>
> /*
> ***************
> *** 1130,1135 ****
> --- 1132,1139 ----
> char reply[256], *host, *name;
> aConfItem *tmp;
>
> + kline_reason = NULL;
> +
> if (!cptr->user)
> return 0;
>
> ***************
> *** 1162,1171 ****
> sendto_one(cptr, reply,
> ME, ERR_YOUREBANNEDCREEP, cptr->name);
> else if (tmp)
> ! sendto_one(cptr, ":%s %d %s :*** %s", ME,
> ! ERR_YOUREBANNEDCREEP, cptr->name,
> ! BadPtr(tmp->passwd) ?
> ! "You are not welcome to this server" : tmp->passwd);
>
> return (tmp ? -1 : 0);
> }
> --- 1166,1179 ----
> sendto_one(cptr, reply,
> ME, ERR_YOUREBANNEDCREEP, cptr->name);
> else if (tmp)
> ! sendto_one(cptr, ":%s %d %s :*** %s", ME,
> ! ERR_YOUREBANNEDCREEP, cptr->name,
> ! BadPtr(tmp->passwd) ?
> ! "You are not welcome to this server" : tmp->passwd);
> !
> ! if (tmp)
> ! if (!BadPtr(tmp->passwd) && !isdigit(*tmp->passwd))
> ! kline_reason = tmp->passwd;
>
> return (tmp ? -1 : 0);
> }
> *** old/s_user.c Mon Apr 21 18:56:11 1997
> --- s_user.c Mon Apr 21 19:10:33 1997
> ***************
> *** 463,469 ****
> sendto_flog(sptr, " K lined ", 0, sptr->user->username,
> sptr->user->host);
> #endif
> ! return exit_client(cptr, sptr, &me, "K-lined");
> }
> #ifdef R_LINES
> if (find_restrict(sptr))
> --- 463,470 ----
> sendto_flog(sptr, " K lined ", 0, sptr->user->username,
> sptr->user->host);
> #endif
> ! return exit_client(cptr, sptr, &me, (kline_reason) ?
> ! kline_reason : "K-lined");
> }
> #ifdef R_LINES
> if (find_restrict(sptr))
> --- cut here ---
>
> --
> Kaspar Landsberg, <kl@xxxxxxxxxxxxxxx>
>