Skip to content

Commit e2bbde4

Browse files
Merge remote-tracking branch 'upstream/develop' into cleanup.include
This merge was done to resolve conflicts
2 parents 4202f4e + c77e84f commit e2bbde4

28 files changed

+881
-514
lines changed

doc/sphinx_source/install/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ installation tool prior to compiling:
115115
::
116116

117117
Interpreters: tcl, tcl-devel
118-
Net: openssl-devel
118+
Net: openssl, libssl-devel
119119
Devel: autoconf, gcc-core, git, make
120-
Utils: diffutils
120+
Libs: zlib-devel
121121

122122
Modules
123123
-------

doc/sphinx_source/tutorials/firststeps.rst

+9-5
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ which will enforce the s, n, and t flags on a channel.
8080
Automatically restarting an Eggdrop
8181
-----------------------------------
8282

83-
A common question asked by users is, how can I configure Eggdrop to automatically restart should it die, such as after a reboot? Historically, Eggdrop relied on the host's crontab system to run a script (called botchk) every ten minutes to see if the eggdrop is running. If the eggdrop is not running, the script will restart the bot, with an optional email sent to the user informing them of the action. Newer systems come with systemd, which can provide better real-time monitoring of processes such as Eggdrop. You probably want to use systemd if your system has it.
83+
A common question asked by users is, how can I configure Eggdrop to automatically restart should it die, such as after a reboot? Historically, Eggdrop relied on the host's crontab system to run a script (called botchk) every ten minutes to see if the eggdrop is running. If the eggdrop is not running, the script will restart the bot, with an optional email sent to the user informing them of the action. Newer Linux systems come with systemd, which can provide better real-time monitoring of processes such as Eggdrop. You probably want to use systemd if your system has it.
8484

85-
Crontab Method (Old)
86-
^^^^^^^^^^^^^^^^^^^^
85+
Crontab Method
86+
^^^^^^^^^^^^^^
8787

8888
1. Enter the directory you installed your Eggdrop to. Most commonly, this is ~/eggdrop (also known as /home/<username>/eggdrop).
8989

@@ -103,8 +103,8 @@ By default, it should create an entry that looks similar to::
103103

104104
This will run the generated botchk script every ten minutes and restart your Eggdrop if it is not running during the check. Also note that if you run autobotchk from the scripts directory, you'll have to manually specify your config file location with the -dir option. To remove a crontab entry, use ``crontab -e`` to open the crontab file in your system's default editor and remove the crontab line.
105105

106-
Systemd Method (Newer Systems)
107-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106+
Systemd Method (Newer Linux Systems)
107+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108108

109109
1. Enter the directory you installed your Eggdrop to. Most commonly, this is ~/eggdrop (also known as /home/<username>/eggdrop).
110110

@@ -173,3 +173,7 @@ You will need to determine your public key fingerprint by using::
173173
Then, ensure you have those keys loaded in the ssl-privatekey and ssl-certificate settings in the config file. Finally, to add this certificate to your NickServ account, type::
174174

175175
/msg NickServ cert add <fingerprint string from above goes here>
176+
177+
* **SCRAM-SHA-256**: To use this method, set sasl-mechanism to 3.
178+
179+
* **SCRAM-SHA-512**: To use this method, set sasl-mechanism to 4.

doc/sphinx_source/tutorials/userfilesharing.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ How to share userfiles- the super-short version
1515
On the Hub Bot
1616
^^^^^^^^^^^^^^
1717

18-
# Ensure you know what ports your bot is listening on, this is set in the config and those ports will be used in the example below. For this example, our config looks like::
18+
#. Ensure you know what ports your bot is listening on, this is set in the config and those ports will be used in the example below. For this example, our config looks like::
1919

20-
listen +3333/+4444 all
20+
listen +3333/+4444 all
2121

