Seeding from the 1.2 tree.
This commit is contained in:
BIN
contrib/BX.plus.XMMS.tar.gz
Normal file
BIN
contrib/BX.plus.XMMS.tar.gz
Normal file
Binary file not shown.
1065
contrib/BitchX-1.0c14-IPv6-2.patch
Normal file
1065
contrib/BitchX-1.0c14-IPv6-2.patch
Normal file
File diff suppressed because it is too large
Load Diff
96
contrib/BitchX-1.0c14-LATIN.patch
Normal file
96
contrib/BitchX-1.0c14-LATIN.patch
Normal file
@@ -0,0 +1,96 @@
|
||||
--- BitchX.orig/include/color.h Mon Nov 22 00:47:16 1999
|
||||
+++ BitchX/include/color.h Mon Dec 27 19:21:51 1999
|
||||
@@ -419,13 +419,13 @@
|
||||
#define DEFAULT_FORMAT_476_FSET "$G [$1] You are not opped"
|
||||
|
||||
#ifdef ONLY_STD_CHARS
|
||||
-#define DEFAULT_FORMAT_ACTION_FSET "%@%K* %W$1 %n$4-"
|
||||
-#define DEFAULT_FORMAT_ACTION_AR_FSET "%@%K* %Y$1 %n$4-"
|
||||
-#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET "%@%K* %Y$1/$3 %n$4-"
|
||||
-#define DEFAULT_FORMAT_ACTION_OTHER_FSET "%@%K* %n>%c$1 %n$3-"
|
||||
-#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET "%@%K* %y>%c$1 %n$3-"
|
||||
-#define DEFAULT_FORMAT_ACTION_USER_FSET "%@%K* %n>%c$1 %n$3-"
|
||||
-#define DEFAULT_FORMAT_ACTION_USER_AR_FSET "%@%K* %y>%c$1 %n$3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%K* %W$1 %n$4-":"* $1 $4-"
|
||||
+#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%K* %Y$1 %n$4-":"* $1 $4-"
|
||||
+#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET ansi?"%@%K* %Y$1/$3 %n$4-":"* $1/$3 $4-"
|
||||
+#define DEFAULT_FORMAT_ACTION_OTHER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"* >$1 $3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET ansi?"%@%K* %y>%c$1 %n$3-":"* >$1 $3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_USER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"* >$1 $3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_USER_AR_FSET ansi?"%@%K* %y>%c$1 %n$3-":"* >$1 $3-"
|
||||
#else
|
||||
#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%K<> %W$1 %n$4-":"%@<02> $1 $4-"
|
||||
#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%K<> %Y$1 %n$4-":"%@<02> $1 $4-"
|
||||
@@ -668,26 +668,26 @@
|
||||
#define DEFAULT_FORMAT_WHO_FSET "%Y$[10]0 %W$[10]1%w %c$[3]2 %w$3%R@%w$4 ($6-)"
|
||||
|
||||
#ifdef ONLY_STD_CHARS
|
||||
-#define DEFAULT_FORMAT_WHOIS_AWAY_FSET "%G| %Wa%nway : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_BOT_FSET "%G| %Wb%not : A:$0 P:$1 [$2] $3-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET "%G| %Wc%nhannels : $0-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET "%G| %Wf%nriend : L:$0 A:$1 P:$2 $3-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_HEADER_FSET "%G------------------------------------------------"
|
||||
-#define DEFAULT_FORMAT_WHOIS_IDLE_FSET "%G| %Wi%ndle : $0 hours $1 mins $2 secs (signon: $stime($3))"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SHIT_FSET "%G| %Ws%nhit : L:$0 [$1] $2 $3-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET "%K %Ws%nignon : $0-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_NAME_FSET "%G| %Wi%nrcname : $0-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_NICK_FSET "%G| %W$0 %K(%n$1@$2%K) %K(%W$3-%K)"
|
||||
-#define DEFAULT_FORMAT_WHOIS_OPER_FSET "%G| %Wo%nperator : $0 $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SERVER_FSET "%G| %Ws%nerver : $0 ($1-)"
|
||||
-#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET "%G------ %WWho %G---------------------- %WChannel%G--- %wServer %G------------- %wSeconds"
|
||||
-#define DEFAULT_FORMAT_WHOLEFT_USER_FSET "%G<>%n $[-10]0!$[20]1 $[10]2 $[20]4 $3"
|
||||
-#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET "%G-----------------------------------------------"
|
||||
-#define DEFAULT_FORMAT_WHOWAS_NICK_FSET "%G| %W$0%n was %K(%n$1@$2%K)"
|
||||
-#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET "%K| %Wa%ndmin : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET "%K| %Ws%nervice : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_HELP_FSET "%K| %Wh%nelp : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET "%K| %Wr%negister : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_AWAY_FSET ansi?"%K| %Wa%nway : $0 - $1-":"| away : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_BOT_FSET ansi?"%g| %Wb%not : A:$0 P:$1 [$2] $3-":"| bot : A:$0 P:$1 [$2] $3-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET ansi?"%g| %Wc%nhannels : $0-":"| channels : $0-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET ansi?"%g| %Wf%nriend : F:$0 $1-":"| friend : F:$0 $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_HEADER_FSET ansi?"%G.--------%g-%G--%g--%G-%g---------%K-%g--%K--%g-%K------------ -- -":".----------------------------------------- -- -"
|
||||
+#define DEFAULT_FORMAT_WHOIS_IDLE_FSET ansi?"%K: %Wi%ndle : $0 hours $1 mins $2 secs (signon: $stime($3))":": idle : $0 hours $1 mins $2 secs (signon: $stime($3))"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SHIT_FSET ansi?"%g| %Ws%nhit : L:$0 [$1] $2 $3-":"| shit : L:$0 [$1] $2 $3-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET ansi?"%K| %Ws%nignon : $0-":"| signon : $0-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_NAME_FSET ansi?"%G: %Wi%nrcname : $0-":": ircname : $0-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_NICK_FSET ansi?"%G| %W$0 %K(%n$1@$2%K) %K(%W$3-%K)":"| $0 ($1@$2) ($3-)"
|
||||
+#define DEFAULT_FORMAT_WHOIS_OPER_FSET ansi?"%K| %Wo%nperator : $0 $1-":"| operator : $0 $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SERVER_FSET ansi?"%K| %Ws%nerver : $0 ($1-)":"| server : $0 ($1-)"
|
||||
+#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET ansi?"%G.----- %WWho %G-----%g---%G---%g--%G-----%g--%G-- %WChannel%g--- %wServer %G-%g----%G--%g--%G----%g %wSeconds":".----- Who ---------------------- Channel--- Server ------------- Seconds"
|
||||
+#define DEFAULT_FORMAT_WHOLEFT_USER_FSET ansi?"%G|%n $[-10]0!$[20]1 $[10]2 $[20]4 $3":"| $[-10]0!$[20]1 $[10]2 $[20]4 $3"
|
||||
+#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET ansi?"%G.--------%g-%G--%g--%G-%g---------%K-%g--%K--%g-%K------------ -- -":".----------------------------------------- -- -"
|
||||
+#define DEFAULT_FORMAT_WHOWAS_NICK_FSET ansi?"%G| %W$0%n was %K(%n$1@$2%K)":"| $0 was ($1@$2)"
|
||||
+#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET ansi?"%K| %Wa%ndmin : $0 - $1-":"| admin : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET ansi?"%K| %Ws%nervice : $0 - $1-":"| service : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_HELP_FSET ansi?"%K| %Wh%nelp : $0 - $1-":"| help : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET ansi?"%K| %Wr%negister : $0 - $1-":"| register : $0 - $1-"
|
||||
#else
|
||||
#define DEFAULT_FORMAT_WHOIS_AWAY_FSET ansi?"%K| %Wa%nway : $0 - $1-":"| away : $0 - $1-"
|
||||
#define DEFAULT_FORMAT_WHOIS_BOT_FSET ansi?"%g| %Wb%not : A:$0 P:$1 [$2] $3-":"| bot : A:$0 P:$1 [$2] $3-"
|
||||
--- BitchX.orig/source/vars.c Tue Nov 16 05:58:01 1999
|
||||
+++ BitchX/source/vars.c Mon Dec 27 19:16:46 1999
|
||||
@@ -1392,6 +1392,9 @@
|
||||
#ifndef ONLY_STD_CHARS
|
||||
set_string_var(SHOW_NUMERICS_STR_VAR, value ? "[1;31m<31>[0m[1;37m<37>[1;31m<31>[0m" : "-:-");
|
||||
set_numeric_string(current_window, value ? "[1;31m<31>[0m[1;37m<37>[1;31m<31>[0m":"-:-", 0);
|
||||
+#else
|
||||
+ set_string_var(SHOW_NUMERICS_STR_VAR, value ? "[1;31m-[0m[1;37m:[1;31m-[0m" : "-:-");
|
||||
+ set_numeric_string(current_window, value ? "[1;31m-[0m[1;37m:[1;31m-[0m":"-:-", 0);
|
||||
#endif
|
||||
reinit_status(win, unused, value);
|
||||
}
|
||||
--- BitchX.orig/source/irc.c Thu Dec 16 12:05:39 1999
|
||||
+++ BitchX/source/irc.c Mon Dec 27 19:23:04 1999
|
||||
@@ -97,7 +97,11 @@
|
||||
* switchs are set */
|
||||
dead = 0,
|
||||
inhibit_logging = 0,
|
||||
+#ifndef ONLY_STD_CHARS
|
||||
startup_ansi = 1, /* display startup ansi */
|
||||
+#else
|
||||
+ startup_ansi = 0, /* DO NOT display startup ansi */
|
||||
+#endif
|
||||
auto_connect = 1, /* auto-connect to first server*/
|
||||
|
||||
background = 0,
|
||||
19
contrib/BitchX-configure.patch
Normal file
19
contrib/BitchX-configure.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
diff -ru BitchX/configure.in BitchX.AX/configure.in
|
||||
--- BitchX/configure.in Tue Jan 4 07:43:35 2000
|
||||
+++ BitchX.AX/configure.in Wed Jan 19 17:54:30 2000
|
||||
@@ -290,6 +290,15 @@
|
||||
|
||||
if test x"$blahhack" = x"1"; then
|
||||
blahhack=0
|
||||
+ AC_MSG_CHECKING(for tputs in ncurses/termcap.h)
|
||||
+ AC_EGREP_CPP([tputs( | |\()],[#include <ncurses/termcap.h>
|
||||
+ ], [ AC_DEFINE(HAVE_TERMCAP_H)
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+ havetputs=1 AC_CHECK_HEADER(ncurses/termcap.h)], blahhack=1; AC_MSG_RESULT(no))
|
||||
+ fi
|
||||
+
|
||||
+ if test x"$blahhack" = x"1"; then
|
||||
+ blahhack=0
|
||||
AC_MSG_CHECKING(for tputs in curses.h)
|
||||
AC_EGREP_CPP([tputs( | |\()],[#include <curses.h>
|
||||
], [ AC_DEFINE(USING_CURSES)
|
||||
504
contrib/bx12-sasl.diff
Normal file
504
contrib/bx12-sasl.diff
Normal file
@@ -0,0 +1,504 @@
|
||||
Index: include/ircaux.h
|
||||
===================================================================
|
||||
--- include/ircaux.h (revision 210)
|
||||
+++ include/ircaux.h (working copy)
|
||||
@@ -256,6 +256,8 @@
|
||||
char *tparm (const char *, ...);
|
||||
#endif
|
||||
|
||||
+ int my_base64_encode (const void *, int, char **);
|
||||
+
|
||||
#ifndef HAVE_STRTOUL
|
||||
unsigned long strtoul (const char *, char **, int);
|
||||
#endif
|
||||
Index: include/modval.h
|
||||
===================================================================
|
||||
--- include/modval.h (revision 210)
|
||||
+++ include/modval.h (working copy)
|
||||
@@ -505,11 +505,11 @@
|
||||
#define close_all_server (*(void (*)(void ))global[CLOSE_ALL_SERVER])
|
||||
|
||||
#define read_server_file (*(int (*)(char *))global[READ_SERVER_FILE])
|
||||
-#define add_to_server_list (*(void (*)(char *, int , char *, char *, char *, int , int ))global[ADD_TO_SERVER_LIST])
|
||||
+#define add_to_server_list (*(void (*)(char *, int , char *, char *, char *, char *, char *, int , int ))global[ADD_TO_SERVER_LIST])
|
||||
#define build_server_list (*(int (*)(char *))global[BUILD_SERVER_LIST])
|
||||
#define display_server_list (*(void (*)(void ))global[DISPLAY_SERVER_LIST])
|
||||
#define create_server_list (*(char *(*)(char *))global[CREATE_SERVER_LIST])
|
||||
-#define parse_server_info (*(void (*)(char *, char **, char **, char **, char **))global[PARSE_SERVER_INFO])
|
||||
+#define parse_server_info (*(void (*)(char *, char **, char **, char **, char **, char **, char **))global[PARSE_SERVER_INFO])
|
||||
#define server_list_size (*(int (*)(void ))global[SERVER_LIST_SIZE])
|
||||
|
||||
#define find_server_refnum (*(int (*)(char *, char **))global[FIND_SERVER_REFNUM])
|
||||
Index: include/server.h
|
||||
===================================================================
|
||||
--- include/server.h (revision 210)
|
||||
+++ include/server.h (working copy)
|
||||
@@ -165,6 +165,8 @@
|
||||
int ssl_error;
|
||||
SSL* ssl_fd;
|
||||
#endif
|
||||
+ char *sasl_nick;
|
||||
+ char *sasl_pass;
|
||||
|
||||
/* recv_nick: the nickname of the last person to send you a privmsg */
|
||||
char *recv_nick;
|
||||
@@ -185,7 +187,7 @@
|
||||
int find_server_group (char *, int);
|
||||
char * find_server_group_name (int);
|
||||
|
||||
- void BX_add_to_server_list (char *, int, char *, char *, char *, int, int);
|
||||
+ void BX_add_to_server_list (char *, int, char *, char *, char *, char *, char *, int, int);
|
||||
int BX_build_server_list (char *);
|
||||
int connect_to_server (char *, int, int);
|
||||
void BX_get_connected (int, int);
|
||||
@@ -227,7 +229,7 @@
|
||||
void BX_set_server_operator (int, int);
|
||||
void BX_server_is_connected (int, int);
|
||||
int BX_parse_server_index (char *);
|
||||
- void BX_parse_server_info (char *, char **, char **, char **, char **);
|
||||
+ void BX_parse_server_info (char *, char **, char **, char **, char **, char **, char **);
|
||||
long set_server_bits (fd_set *, fd_set *);
|
||||
void BX_set_server_itsname (int, char *);
|
||||
void BX_set_server_version (int, int);
|
||||
@@ -395,6 +397,10 @@
|
||||
void clean_split_server_list (int, time_t);
|
||||
void write_server_list(char *);
|
||||
void write_server_file (char *);
|
||||
+// void set_server_sasl_nick(int, const char *);
|
||||
+ char *get_server_sasl_nick(int);
|
||||
+// void set_server_sasl_pass(int, const char *);
|
||||
+ char *get_server_sasl_pass(int);
|
||||
|
||||
#define USER_MODE 0x0001
|
||||
#define USER_MODE_A USER_MODE << 0
|
||||
Index: source/numbers.c
|
||||
===================================================================
|
||||
--- source/numbers.c (revision 210)
|
||||
+++ source/numbers.c (working copy)
|
||||
@@ -1407,6 +1407,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+ case 903: /* SASL authentication successful */
|
||||
+ case 904: /* SASL authentication failed */
|
||||
+ case 905: /* SASL message too long */
|
||||
+ case 906: /* SASL authentication aborted */
|
||||
+ case 907: /* You have already completed SASL authentication */
|
||||
+ {
|
||||
+ my_send_to_server(from_server, "CAP END");
|
||||
+ if (do_hook(current_numeric, "%s %s", from, *ArgList))
|
||||
+ display_msg(from, ArgList);
|
||||
+ break;
|
||||
+ }
|
||||
case 305:
|
||||
{
|
||||
if (comm == 305 && get_server_away(from_server))
|
||||
Index: source/compat.c
|
||||
===================================================================
|
||||
--- source/compat.c (revision 210)
|
||||
+++ source/compat.c (working copy)
|
||||
@@ -2401,3 +2401,58 @@
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
+
|
||||
+/* ----------------------- start of base64 stuff ---------------------------*/
|
||||
+/*
|
||||
+ * Copyright (c) 1995-2001 Kungliga Tekniska H<>gskolan
|
||||
+ * (Royal Institute of Technology, Stockholm, Sweden).
|
||||
+ * All rights reserved.
|
||||
+ *
|
||||
+ * This is licensed under the 3-clause BSD license, which is found above.
|
||||
+ */
|
||||
+
|
||||
+static char base64_chars[] =
|
||||
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
+
|
||||
+/*
|
||||
+ * Return a malloced, base64 string representation of the first 'size' bytes
|
||||
+ * starting at 'data'. Returns strlen(*str).
|
||||
+ */
|
||||
+int my_base64_encode (const void *data, int size, char **str)
|
||||
+{
|
||||
+ char *s, *p;
|
||||
+ int i;
|
||||
+ unsigned c;
|
||||
+ const unsigned char *q;
|
||||
+
|
||||
+// XXX
|
||||
+// p = s = (char *)new_malloc(size * 4 / 3 + 4);
|
||||
+ p = s = (char *)malloc(size * 4 / 3 + 4);
|
||||
+ if (p == NULL)
|
||||
+ return -1;
|
||||
+ q = (const unsigned char *) data;
|
||||
+ i = 0;
|
||||
+ for (i = 0; i < size;) {
|
||||
+ c = (unsigned)(unsigned char)q[i++];
|
||||
+ c *= 256;
|
||||
+ if (i < size)
|
||||
+ c += (unsigned)(unsigned char)q[i];
|
||||
+ i++;
|
||||
+ c *= 256;
|
||||
+ if (i < size)
|
||||
+ c += (unsigned)(unsigned char)q[i];
|
||||
+ i++;
|
||||
+ p[0] = base64_chars[(c & 0x00fc0000) >> 18];
|
||||
+ p[1] = base64_chars[(c & 0x0003f000) >> 12];
|
||||
+ p[2] = base64_chars[(c & 0x00000fc0) >> 6];
|
||||
+ p[3] = base64_chars[(c & 0x0000003f) >> 0];
|
||||
+ if (i > size)
|
||||
+ p[3] = '=';
|
||||
+ if (i > size + 1)
|
||||
+ p[2] = '=';
|
||||
+ p += 4;
|
||||
+ }
|
||||
+ *p = 0;
|
||||
+ *str = s;
|
||||
+ return strlen(s);
|
||||
+}
|
||||
Index: source/server.c
|
||||
===================================================================
|
||||
--- source/server.c (revision 210)
|
||||
+++ source/server.c (working copy)
|
||||
@@ -700,7 +700,9 @@
|
||||
char *cport = NULL,
|
||||
*password = NULL,
|
||||
*nick = NULL,
|
||||
- *snetwork = NULL;
|
||||
+ *snetwork = NULL,
|
||||
+ *sasl_nick = NULL,
|
||||
+ *sasl_pass = NULL;
|
||||
|
||||
/*
|
||||
* First of all, check for an existing server refnum
|
||||
@@ -708,10 +710,10 @@
|
||||
if ((refnum = parse_server_index(server)) != -1)
|
||||
return refnum;
|
||||
/*
|
||||
- * Next check to see if its a "server:port:password:nick:network"
|
||||
+ * Next check to see if its a "server:port:password:nick:network:saslnick:saslpass"
|
||||
*/
|
||||
else if (index(server, ':') || index(server, ','))
|
||||
- parse_server_info(server, &cport, &password, &nick, &snetwork);
|
||||
+ parse_server_info(server, &cport, &password, &nick, &snetwork, &sasl_nick, &sasl_pass);
|
||||
|
||||
else if (index(server, '['))
|
||||
{
|
||||
@@ -727,7 +729,7 @@
|
||||
}
|
||||
}
|
||||
/*
|
||||
- * Next check to see if its "server port password nick"
|
||||
+ * Next check to see if its "server port password nick network saslnick saslport"
|
||||
*/
|
||||
else if (rest && *rest)
|
||||
{
|
||||
@@ -735,6 +737,8 @@
|
||||
password = next_arg(*rest, rest);
|
||||
nick = next_arg(*rest, rest);
|
||||
snetwork = next_arg(*rest, rest);
|
||||
+ sasl_nick = next_arg(*rest, rest);
|
||||
+ sasl_pass = next_arg(*rest, rest);
|
||||
}
|
||||
|
||||
if (cport && *cport)
|
||||
@@ -744,7 +748,7 @@
|
||||
* Add to the server list (this will update the port
|
||||
* and password fields).
|
||||
*/
|
||||
- add_to_server_list(server, port, password, nick, snetwork, 0, 1);
|
||||
+ add_to_server_list(server, port, password, nick, snetwork, sasl_nick, sasl_pass, 0, 1);
|
||||
return from_server;
|
||||
}
|
||||
|
||||
@@ -756,7 +760,7 @@
|
||||
* passes. If the server is not on the list, it is added to the end. In
|
||||
* either case, the server is made the current server.
|
||||
*/
|
||||
-void BX_add_to_server_list (char *server, int port, char *password, char *nick, char *snetwork, int ssl, int overwrite)
|
||||
+void BX_add_to_server_list (char *server, int port, char *password, char *nick, char *snetwork, char *sasl_nick, char *sasl_pass, int ssl, int overwrite)
|
||||
{
|
||||
extern int default_swatch;
|
||||
if ((from_server = find_in_server_list(server, port)) == -1)
|
||||
@@ -785,6 +789,11 @@
|
||||
else if (!server_list[from_server].d_nickname)
|
||||
malloc_strcpy(&(server_list[from_server].d_nickname), nickname);
|
||||
|
||||
+ if (sasl_nick && *sasl_nick)
|
||||
+ malloc_strcpy(&(server_list[from_server].sasl_nick), sasl_nick);
|
||||
+ if (sasl_pass && *sasl_pass)
|
||||
+ malloc_strcpy(&(server_list[from_server].sasl_pass), sasl_pass);
|
||||
+
|
||||
make_notify_list(from_server);
|
||||
make_watch_list(from_server);
|
||||
set_umode(from_server);
|
||||
@@ -808,6 +817,20 @@
|
||||
else
|
||||
new_free(&(server_list[from_server].d_nickname));
|
||||
}
|
||||
+ if (sasl_nick || !server_list[from_server].sasl_nick)
|
||||
+ {
|
||||
+ if (sasl_nick && *sasl_nick)
|
||||
+ malloc_strcpy(&(server_list[from_server].sasl_nick), sasl_nick);
|
||||
+ else
|
||||
+ new_free(&(server_list[from_server].sasl_nick));
|
||||
+ }
|
||||
+ if (sasl_pass || !server_list[from_server].sasl_pass)
|
||||
+ {
|
||||
+ if (sasl_pass && *sasl_pass)
|
||||
+ malloc_strcpy(&(server_list[from_server].sasl_pass), sasl_pass);
|
||||
+ else
|
||||
+ new_free(&(server_list[from_server].sasl_pass));
|
||||
+ }
|
||||
}
|
||||
if (strlen(server) > strlen(server_list[from_server].name))
|
||||
malloc_strcpy(&(server_list[from_server].name), server);
|
||||
@@ -882,13 +905,13 @@
|
||||
*
|
||||
* With IPv6 patch it also supports comma as a delimiter.
|
||||
*/
|
||||
-void BX_parse_server_info (char *name, char **port, char **password, char **nick, char **snetwork)
|
||||
+void BX_parse_server_info (char *name, char **port, char **password, char **nick, char **snetwork, char **sasl_nick, char **sasl_pass)
|
||||
{
|
||||
char *ptr, delim;
|
||||
|
||||
delim = (index(name, ',')) ? ',' : ':';
|
||||
|
||||
- *port = *password = *nick = NULL;
|
||||
+ *port = *password = *nick = *sasl_nick = *sasl_pass = NULL;
|
||||
if ((ptr = (char *) strchr(name, delim)) != NULL)
|
||||
{
|
||||
*(ptr++) = (char) 0;
|
||||
@@ -920,7 +943,28 @@
|
||||
if (!strlen(ptr))
|
||||
*snetwork = NULL;
|
||||
else
|
||||
+ {
|
||||
*snetwork = ptr;
|
||||
+ if ((ptr = strchr(ptr, delim)) != NULL)
|
||||
+ {
|
||||
+ *(ptr++) = 0;
|
||||
+ if (!strlen(ptr))
|
||||
+ *sasl_nick = NULL;
|
||||
+ else
|
||||
+ {
|
||||
+ *sasl_nick = ptr;
|
||||
+ if ((ptr = strchr(ptr, delim)) != NULL)
|
||||
+ {
|
||||
+ *(ptr++) = 0;
|
||||
+ if (!strlen(ptr))
|
||||
+ *sasl_pass = NULL;
|
||||
+ else
|
||||
+ *sasl_pass = ptr;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -941,8 +985,8 @@
|
||||
* servername:port
|
||||
* servername:port:password
|
||||
* servername::password
|
||||
- * servernetwork
|
||||
- * servername:port:password:nick:servernetwork
|
||||
+ * [servernetwork]
|
||||
+ * servername:port:password:nick:servernetwork:saslnick:saslpass
|
||||
* Note also that this routine mucks around with the server string passed to it,
|
||||
* so make sure this is ok
|
||||
*/
|
||||
@@ -955,7 +999,9 @@
|
||||
*password = NULL,
|
||||
*port = NULL,
|
||||
*nick = NULL,
|
||||
- *snetwork = NULL;
|
||||
+ *snetwork = NULL,
|
||||
+ *sasl_nick = NULL,
|
||||
+ *sasl_pass = NULL;
|
||||
|
||||
int port_num;
|
||||
int i = 0;
|
||||
@@ -995,7 +1041,7 @@
|
||||
snetwork = NULL;
|
||||
continue;
|
||||
}
|
||||
- parse_server_info(host, &port, &password, &nick, &snetwork);
|
||||
+ parse_server_info(host, &port, &password, &nick, &snetwork, &sasl_nick, &sasl_pass);
|
||||
if (port && *port)
|
||||
{
|
||||
if (!(port_num = my_atol(port)))
|
||||
@@ -1004,7 +1050,7 @@
|
||||
else
|
||||
port_num = irc_port;
|
||||
|
||||
- add_to_server_list(host, port_num, password, nick, snetwork ? snetwork : default_network, do_use_ssl, 0);
|
||||
+ add_to_server_list(host, port_num, password, nick, snetwork ? snetwork : default_network, sasl_nick, sasl_pass, do_use_ssl, 0);
|
||||
i++;
|
||||
}
|
||||
servers = rest;
|
||||
@@ -1273,7 +1319,7 @@
|
||||
#endif
|
||||
|
||||
update_all_status(current_window, NULL, 0);
|
||||
- add_to_server_list(server_name, port, NULL, NULL, NULL, 0, 1);
|
||||
+ add_to_server_list(server_name, port, NULL, NULL, NULL, NULL, NULL, 0, 1);
|
||||
|
||||
server_list[from_server].closing = 0;
|
||||
if (port)
|
||||
@@ -1638,7 +1684,7 @@
|
||||
{
|
||||
if (!(server=new_next_arg(args,&args)))
|
||||
{
|
||||
- say("Not enough paramters - supply server name");
|
||||
+ say("Not enough parameters - supply server name");
|
||||
return;
|
||||
}
|
||||
say("Trying to establish ssl connection with server: %s",server);
|
||||
@@ -2283,6 +2329,9 @@
|
||||
int old_from_server = from_server;
|
||||
if (server_list[ssn_index].password)
|
||||
my_send_to_server(ssn_index, "PASS %s", server_list[ssn_index].password);
|
||||
+
|
||||
+ if (server_list[ssn_index].sasl_nick && server_list[ssn_index].sasl_pass)
|
||||
+ my_send_to_server(ssn_index, "CAP REQ :sasl");
|
||||
|
||||
my_send_to_server(ssn_index, "USER %s %s %s :%s", username,
|
||||
(send_umode && *send_umode) ? send_umode :
|
||||
@@ -3794,3 +3843,41 @@
|
||||
}
|
||||
return i;
|
||||
}
|
||||
+
|
||||
+#if 0
|
||||
+void set_server_sasl_nick(int server, const char *nick)
|
||||
+{
|
||||
+ if (server <= -1 || server >= number_of_servers)
|
||||
+ return;
|
||||
+ if (nick)
|
||||
+ malloc_strcpy(&server_list[server].sasl_nick, nick);
|
||||
+ else
|
||||
+ new_free(&server_list[server].sasl_nick);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+char *get_server_sasl_nick(int server)
|
||||
+{
|
||||
+ if (server <= -1 || server >= number_of_servers)
|
||||
+ return NULL;
|
||||
+ return server_list[server].sasl_nick;
|
||||
+}
|
||||
+
|
||||
+#if 0
|
||||
+void set_server_sasl_pass(int server, const char *pass)
|
||||
+{
|
||||
+ if (server <= -1 || server >= number_of_servers)
|
||||
+ return;
|
||||
+ if (pass)
|
||||
+ malloc_strcpy(&server_list[server].sasl_pass, pass);
|
||||
+ else
|
||||
+ new_free(&server_list[server].sasl_pass);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+char *get_server_sasl_pass(int server)
|
||||
+{
|
||||
+ if (server <= -1 || server >= number_of_servers)
|
||||
+ return NULL;
|
||||
+ return server_list[server].sasl_pass;
|
||||
+}
|
||||
Index: source/parse.c
|
||||
===================================================================
|
||||
--- source/parse.c (revision 210)
|
||||
+++ source/parse.c (working copy)
|
||||
@@ -887,6 +887,79 @@
|
||||
say("%s", ArgList[0]);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * This only handles negotiating the SASL capability with the PLAIN method. It would
|
||||
+ * be good to add DH-BLOWFISH, and later, full capability support.
|
||||
+ */
|
||||
+static void p_cap(char *from, char **ArgList)
|
||||
+{
|
||||
+ char *caps, *p;
|
||||
+
|
||||
+ if (!strcmp(ArgList[1], "ACK"))
|
||||
+ {
|
||||
+ caps = LOCAL_COPY(ArgList[2]);
|
||||
+ while ((p = next_arg(caps, &caps)) != NULL)
|
||||
+ {
|
||||
+ /* Only AUTHENTICATE before registration */
|
||||
+ if (!strcmp(p, "sasl") && !is_server_connected(from_server))
|
||||
+ {
|
||||
+ my_send_to_server(from_server, "AUTHENTICATE PLAIN");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else if (!strcmp(ArgList[1], "NAK"))
|
||||
+ {
|
||||
+ caps = LOCAL_COPY(ArgList[2]);
|
||||
+ while ((p = next_arg(caps, &caps)) != NULL)
|
||||
+ {
|
||||
+ /* End capability negotiation to continue registration */
|
||||
+ if (!strcmp(p, "sasl") && !is_server_connected(from_server))
|
||||
+ {
|
||||
+ my_send_to_server(from_server, "CAP END");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void p_authenticate(char *from, char **ArgList)
|
||||
+{
|
||||
+ char buf[512];
|
||||
+ char *output = NULL;
|
||||
+ char *nick, *pass;
|
||||
+
|
||||
+ /* "AUTHENTICATE command MUST be used before registration is complete" */
|
||||
+ if (is_server_connected(from_server))
|
||||
+ return;
|
||||
+
|
||||
+ if (!strcmp(ArgList[0], "+"))
|
||||
+ {
|
||||
+ nick = get_server_sasl_nick(from_server);
|
||||
+ pass = get_server_sasl_pass(from_server);
|
||||
+
|
||||
+ /* "The client can abort an authentication by sending an asterisk as the data" */
|
||||
+ if (!nick || !pass)
|
||||
+ {
|
||||
+ my_send_to_server(from_server, "AUTHENTICATE *");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ strlcpy(buf, nick, sizeof buf);
|
||||
+ strlcpy(buf + strlen(nick) + 1, nick, sizeof buf);
|
||||
+ strlcpy(buf + strlen(nick) * 2 + 2, pass, sizeof buf);
|
||||
+
|
||||
+ if (my_base64_encode(buf, strlen(nick) * 2 + strlen(pass) + 2, &output) != -1)
|
||||
+ {
|
||||
+ my_send_to_server(from_server, "AUTHENTICATE %s", output);
|
||||
+// XXX new_free(&output);
|
||||
+ free(output);
|
||||
+ }
|
||||
+ else
|
||||
+ my_send_to_server(from_server, "AUTHENTICATE *");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void add_user_who (WhoEntry *w, char *from, char **ArgList)
|
||||
{
|
||||
char *userhost;
|
||||
@@ -1758,7 +1831,9 @@
|
||||
|
||||
protocol_command rfc1459[] = {
|
||||
{ "ADMIN", NULL, NULL, 0, 0, 0},
|
||||
+{ "AUTHENTICATE", p_authenticate, NULL, 0, 0, 0},
|
||||
{ "AWAY", NULL, NULL, 0, 0, 0},
|
||||
+{ "CAP", p_cap, NULL, 0, 0, 0},
|
||||
{ "CONNECT", NULL, NULL, 0, 0, 0},
|
||||
{ "ERROR", p_error, NULL, 0, 0, 0},
|
||||
{ "ERROR:", p_error, NULL, 0, 0, 0},
|
||||
BIN
contrib/cp437-0.3.tar.gz
Normal file
BIN
contrib/cp437-0.3.tar.gz
Normal file
Binary file not shown.
59
contrib/dcc.diff
Normal file
59
contrib/dcc.diff
Normal file
@@ -0,0 +1,59 @@
|
||||
*** dcc.c Wed Jul 22 17:25:39 1998
|
||||
--- dcc.c.bak Wed Jul 22 17:25:39 1998
|
||||
***************
|
||||
*** 1,4 ****
|
||||
! /*
|
||||
* dcc.c: Things dealing with client to client connections.
|
||||
*
|
||||
* Copyright(c) 1998 Colten Edwards aka panasync.
|
||||
--- 1,4 ----
|
||||
! /*
|
||||
* dcc.c: Things dealing with client to client connections.
|
||||
*
|
||||
* Copyright(c) 1998 Colten Edwards aka panasync.
|
||||
***************
|
||||
*** 1283,1304 ****
|
||||
return user;
|
||||
}
|
||||
|
||||
- /* check if supplied nick matches your current nick, if so return false */
|
||||
- int dcc_check_nick (char *nick) {
|
||||
- size_t len = 0;
|
||||
- if (current_window -> server != -1) {
|
||||
- len = strlen (nick) + 1;
|
||||
- if (my_strnicmp (nick, get_server_nickname (current_window -> server), len)) {
|
||||
- return 0;
|
||||
- } else {
|
||||
- return 1;
|
||||
- }
|
||||
- } else {
|
||||
- return 0;
|
||||
- }
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
DCC_COMMAND(dcc_chat)
|
||||
{
|
||||
char *user;
|
||||
--- 1283,1288 ----
|
||||
***************
|
||||
*** 1329,1339 ****
|
||||
{
|
||||
if (!nick || !*nick)
|
||||
break;
|
||||
! /* check to see if nick matches yours if so continue */
|
||||
! if (dcc_check_nick (nick)) {
|
||||
! put_it ("%s", convert_output_format ("$G %RDCC%n Cannot DCC chat yourself!", NULL, NULL));
|
||||
! continue;
|
||||
! }
|
||||
if ((s = find_dcc(nick, "chat", bot?DCC_BOTMODE:DCC_CHAT, 1, -1, -1)))
|
||||
{
|
||||
if ((s->flags & DCC_ACTIVE) || (s->flags & DCC_WAIT))
|
||||
--- 1313,1319 ----
|
||||
{
|
||||
if (!nick || !*nick)
|
||||
break;
|
||||
!
|
||||
if ((s = find_dcc(nick, "chat", bot?DCC_BOTMODE:DCC_CHAT, 1, -1, -1)))
|
||||
{
|
||||
if ((s->flags & DCC_ACTIVE) || (s->flags & DCC_WAIT))
|
||||
5073
contrib/misc.c
Normal file
5073
contrib/misc.c
Normal file
File diff suppressed because it is too large
Load Diff
266
contrib/parse_arg
Normal file
266
contrib/parse_arg
Normal file
@@ -0,0 +1,266 @@
|
||||
#if 0
|
||||
int ch;
|
||||
int add_servers = 0;
|
||||
strqct passwd *entry;
|
||||
struct hostent *hp;
|
||||
char *ptr = NULL;
|
||||
char *tmp_hostname = NULL;
|
||||
char *channel = NULL;
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
|
||||
*nickname = 0;
|
||||
*realname = 0;
|
||||
*username = 0;
|
||||
|
||||
/*
|
||||
* Its probably better to parse the environment variables
|
||||
* first -- that way they can be used as defaults, but can
|
||||
* still be overriden on the command line.
|
||||
*/
|
||||
#ifndef WINNT
|
||||
if ((entry = getpwuid(getuid())))
|
||||
{
|
||||
if (entry->pw_gecos && *(entry->pw_gecos))
|
||||
{
|
||||
if ((ptr = strchr(entry->pw_gecos, GECOS_DELIMITER)))
|
||||
*ptr = 0;
|
||||
strmcpy(realname, entry->pw_gecos, REALNAME_LEN);
|
||||
}
|
||||
|
||||
if (entry->pw_name && *(entry->pw_name))
|
||||
strmcpy(username, entry->pw_name, NAME_LEN);
|
||||
|
||||
if (entry->pw_dir && *(entry->pw_dir))
|
||||
malloc_strcpy(&my_path, entry->pw_dir);
|
||||
}
|
||||
#else
|
||||
{
|
||||
u_long size=NAME_LEN+1;
|
||||
if (!(ptr = getenv("IRCUSER")))
|
||||
strcpy(username, "unknown");
|
||||
else
|
||||
strcpy(username,ptr);
|
||||
}
|
||||
#endif
|
||||
if ((ptr = getenv("IRCNICK")))
|
||||
strmcpy(nickname, ptr, NICKNAME_LEN);
|
||||
|
||||
/*
|
||||
* We now allow users to use IRCUSER or USER if we couldnt get the
|
||||
* username from the password entries. For those systems that use
|
||||
* NIS and getpwuid() fails (boo, hiss), we make a last ditch effort
|
||||
* to see what LOGNAME is (defined by POSIX.2 to be the canonical
|
||||
* username under which the person logged in as), and if that fails,
|
||||
* we're really tanked, so we just let the user specify their own
|
||||
* username. I think everyone would have to agree this is the most
|
||||
* reasonable way to handle this.
|
||||
*/
|
||||
if (!*username)
|
||||
if ((ptr = getenv("LOGNAME")) && *ptr)
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
|
||||
if (!*username)
|
||||
if ((ptr = getenv("IRCUSER")) && *ptr)
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
else if (*username)
|
||||
;
|
||||
else if ((ptr = getenv("USER")) && *ptr)
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
else if ((ptr = getenv("HOME")) && *ptr)
|
||||
{
|
||||
char *ptr2 = strrchr(ptr, '/');
|
||||
if (ptr2)
|
||||
strmcpy(username, ptr2, NAME_LEN);
|
||||
else
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
}
|
||||
else
|
||||
strmcpy(username, "Unknown", NAME_LEN);
|
||||
|
||||
|
||||
#ifdef IDENT_FAKE
|
||||
{
|
||||
char *p = NULL, *q = NULL;
|
||||
FILE *f;
|
||||
malloc_sprintf(&p, "~/%s", get_string_var(IDENT_HACK_VAR));
|
||||
q = expand_twiddle(p);
|
||||
if ((f = fopen(q, "r")))
|
||||
{
|
||||
fgets(username, NAME_LEN, f);
|
||||
if (*username && strchr(username, '\n'))
|
||||
username[strlen(username)-1] = 0;
|
||||
}
|
||||
fclose(f);
|
||||
new_free(&p); new_free(&q);
|
||||
if (!*username)
|
||||
strmcpy(username, "Unknown", NAME_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCNAME")))
|
||||
strmcpy(realname, ptr, REALNAME_LEN);
|
||||
else if ((ptr = getenv("NAME")))
|
||||
strmcpy(realname, ptr, REALNAME_LEN);
|
||||
else if (!*realname)
|
||||
strmcpy(realname, "* New BX user who didn't read BitchX.doc *", REALNAME_LEN);
|
||||
|
||||
if ((ptr = getenv("HOME")))
|
||||
malloc_strcpy(&my_path, ptr);
|
||||
else if (!my_path)
|
||||
#ifndef WINNT
|
||||
malloc_strcpy(&my_path, "/");
|
||||
#else
|
||||
malloc_strcpy(&my_path, empty_string);
|
||||
#endif
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
convert_unix(my_path);
|
||||
#endif
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCPORT")))
|
||||
irc_port = my_atol(ptr);
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCRC")))
|
||||
ircrc_file = m_strdup(ptr);
|
||||
else
|
||||
ircrc_file = m_2dup(my_path, IRCRC_NAME);
|
||||
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCLIB")))
|
||||
irc_lib = m_2dup(ptr, "/");
|
||||
else
|
||||
irc_lib = m_strdup(IRCLIB);
|
||||
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
convert_unix(irc_lib);
|
||||
#endif
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCUMODE")))
|
||||
send_umode = m_strdup(ptr);
|
||||
|
||||
if ((ptr = getenv("IRCPATH")))
|
||||
irc_path = m_strdup(ptr);
|
||||
else
|
||||
irc_path = m_strdup(IRCPATH);
|
||||
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
convert_unix(irc_path);
|
||||
#endif
|
||||
|
||||
|
||||
set_string_var(LOAD_PATH_VAR, irc_path);
|
||||
new_free(&irc_path);
|
||||
|
||||
if ((ptr = getenv("IRCHOST")) && *ptr)
|
||||
tmp_hostname = ptr;
|
||||
|
||||
if (!ircservers_file)
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
malloc_strcpy(&ircservers_file, "irc-serv");
|
||||
#else
|
||||
malloc_strcpy(&ircservers_file, ".ircservers");
|
||||
#endif
|
||||
|
||||
if (!bircrc_file)
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
malloc_sprintf(&bircrc_file, "%s/bx-rc", my_path);
|
||||
#else
|
||||
malloc_sprintf(&bircrc_file, "%s/.bitchxrc", my_path);
|
||||
#endif
|
||||
|
||||
while ((ch = getopt(argc, argv, "aBbc:dfFhH:l:L:Nn:p:r:qsvxz:")) != EOF)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case 'v': /* Outpqt ircII version */
|
||||
show_version();
|
||||
/* NOTREACHED */
|
||||
case 'p': /* Default port to use */
|
||||
irc_port = my_atol(optarg);
|
||||
break;
|
||||
|
||||
case 'f': /* Use flow control */
|
||||
use_flow_control = 1;
|
||||
break;
|
||||
|
||||
case 'F': /* dont use flow control */
|
||||
use_flow_control = 0;
|
||||
break;
|
||||
|
||||
case 'd': /* use dumb mode */
|
||||
dumb_mode = 1;
|
||||
break;
|
||||
|
||||
case 'l': /* Load some file instead of ~/.ircrc */
|
||||
case 'L': /* Same as above. Doesnt work like before */
|
||||
malloc_strcpy(&ircrc_file, optarg);
|
||||
break;
|
||||
|
||||
case 'a': /* add server, not replace */
|
||||
add_servers = 1;
|
||||
break;
|
||||
case 'r':
|
||||
add_servers = 1;
|
||||
malloc_strcpy(&ircservers_file, optarg);
|
||||
break;
|
||||
|
||||
case 'q': /* quick startup -- no .ircrc */
|
||||
quick_startup = 1;
|
||||
break;
|
||||
|
||||
case 's': /* dont connect - let user choose server */
|
||||
dont_connect = 1;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
dumb_mode = 1;
|
||||
use_input = 0;
|
||||
background = 1;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
strmcpy(nickname, optarg, NICKNAME_LEN);
|
||||
break;
|
||||
|
||||
case 'x': /* x_debug flag */
|
||||
x_debug = (unsigned long)0x0fffffff;
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
strmcpy(username, optarg, NAME_LEN);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
load_ircrc_right_away = 1;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
malloc_strcpy(&channel, optarg);
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
tmp_hostname = optarg;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
auto_connect = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'h':
|
||||
case '?':
|
||||
fputs(switch_help, stderr);
|
||||
exit(1);
|
||||
} /* End of switch */
|
||||
}
|
||||
|
||||
|
||||
|
||||
#else /* end new parse */
|
||||
BIN
contrib/roll-1.0.tar.gz
Normal file
BIN
contrib/roll-1.0.tar.gz
Normal file
Binary file not shown.
163
contrib/vh1.c
Normal file
163
contrib/vh1.c
Normal file
@@ -0,0 +1,163 @@
|
||||
/* The New routine for getting ips and interfaces for /hostname
|
||||
Phear MHacker ;)
|
||||
|
||||
*/
|
||||
|
||||
/* added rev dns support
|
||||
Phear sideshow ;)
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#if defined(sun)
|
||||
#include <sys/sockio.h>
|
||||
#else
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#if !defined(linux)
|
||||
#include <netinet/in_var.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
|
||||
void check_inter (char *, char **);
|
||||
void usage (char **);
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int s;
|
||||
char *buffer;
|
||||
struct ifconf ifc;
|
||||
char name[100];
|
||||
struct ifreq *ifptr, *end;
|
||||
struct ifreq ifr;
|
||||
int ifflags, selectflag = -1;
|
||||
int oldbufsize, bufsize = sizeof (struct ifreq);
|
||||
if(!argv[1])
|
||||
{
|
||||
usage(argv);
|
||||
exit(0);
|
||||
}
|
||||
printf ("This program should print out valid hosts on all network devices\n");
|
||||
s = socket (AF_INET, SOCK_DGRAM, 0);
|
||||
if (s < 0)
|
||||
{
|
||||
perror ("ifconfig: socket");
|
||||
exit (1);
|
||||
}
|
||||
buffer = malloc (bufsize);
|
||||
ifc.ifc_len = bufsize;
|
||||
do
|
||||
{
|
||||
oldbufsize = ifc.ifc_len;
|
||||
bufsize += 1 + sizeof (struct ifreq);
|
||||
buffer = realloc ((void *) buffer, bufsize);
|
||||
ifc.ifc_len = bufsize;
|
||||
ifc.ifc_buf = buffer;
|
||||
if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
|
||||
{
|
||||
perror ("ifconfig (SIOCGIFCONF)");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
while (ifc.ifc_len > oldbufsize);
|
||||
ifflags = ifc.ifc_req->ifr_flags;
|
||||
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
|
||||
ifptr = ifc.ifc_req;
|
||||
while (ifptr < end)
|
||||
{
|
||||
sprintf (ifr.ifr_name, "%s", ifptr->ifr_name);
|
||||
sprintf (name, "%s", ifptr->ifr_name);
|
||||
close (s);
|
||||
check_inter (name, argv);
|
||||
ifptr++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
check_inter (char *interface, char **argv)
|
||||
{
|
||||
struct in_addr i;
|
||||
struct hostent *he;
|
||||
struct ifreq ifr;
|
||||
char rhost[256], fhost[30];
|
||||
int fd;
|
||||
char *ip;
|
||||
register int flags;
|
||||
ip = malloc (sizeof (ip));
|
||||
if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
|
||||
return;
|
||||
strcpy (ifr.ifr_name, interface);
|
||||
|
||||
if (ioctl (fd, SIOCGIFADDR, &ifr) < 0)
|
||||
{
|
||||
close (fd);
|
||||
return;
|
||||
}
|
||||
if (ioctl (fd, SIOCGIFFLAGS, &ifr) < 0)
|
||||
{
|
||||
close (fd);
|
||||
return;
|
||||
}
|
||||
ip = (char *) inet_ntoa (((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr);
|
||||
if (ifr.ifr_flags & IFF_UP)
|
||||
{
|
||||
i.s_addr = inet_addr (ip);
|
||||
he = gethostbyaddr ((char *) &i, sizeof (struct in_addr), AF_INET);
|
||||
bzero(rhost, sizeof(rhost));
|
||||
if (he != NULL)
|
||||
{
|
||||
strncpy (rhost, he->h_name, 255);
|
||||
he = gethostbyname (rhost);
|
||||
if (he != NULL)
|
||||
sprintf (fhost, "%u.%u.%u.%u", he->h_addr[0] & 0xff, he->h_addr[1] & 0xff, he->h_addr[2] & 0xff, he->h_addr[3] & 0xff);
|
||||
|
||||
}
|
||||
if (rhost)
|
||||
{
|
||||
if (strcasecmp (ip, fhost) == 0)
|
||||
{
|
||||
if ((strcmp ("-m", argv[1]) == 0) || (strcmp ("-a", argv[1]) == 0))
|
||||
{
|
||||
printf ("Interface %s: %s %s (matching)\n", interface, ip, rhost);
|
||||
bzero (rhost, sizeof (rhost));
|
||||
bzero (fhost, sizeof (fhost));
|
||||
}
|
||||
}
|
||||
else if ((strcmp("-r", argv[1])==0) || (strcmp("-a", argv[1]) == 0))
|
||||
{
|
||||
printf ("Interface %s: %s %s\n", interface, ip, rhost);
|
||||
bzero (rhost, sizeof (rhost));
|
||||
}
|
||||
}
|
||||
else if ((strcmp("-i", argv[1]) ==0) || (strcmp("-a", argv[1]) == 0))
|
||||
printf ("Interface %s: %s\n", interface, ip);
|
||||
}
|
||||
close (fd);
|
||||
}
|
||||
|
||||
void usage(char **argv)
|
||||
{
|
||||
printf("\nVirtual Host checking system by Warren Rees\n");
|
||||
printf("Support for reverse dns and dns matching by Matt Watson\n\n");
|
||||
printf("Usage: %s [-amri]\n\n", argv[0]);
|
||||
printf("\t-a : Show all ips\n");
|
||||
printf("\t-m : Show only ips & hostname with matching forward and reverse dns\n");
|
||||
printf("\t-r : Show only ips that have reverse dns but no forward dns\n");
|
||||
printf("\t-i : Show only non-resolving ips no forward or reverse dns\n\n\n");
|
||||
}
|
||||
|
||||
238
contrib/window.and.detach.diff
Normal file
238
contrib/window.and.detach.diff
Normal file
@@ -0,0 +1,238 @@
|
||||
diff -uNr sent-upstream/as-sent-last/include/config.h ircii-pana-1.0-0c15/include/config.h
|
||||
--- sent-upstream/as-sent-last/include/config.h Sat Jan 8 04:19:04 2000
|
||||
+++ ircii-pana-1.0-0c15/include/config.h Sun Jan 9 06:40:56 2000
|
||||
@@ -571,7 +571,7 @@
|
||||
#define WANT_DETACH ON /* this is here for the detach/re-attach code
|
||||
which is essentially a mini-screen */
|
||||
#define ALLOW_DETACH ON
|
||||
-
|
||||
+#define DEFAULT_DETACH_ON_HUP ON
|
||||
|
||||
#undef OLD_RANDOM_BEHAVIOR /* semi randomness for randm() */
|
||||
|
||||
diff -uNr sent-upstream/as-sent-last/include/modval.h ircii-pana-1.0-0c15/include/modval.h
|
||||
--- sent-upstream/as-sent-last/include/modval.h Tue Jan 4 01:54:48 2000
|
||||
+++ ircii-pana-1.0-0c15/include/modval.h Sun Jan 9 06:01:54 2000
|
||||
@@ -306,6 +306,7 @@
|
||||
#define get_window_server(x) ((int) (global[GET_WINDOW_SERVER]((unsigned int)x)))
|
||||
#define set_window_server(x, y, z) ((void) (global[SET_WINDOW_SERVER]((int)x, (int)y, (int)z)))
|
||||
#define window_check_servers ((void (*)())global[WINDOW_CHECK_SERVERS])
|
||||
+#define window_close_server ((void (*)(int))global[WINDOW_CHECK_SERVERS])
|
||||
#define change_window_server(x, y) ((void) (global[CHANGE_WINDOW_SERVER]((int)x, (int)y)))
|
||||
#define set_level_by_refnum(x, y) ((void) (global[SET_LEVEL_BY_REFNUM]((unsigned int)x, (int)y)))
|
||||
#define message_to(x) ((void) (global[MESSAGE_TO]((unsigned int)x)))
|
||||
diff -uNr sent-upstream/as-sent-last/include/struct.h ircii-pana-1.0-0c15/include/struct.h
|
||||
--- sent-upstream/as-sent-last/include/struct.h Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/include/struct.h Sun Jan 9 06:13:17 2000
|
||||
@@ -593,6 +593,7 @@
|
||||
unsigned int refnum; /* the unique reference number,
|
||||
* assigned by IRCII */
|
||||
int server; /* server index */
|
||||
+ int last_server; /* previous server index */
|
||||
int top; /* The top line of the window, screen
|
||||
* coordinates */
|
||||
int bottom; /* The botton line of the window, screen
|
||||
diff -uNr sent-upstream/as-sent-last/include/vars.h ircii-pana-1.0-0c15/include/vars.h
|
||||
--- sent-upstream/as-sent-last/include/vars.h Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/include/vars.h Sun Jan 9 06:41:24 2000
|
||||
@@ -103,6 +103,7 @@
|
||||
DEOPFLOOD_TIME_VAR,
|
||||
DEOP_ON_DEOPFLOOD_VAR,
|
||||
DEOP_ON_KICKFLOOD_VAR,
|
||||
+ DETACH_ON_HUP,
|
||||
DISPATCH_UNKNOWN_COMMANDS_VAR,
|
||||
DISPLAY_VAR ,
|
||||
DISPLAY_ANSI_VAR,
|
||||
diff -uNr sent-upstream/as-sent-last/include/window.h ircii-pana-1.0-0c15/include/window.h
|
||||
--- sent-upstream/as-sent-last/include/window.h Fri Oct 22 01:48:21 1999
|
||||
+++ ircii-pana-1.0-0c15/include/window.h Sun Jan 9 06:03:52 2000
|
||||
@@ -31,6 +31,10 @@
|
||||
#define ON 1
|
||||
#define TOGGLE 2
|
||||
|
||||
+#define WINDOW_NO_SERVER -1
|
||||
+#define WINDOW_DLL -2
|
||||
+#define WINDOW_SERVER_CLOSED -3
|
||||
+
|
||||
Window *new_window (struct ScreenStru *);
|
||||
void delete_window (Window *);
|
||||
void add_to_invisible_list (Window *);
|
||||
@@ -71,7 +75,6 @@
|
||||
char *get_bound_channel (Window *);
|
||||
int get_window_server (unsigned);
|
||||
void set_window_server (int, int, int);
|
||||
- void window_check_servers (void);
|
||||
void set_level_by_refnum (unsigned, unsigned long);
|
||||
void message_to (unsigned long);
|
||||
|
||||
@@ -145,6 +148,7 @@
|
||||
const char *query_host (void);
|
||||
const char *query_cmd (void);
|
||||
void window_check_servers(void);
|
||||
+ void window_close_server(int old_server);
|
||||
void window_change_server(int, int);
|
||||
void make_window_current_by_winref(int);
|
||||
void make_window_current_by_desc(char *);
|
||||
diff -uNr sent-upstream/as-sent-last/source/commands.c ircii-pana-1.0-0c15/source/commands.c
|
||||
--- sent-upstream/as-sent-last/source/commands.c Tue Jan 4 01:43:35 2000
|
||||
+++ ircii-pana-1.0-0c15/source/commands.c Sun Jan 9 06:05:49 2000
|
||||
@@ -1075,7 +1075,7 @@
|
||||
set_server_reconnect(from_server, 1);
|
||||
close_server(from_server,(args && *args) ? args : "Reconnecting");
|
||||
clean_server_queues(from_server);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
servercmd(NULL, scommnd, empty_string, NULL);
|
||||
|
||||
}
|
||||
diff -uNr sent-upstream/as-sent-last/source/irc.c ircii-pana-1.0-0c15/source/irc.c
|
||||
--- sent-upstream/as-sent-last/source/irc.c Sat Jan 8 04:19:04 2000
|
||||
+++ ircii-pana-1.0-0c15/source/irc.c Sun Jan 9 06:49:38 2000
|
||||
@@ -543,6 +543,14 @@
|
||||
detachcmd(NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
+void set_detach_on_hup(Window *dummy, char *unused, int value)
|
||||
+{
|
||||
+ if(value)
|
||||
+ my_signal(SIGHUP, sig_detach, 0);
|
||||
+ else
|
||||
+ my_signal(SIGHUP, irc_exit_old, 0);
|
||||
+}
|
||||
+
|
||||
/* shows the version of irc */
|
||||
static void versionreply(void)
|
||||
{
|
||||
@@ -1506,7 +1514,7 @@
|
||||
#endif
|
||||
my_signal(SIGQUIT, SIG_IGN, 0);
|
||||
#ifdef WANT_DETACH
|
||||
- my_signal(SIGHUP, sig_detach, 0);
|
||||
+ set_detach_on_hup(NULL, NULL, DEFAULT_DETACH_ON_HUP);
|
||||
#else
|
||||
my_signal(SIGHUP, irc_exit_old, 0);
|
||||
#endif
|
||||
diff -uNr sent-upstream/as-sent-last/source/numbers.c ircii-pana-1.0-0c15/source/numbers.c
|
||||
--- sent-upstream/as-sent-last/source/numbers.c Sat Jan 1 19:24:50 2000
|
||||
+++ ircii-pana-1.0-0c15/source/numbers.c Sun Jan 9 06:06:34 2000
|
||||
@@ -1105,7 +1105,7 @@
|
||||
if (do_hook(current_numeric, "%s %s", from, *ArgList))
|
||||
display_msg(from, ArgList);
|
||||
close_server(from_server, empty_string);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
if (from_server == primary_server)
|
||||
get_connected(from_server + 1, from_server);
|
||||
break;
|
||||
@@ -1149,7 +1149,7 @@
|
||||
display_msg(from, ArgList);
|
||||
|
||||
close_server(from_server, empty_string);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
if (server_list_size() > 1)
|
||||
remove_from_server_list(klined);
|
||||
if (klined == primary_server && (server_list_size() > 0))
|
||||
diff -uNr sent-upstream/as-sent-last/source/parse.c ircii-pana-1.0-0c15/source/parse.c
|
||||
--- sent-upstream/as-sent-last/source/parse.c Tue Jan 4 02:30:07 2000
|
||||
+++ ircii-pana-1.0-0c15/source/parse.c Sun Jan 9 06:06:48 2000
|
||||
@@ -1166,7 +1166,7 @@
|
||||
|
||||
close_server(from_server,empty_string);
|
||||
clean_server_queues(from_server);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
|
||||
if (strchr(from, '.'))
|
||||
{
|
||||
diff -uNr sent-upstream/as-sent-last/source/server.c ircii-pana-1.0-0c15/source/server.c
|
||||
--- sent-upstream/as-sent-last/source/server.c Tue Jan 4 01:43:35 2000
|
||||
+++ ircii-pana-1.0-0c15/source/server.c Sun Jan 9 06:25:16 2000
|
||||
@@ -257,6 +257,7 @@
|
||||
times = 1;
|
||||
i++;
|
||||
}
|
||||
+ window_close_server(i);
|
||||
get_connected(i, old_serv);
|
||||
break;
|
||||
}
|
||||
@@ -1162,7 +1163,7 @@
|
||||
return;
|
||||
}
|
||||
close_server(i, "closing server");
|
||||
- window_check_servers();
|
||||
+ window_close_server(i);
|
||||
}
|
||||
else
|
||||
get_connected(from_server - 1, from_server);
|
||||
@@ -2100,6 +2101,7 @@
|
||||
clear_channel_list(i);
|
||||
close_server(i, message);
|
||||
server_list[i].eof = 1;
|
||||
+ window_close_server(i);
|
||||
}
|
||||
done:
|
||||
window_check_servers();
|
||||
diff -uNr sent-upstream/as-sent-last/source/vars.c ircii-pana-1.0-0c15/source/vars.c
|
||||
--- sent-upstream/as-sent-last/source/vars.c Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/source/vars.c Sun Jan 9 06:52:18 2000
|
||||
@@ -95,6 +95,8 @@
|
||||
static void set_nat_address (Window *, char *, int);
|
||||
extern void debug_window (Window *, char *, int);
|
||||
|
||||
+extern void set_detach_on_hup (Window *, char *, int);
|
||||
+
|
||||
/*
|
||||
* irc_variable: all the irc variables used. Note that the integer and
|
||||
* boolean defaults are set here, which the string default value are set in
|
||||
@@ -199,6 +201,7 @@
|
||||
{ "DEOPFLOOD_TIME",0, INT_TYPE_VAR, DEFAULT_DEOPFLOOD_TIME, NULL, NULL, 0, VIF_BITCHX },
|
||||
{ "DEOP_ON_DEOPFLOOD",0, INT_TYPE_VAR, DEFAULT_DEOP_ON_DEOPFLOOD, NULL, NULL, 0, VIF_BITCHX },
|
||||
{ "DEOP_ON_KICKFLOOD",0, INT_TYPE_VAR, DEFAULT_DEOP_ON_KICKFLOOD, NULL, NULL, 0, VIF_BITCHX },
|
||||
+ { "DETACH_ON_HUP",0, BOOL_TYPE_VAR, DEFAULT_DETACH_ON_HUP, NULL, set_detach_on_hup, 0, 0 },
|
||||
{ "DISPATCH_UNKNOWN_COMMANDS",0,BOOL_TYPE_VAR, DEFAULT_DISPATCH_UNKNOWN_COMMANDS, NULL, NULL, 0, 0 },
|
||||
{ "DISPLAY",0, BOOL_TYPE_VAR, DEFAULT_DISPLAY, NULL, NULL, 0, 0 },
|
||||
{ "DISPLAY_ANSI",0, BOOL_TYPE_VAR, DEFAULT_DISPLAY_ANSI, NULL, toggle_reverse_status, 0, 0 },
|
||||
diff -uNr sent-upstream/as-sent-last/source/window.c ircii-pana-1.0-0c15/source/window.c
|
||||
--- sent-upstream/as-sent-last/source/window.c Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/source/window.c Sun Jan 9 06:18:15 2000
|
||||
@@ -1784,7 +1784,7 @@
|
||||
if ((window = get_window_by_refnum(refnum)) == NULL)
|
||||
window = current_window;
|
||||
old = window->server;
|
||||
- if (misc)
|
||||
+ if (misc || old == WINDOW_SERVER_CLOSED)
|
||||
{
|
||||
while ((traverse_all_windows(&tmp)))
|
||||
{
|
||||
@@ -1850,6 +1850,30 @@
|
||||
}
|
||||
update_all_status(current_window, NULL, 0);
|
||||
cursor_to_input();
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * window_close_server: this is like window_check_servers but it gets called
|
||||
+ * with old_server as the refnum of a server that just got closed. It marks
|
||||
+ * every window that used to be connected to old_server as WINDOW_SERVER_CLOSED
|
||||
+ * and sets last_server for those windows. It doesn't touch windows that
|
||||
+ * already had no server.
|
||||
+ */
|
||||
+
|
||||
+void window_close_server(int old_server)
|
||||
+{
|
||||
+ Window *tmp;
|
||||
+ int cnt, max, i, not_connected, prime = -1;
|
||||
+
|
||||
+ tmp = NULL;
|
||||
+ while ((traverse_all_windows(&tmp)))
|
||||
+ {
|
||||
+ if (tmp->server == old_server)
|
||||
+ {
|
||||
+ tmp->server = WINDOW_SERVER_CLOSED;
|
||||
+ tmp->last_server = old_server;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
Reference in New Issue
Block a user