22-
# On the hub (for this example, the Hub is called Hubalicious), add the leaf bot (for this example, the Leaf is called LeifErikson) with `.+bot LeifErikson <IP_address_of_LiefErikson> +4444/+3333 <LiefErikson_hostmask>`.
22+
#. On the hub (for this example, the Hub is called Hubalicious), add the leaf bot (for this example, the Leaf is called LeifErikson) with ``.+bot LeifErikson <IP_address_of_LiefErikson> +4444/+3333 <LiefErikson_hostmask>``.
2323

24-
# On the hub, give the leaf bot the appropriate leaf sharing flags with `.botattr LiefErikson +gs`.
24+
#. On the hub, give the leaf bot the appropriate leaf sharing flags with ``.botattr LiefErikson +gs``.
2525

2626
On the Leaf Bot
2727
^^^^^^^^^^^^^^^
2828

29-
# Ensure you know what ports your bot is listening on, this is set in the config and those ports will be used in the example below. For this example, our config looks like::
29+
#. Ensure you know what ports your bot is listening on, this is set in the config and those ports will be used in the example below. For this example, our config looks like::
3030

31-
listen +5555/+6666 all
31+
listen +5555/+6666 all
3232

33-
# Now on the leaf, add the hub bot with `.+bot Hubalicious <IP_address_of_Hubalicious> +6666/+5555 <Hubalicious hostmask>`.
33+
#. Now on the leaf, add the hub bot with ``.+bot Hubalicious <IP_address_of_Hubalicious> +6666/+5555 <Hubalicious hostmask>``.
3434

35-
# On the leaf, give the hub bot the appropriate hub and sharing flags with `.botattr Hubalicious +ghp`.
35+
#. On the leaf, give the hub bot the appropriate hub and sharing flags with ``.botattr Hubalicious +ghp``.
3636

37-
At this point, the leaf bot should attempt to connect to the hub bot within the next minute, or you can force the link connection with `.link Hubalicious`. You can also use .bottree to see your botnet structure.
37+
At this point, the leaf bot should attempt to connect to the hub bot within the next minute, or you can force the link connection with ``.link Hubalicious``. You can also use .bottree to see your botnet structure.
3838

3939
Explaining the Linking/Sharing Process
4040
--------------------------------------
4141

42-
Eggdrop bots can talk to each other for a variety of reasons. In order for an Eggdrop to talk to another Eggdrop for anything, they must link. This is done by adding a bot record the remote bot on the hub bot (In our example above, using `.+bot LeifErikson` on Hubalicious, and using `.+bot Hubalicious` on LiefErikson). Once the bot records are added, bots can be manually connected using the `.link` command.
42+
Eggdrop bots can talk to each other for a variety of reasons. In order for an Eggdrop to talk to another Eggdrop for anything, they must link. This is done by adding a bot record the remote bot on the hub bot (In our example above, using ``.+bot LeifErikson`` on Hubalicious, and using ``.+bot Hubalicious`` on LiefErikson). Once the bot records are added, bots can be manually connected using the ``.link`` command.
4343

4444
In the example above, we add the +s bot flag to LiefErikson's bot record on Hubalicious to tell Hubalicious that LiefErikson is not only allowed to connect, but is authorized to download the userfiles from Hubalicious. Similarly, we add the +p bot flag to Hubalicious's bot record on LiefErikson to tell LiefErikson that Hubalicous is authorized to send userfiles to LiefErikson. The +h bot flag is added to Hubalicious's bot record on LiefErikson so tell LiefErikson that Hubalicious is the hub, and it should always try to automatically connect to Hubalicious.
4545

46-
Lastly, the +g flag is used on both bot records to indicate that Hubalicious is authorized to send userfiles for all channels. This is a shortcut method to sharing all channels instead of setting the `+shared` channel setting on the hub for each channel userfile you wish the hub to share (set via .chanset), and using the `|+s #channel` bot flag for each channel userfile that the leaf is authorized to receive userfiles from the hub. As an example of channel-specific userfile sharing, you would use `.botattr LiefErikson |+s #theforest` on Hubalicious to set #theforest as a channel authorized to be shared to LiefErikson, and `chanset #theforest +shared` to tell LiefErikson to accept the channel userfile for #theforest.
46+
Lastly, the +g flag is used on both bot records to indicate that Hubalicious is authorized to send userfiles for all channels. This is a shortcut method to sharing all channels instead of setting the ``+shared`` channel setting on the hub for each channel userfile you wish the hub to share (set via .chanset), and using the ``|+s #channel`` bot flag for each channel userfile that the leaf is authorized to receive userfiles from the hub. As an example of channel-specific userfile sharing, you would use ``.botattr LiefErikson |+s #theforest`` on Hubalicious to set #theforest as a channel authorized to be shared to LiefErikson, and ``.chanset #theforest +shared`` to tell LiefErikson to accept the channel userfile for #theforest.
4747

48-
One more commonly used flag is the `+a` flag. This flag specifies an alternate hub to connect to in case the primary hub goes down. The alternate hub should be linked to hub and maintain all channel userfiles the hub maintains to ensure there is no desynchronization while the hub bot is down. Should the hub bot go down, and assuming the `+h` flag is set for the hub on a leaf, the leafbost will automatically try to reconnect to the hub every minute, even if it makes a connection with the alternate hub in the meantime. An alternate hub is added the same as a hub, except swapping out the `h` for the `a`: `.botattr AltRock +agp`.
48+
One more commonly used flag is the ``+a`` flag. This flag specifies an alternate hub to connect to in case the primary hub goes down. The alternate hub should be linked to hub and maintain all channel userfiles the hub maintains to ensure there is no desynchronization while the hub bot is down. Should the hub bot go down, and assuming the ``+h`` flag is set for the hub on a leaf, the leafbost will automatically try to reconnect to the hub every minute, even if it makes a connection with the alternate hub in the meantime. An alternate hub is added the same as a hub, except swapping out the ``h`` for the ``a``: ``.botattr AltRock +agp``.
4949

5050
Now that you have a hub and leaf bot successfully connected and sharing userfiles, you can repeat the `On the Leaf Bot`_ section to add additional leafs to your hub.

doc/sphinx_source/using/tcl-commands.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ getuser <handle> [entry-type] [extra info]
261261
Description: an interface to the new generic userfile support. Without an entry-type, it returns a flat key/value list (dict) of all set entries. Valid entry types are:
262262

263263
+----------+-------------------------------------------------------------------------------------+
264-
| ACCOUNT | returns thee a list of servivce accounts associated with the user |
264+
| ACCOUNT | returns the list of service accounts associated with the user |
265265
+----------+-------------------------------------------------------------------------------------+
266266
| BOTFL | returns the current bot-specific flags for the user (bot-only) |
267267
+----------+-------------------------------------------------------------------------------------+

doc/sphinx_source/using/tls.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TLS support
2-
Last revised: Jan 26, 2020
2+
Last revised: Mar 1, 2025
33

44
===========
55
TLS support
@@ -59,7 +59,7 @@ a plus sign. Example: .jump irc.server.com +6697. The same goes for
5959
the server list in the config file.
6060

6161
Some NickServ services allow you to authenticate with a certificate.
62-
Eggdrop will use the certificte pair specified in ssl-privatekey/
62+
Eggdrop will use the certificate pair specified in ssl-privatekey/
6363
ssl-certificate for authentication.
6464

6565
^^^^^^
@@ -136,11 +136,11 @@ command from the Eggdrop source directory::
136136

137137
When asked about bot's handle, put your handle instead. How to use your
138138
new certificate to connect to Eggdrop, depends on your irc client.
139-
To connect to your bot from the command line, you can use the OpenSSL
140-
ssl client::
139+
To connect to your bot from the command line using the key/cert files
140+
generated in the previous step, you can use the OpenSSL ssl client ::
141+
142+
openssl s_client -cert my.crt -key my.key -connect host:sslport
141143

142-
openssl s_client -cert my.crt -key my.key -connect host:sslport
143-
144144
----------------
145145
SSL/TLS Settings
146146
----------------

eggdrop.conf

+7-1
Original file line numberDiff line numberDiff line change
@@ -1113,12 +1113,18 @@ server add ssl.example.net +7000
11131113
# 1 = ECDSA-NIST256P-CHALLENGE (Uses a certificate; usually requires a
11141114
# public key to be registered with NickServ
11151115
# or other similar service. Set certificate
1116-
# to use in sasl-ecdsa-key setting below)
1116+
# to use in sasl-ecdsa-key setting below.
1117+
# Beware: NIST curve could be backdoored,
1118+
# so please use EXTERNAL or SCRAM instead.)
11171119
#
11181120
# 2 = EXTERNAL (Some other method you set up. Certificates
11191121
# used are defined in ssl-certificate and
11201122
# ssl-privatekey settings in SSL section)
11211123
#
1124+
# 3 = SCRAM-SHA-256
1125+
#
1126+
# 4 = SCRAM-SHA-512
1127+
#
11221128
#set sasl-mechanism 0
11231129

11241130
# Set username to authenticate to IRC NickServ with

misc/generatedocs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ fi
4444

4545

4646
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
47+
source .venv/bin/activate
4748

4849
echo "*** Searching for pandoc..."
4950
PANDOC="$(which pandoc)"

src/dcc.c

+6-24
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,7 @@ static void timeout_dcc_bot_new(int idx)
431431

432432
static void display_dcc_bot_new(int idx, char *buf)
433433
{
434-
long tv;
435-
436-
tv = now - dcc[idx].timeval;
437-
sprintf(buf, "bot* waited %lis", tv);
434+
sprintf(buf, "bot* waited %" PRId64 "s", (int64_t) (now - dcc[idx].timeval));
438435
}
439436

440437
static int expmem_dcc_bot_(void *x)
@@ -794,10 +791,7 @@ static void tout_dcc_chat_pass(int idx)
794791

795792
static void display_dcc_chat_pass(int idx, char *buf)
796793
{
797-
long tv;
798-
799-
tv = now - dcc[idx].timeval;
800-
sprintf(buf, "pass waited %lis", tv);
794+
sprintf(buf, "pass waited %" PRId64 "s", (int64_t) (now - dcc[idx].timeval));
801795
}
802796

803797
static int expmem_dcc_general(void *x)
@@ -1858,10 +1852,7 @@ static void timeout_dcc_telnet_id(int idx)
18581852

18591853
static void display_dcc_telnet_id(int idx, char *buf)
18601854
{
1861-
long tv;
1862-
1863-
tv = now - dcc[idx].timeval;
1864-
sprintf(buf, "t-in waited %lis", tv);
1855+
sprintf(buf, "t-in waited %" PRId64 "s", (int64_t) (now - dcc[idx].timeval));
18651856
}
18661857

18671858
struct dcc_table DCC_TELNET_ID = {
@@ -2012,18 +2003,12 @@ static void tout_dcc_telnet_pw(int idx)
20122003

20132004
static void display_dcc_telnet_new(int idx, char *buf)
20142005
{
2015-
long tv;
2016-
2017-
tv = now - dcc[idx].timeval;
2018-
sprintf(buf, "new waited %lis", tv);
2006+
sprintf(buf, "new waited %" PRId64 "s", (int64_t) (now - dcc[idx].timeval));
20192007
}
20202008

20212009
static void display_dcc_telnet_pw(int idx, char *buf)
20222010
{
2023-
long tv;
2024-
2025-
tv = now - dcc[idx].timeval;
2026-
sprintf(buf, "newp waited %lis", tv);
2011+
sprintf(buf, "newp waited %" PRId64 "s", (int64_t) (now - dcc[idx].timeval));
20272012
}
20282013

20292014
struct dcc_table DCC_TELNET_NEW = {
@@ -2259,10 +2244,7 @@ void eof_dcc_identwait(int idx)
22592244

22602245
static void display_dcc_identwait(int idx, char *buf)
22612246
{
2262-
long tv;
2263-
2264-
tv = now - dcc[idx].timeval;
2265-
sprintf(buf, "idtw waited %lis", tv);
2247+
sprintf(buf, "idtw waited %" PRId64 "s", (int64_t) (now - dcc[idx].timeval));
22662248
}
22672249

22682250
struct dcc_table DCC_IDENTWAIT = {

src/main.c

+11-10
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int nested_debug = 0;
238238
static void write_debug()
239239
{
240240
int x;
241-
char s[25];
241+
char s[26];
242242

243243
if (nested_debug) {
244244
/* Yoicks, if we have this there's serious trouble!
@@ -247,7 +247,7 @@ static void write_debug()
247247
x = creat("DEBUG.DEBUG", 0644);
248248
if (x >= 0) {
249249
setsock(x, SOCK_NONSOCK);
250-
strlcpy(s, ctime(&now), sizeof s);
250+
ctime_r(&now, s);
251251
dprintf(-x, "Debug (%s) written %s\n"
252252
"Please report problem to https://github.com/eggheads/eggdrop/issues\n"
253253
"Check doc/BUG-REPORT on how to do so.", ver, s);
@@ -275,8 +275,8 @@ static void write_debug()
275275
if (x < 0) {
276276
putlog(LOG_MISC, "*", "* Failed to write DEBUG");
277277
} else {
278-
strlcpy(s, ctime(&now), sizeof s);
279-
dprintf(-x, "Debug (%s) written %s\n", ver, s);
278+
ctime_r(&now, s);
279+
dprintf(-x, "Debug (%s) written %s", ver, s);
280280
#ifdef EGG_PATCH
281281
dprintf(-x, "Patch level: %s\n", EGG_PATCH);
282282
#else
@@ -575,7 +575,7 @@ static void core_secondly()
575575
}
576576
nowmins = now / 60;
577577
if (nowmins > lastmin) {
578-
memcpy(&nowtm, localtime(&now), sizeof(struct tm));
578+
localtime_r(&now, &nowtm);
579579
i = 0;
580580
/* Once a minute */
581581
++lastmin;
@@ -599,10 +599,11 @@ static void core_secondly()
599599
check_botnet_pings();
600600

601601
if (!miltime) { /* At midnight */
602-
char s[25];
602+
char s[26];
603603
int j;
604604

605-
strlcpy(s, ctime(&now), sizeof s);
605+
ctime_r(&now, s);
606+
s[24] = 0;
606607
if (quiet_save < 3)
607608
putlog(LOG_ALL, "*", "--- %.11s%s", s, s + 20);
608609
call_hook(HOOK_BACKUP);
@@ -946,7 +947,7 @@ static void init_random(void) {
946947
int main(int arg_c, char **arg_v)
947948
{
948949
int i, j, xx;
949-
char s[25];
950+
char s[26];
950951
FILE *f;
951952
struct sigaction sv;
952953
struct chanset_t *chan;
@@ -1068,8 +1069,8 @@ int main(int arg_c, char **arg_v)
10681069
dns_thread_head = nmalloc(sizeof(struct dns_thread_node));
10691070
dns_thread_head->next = NULL;
10701071
#endif
1071-
strlcpy(s, ctime(&now), sizeof s);
1072-
memmove(&s[11], &s[20], strlen(&s[20]) + 1);
1072+
ctime_r(&now, s);
1073+
s[24] = 0;
10731074
putlog(LOG_ALL, "*", "--- Loading %s (%s)", ver, s);
10741075
chanprog();
10751076
if (!encrypt_pass2 && !encrypt_pass) {

src/misc.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -517,20 +517,20 @@ void putlog (int type, char *chname, const char *format, ...)
517517
va_list va;
518518
time_t now2 = time(NULL);
519519
static time_t now2_last = 0; /* cache expensive localtime() */
520-
static struct tm *t;
520+
static struct tm t;
521521

522522
if (now2 != now2_last) {
523523
now2_last = now2;
524-
t = localtime(&now2);
524+
localtime_r(&now2, &t);
525525
}
526526

527527
va_start(va, format);
528528

529529
/* Create the timestamp */
530530
if (shtime) {
531-
strftime(stamp, sizeof(stamp) - 2, log_ts, t);
532-
strcat(stamp, " ");
533-
tsl = strlen(stamp);
531+
tsl = strftime(stamp, sizeof(stamp) - 2, log_ts, &t);
532+
stamp[tsl++] = ' ';
533+
stamp[tsl] = 0;
534534
}
535535
else
536536
*stamp = '\0';
@@ -544,9 +544,9 @@ void putlog (int type, char *chname, const char *format, ...)
544544
out[LOGLINEMAX - tsl] = 0;
545545
if (keep_all_logs) {
546546
if (!logfile_suffix[0])
547-
strftime(ct, 12, ".%d%b%Y", t);
547+
strftime(ct, 12, ".%d%b%Y", &t);
548548
else {
549-
strftime(ct, 80, logfile_suffix, t);
549+
strftime(ct, 80, logfile_suffix, &t);
550550
ct[80] = 0;
551551
s2 = ct;
552552
/* replace spaces by underscores */

src/mod/channels.mod/channels.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static char *convert_element(char *src, char *dst)
385385
static void write_channels()
386386
{
387387
FILE *f;
388-
char s[sizeof chanfile + 4], w[1024], w2[1024], name[163];
388+
char s[sizeof chanfile + 4], s1[26], w[1024], w2[1024], name[163];
389389
char need1[242], need2[242], need3[242], need4[242], need5[242];
390390
struct chanset_t *chan;
391391
struct udef_struct *ul;
@@ -401,8 +401,9 @@ static void write_channels()
401401
}
402402
if (!quiet_save)
403403
putlog(LOG_MISC, "*", "Writing channel file...");
404-
fprintf(f, "#Dynamic Channel File for %s (%s) -- written %s\n",
405-
botnetnick, ver, ctime(&now));
404+
ctime_r(&now, s1);
405+
fprintf(f, "#Dynamic Channel File for %s (%s) -- written %s",
406+
botnetnick, ver, s1);
406407
for (chan = chanset; chan; chan = chan->next) {
407408
convert_element(chan->dname, name);
408409
get_mode_protect(chan, w);

src/mod/ctcp.mod/ctcp.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ static int ctcp_CLIENTINFO(char *nick, char *uhosr, char *handle,
128128
static int ctcp_TIME(char *nick, char *uhost, char *handle, char *object,
129129
char *keyword, char *text)
130130
{
131-
char tms[25];
131+
char s[26];
132132

133133
if (ctcp_mode == 1)
134134
return 1;
135-
strlcpy(tms, ctime(&now), sizeof tms);
136-
simple_sprintf(ctcp_reply, "%s\001TIME %s\001", ctcp_reply, tms);
135+
ctime_r(&now, s);
136+
s[24] = 0;
137+
simple_sprintf(ctcp_reply, "%s\001TIME %s\001", ctcp_reply, s);
137138
return 1;
138139
}
139140

src/mod/ctcp.mod/help/set/ctcp.help

+1-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ See also: set ctcp-version, set ctcp-finger
1616
Specifies the response to send to a CTCP VERSION request.
1717

1818
For example:
19-
.set ctcp-version "Irssi 0.8.9"
20-
21-
Or
22-
.set ctcp-version "xchat 2.0.7 Linux 2.6.5-1.358smp [i686/2.60GHz/SMP]"
23-
19+
.set ctcp-version "irssi v1.4.5 - running on Linux x86_64"
2420

2521
See also: set ctcp-finger, set ctcp-userinfo
2622
%{help=set ctcp-mode}%{+n}

0 commit comments

Comments
 (0)